Merge bug fixes from release to trunk
merge 11921, 11990, 11991 Revision: 11921 Fix [2982890] Data corruption when void bank statement Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2982890 Revision: 11990 Fix [2982994] - Internal Use Inventory does not reverse Accts / thanks to Redhuan Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2982994 Revision: 11991 Fix [2951947] Fixed Assets -> String Index out of Range ConvertPostgresql is sensitive to the way sql is written Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2951947 Tony
This commit is contained in:
parent
02250a06a3
commit
a4ded83c4e
|
@ -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,"
|
||||
|
|
|
@ -36,6 +36,8 @@ import org.compiere.util.Env;
|
|||
* @author Jorg Janke
|
||||
* @author Armen Rizal, Goodwill Consulting
|
||||
* <li>BF [ 1745154 ] Cost in Reversing Material Related Docs
|
||||
* @author red1
|
||||
* <li>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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue