diff --git a/base/src/org/compiere/FA/ImportAsset.java b/base/src/org/compiere/FA/ImportAsset.java
index 99e5fae307..7af976fa6c 100644
--- a/base/src/org/compiere/FA/ImportAsset.java
+++ b/base/src/org/compiere/FA/ImportAsset.java
@@ -174,7 +174,7 @@ public class ImportAsset extends SvrProcess
// Update Assets from Import
StringBuffer sqlB = new StringBuffer ("UPDATE A_Asset "
- + "SET( A_Asset_ID,"
+ + "SET (A_Asset_ID,"
+ "AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,"
+ "Value,Name,Description,Help,"
+ "A_Asset_Group_ID,M_Product_ID,SerNo,LOT,VersionNo,GuaranteeDate,"
diff --git a/base/src/org/compiere/acct/Doc_Inventory.java b/base/src/org/compiere/acct/Doc_Inventory.java
index 50c4daf86e..89959bd21b 100644
--- a/base/src/org/compiere/acct/Doc_Inventory.java
+++ b/base/src/org/compiere/acct/Doc_Inventory.java
@@ -36,6 +36,8 @@ import org.compiere.util.Env;
* @author Jorg Janke
* @author Armen Rizal, Goodwill Consulting
*
BF [ 1745154 ] Cost in Reversing Material Related Docs
+ * @author red1
+ * BF [ 2982994 ] Internal Use Inventory does not reverse Accts
* @version $Id: Doc_Inventory.java,v 1.3 2006/07/30 00:53:33 jjanke Exp $
*/
public class Doc_Inventory extends Doc
@@ -175,7 +177,16 @@ public class Doc_Inventory extends Doc
// InventoryDiff DR CR
// or Charge
- MAccount invDiff = line.getChargeAccount(as, costs.negate());
+ MAccount invDiff = null;
+ if (m_DocStatus.equals(MInventory.DOCSTATUS_Reversed)
+ && m_Reversal_ID != 0
+ && line.getReversalLine_ID() != 0
+ && line.getC_Charge_ID() != 0) {
+ invDiff = line.getChargeAccount(as, costs);
+ } else {
+ invDiff = line.getChargeAccount(as, costs.negate());
+ }
+
if (invDiff == null)
invDiff = getAccount(Doc.ACCTTYPE_InvDifferences, as);
cr = fact.createLine(line, invDiff,
@@ -186,6 +197,7 @@ public class Doc_Inventory extends Doc
cr.setQty(line.getQty().negate());
if (line.getC_Charge_ID() != 0) // explicit overwrite for charge
cr.setAD_Org_ID(line.getAD_Org_ID());
+
if (m_DocStatus.equals(MInventory.DOCSTATUS_Reversed) && m_Reversal_ID !=0 && line.getReversalLine_ID() != 0)
{
// Set AmtAcctCr from Original Phys.Inventory
diff --git a/base/src/org/compiere/model/CalloutBankStatement.java b/base/src/org/compiere/model/CalloutBankStatement.java
index 2972231fdf..70693dee69 100644
--- a/base/src/org/compiere/model/CalloutBankStatement.java
+++ b/base/src/org/compiere/model/CalloutBankStatement.java
@@ -51,6 +51,7 @@ public class CalloutBankStatement extends CalloutEngine
return "";
int C_BankAccount_ID = ((Integer)value).intValue();
MBankAccount ba = MBankAccount.get(ctx, C_BankAccount_ID);
+ ba.load(ba.get_TrxName());
mTab.setValue("BeginningBalance", ba.getCurrentBalance());
return "";
} // bankAccount
diff --git a/base/src/org/compiere/model/MBankStatement.java b/base/src/org/compiere/model/MBankStatement.java
index ba703ee4e2..5e29a788c3 100644
--- a/base/src/org/compiere/model/MBankStatement.java
+++ b/base/src/org/compiere/model/MBankStatement.java
@@ -236,9 +236,10 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
*/
protected boolean beforeSave (boolean newRecord)
{
- if (getBeginningBalance().compareTo(Env.ZERO) == 0)
+ if (! isProcessed() && getBeginningBalance().compareTo(Env.ZERO) == 0)
{
MBankAccount ba = getBankAccount();
+ ba.load(get_TrxName());
setBeginningBalance(ba.getCurrentBalance());
}
setEndingBalance(getBeginningBalance().add(getStatementDifference()));
@@ -391,6 +392,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
}
// Update Bank Account
MBankAccount ba = getBankAccount();
+ ba.load(get_TrxName());
//BF 1933645
ba.setCurrentBalance(ba.getCurrentBalance().add(getStatementDifference()));
ba.save(get_TrxName());
@@ -446,6 +448,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction
//Added Lines by AZ Goodwill
//Restore Bank Account Balance
MBankAccount ba = getBankAccount();
+ ba.load(get_TrxName());
ba.setCurrentBalance(ba.getCurrentBalance().subtract(getStatementDifference()));
ba.saveEx();
//End of Added Lines