From fdf32a13704e6acd49218b3b95b1aea1b0cc0286 Mon Sep 17 00:00:00 2001 From: tspc Date: Fri, 2 Apr 2010 22:05:17 +0000 Subject: [PATCH] Merge bug fixes from release to trunk merge 11866, 11868, 11892 11866 -> Fix [2383795] DistributeLandedCost to a single line does not work - thanks to SCalderon Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2383795 11868 -> Fix [2383866] Distribute LandedCost to a single line, base is not set - thanks to SCalderon Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2383866 11892 -> Fix [2980523] create payment sets charge to 0 Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2980523 Tony --- base/src/org/compiere/model/MBankStatementLine.java | 8 +++++++- base/src/org/compiere/model/MInvoiceLine.java | 4 +++- base/src/org/compiere/process/BankStatementPayment.java | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/base/src/org/compiere/model/MBankStatementLine.java b/base/src/org/compiere/model/MBankStatementLine.java index ad7922a9e5..a365ba88ce 100644 --- a/base/src/org/compiere/model/MBankStatementLine.java +++ b/base/src/org/compiere/model/MBankStatementLine.java @@ -127,8 +127,14 @@ import org.compiere.util.Msg; setC_Currency_ID (payment.getC_Currency_ID()); // BigDecimal amt = payment.getPayAmt(true); + BigDecimal chargeAmt = getChargeAmt(); + if (chargeAmt == null) + chargeAmt = Env.ZERO; + BigDecimal interestAmt = getInterestAmt(); + if (interestAmt == null) + interestAmt = Env.ZERO; setTrxAmt(amt); - setStmtAmt(amt); + setStmtAmt(amt.add(chargeAmt).add(interestAmt)); // setDescription(payment.getDescription()); } // setPayment diff --git a/base/src/org/compiere/model/MInvoiceLine.java b/base/src/org/compiere/model/MInvoiceLine.java index 0760fd1a99..7e319aaa1f 100644 --- a/base/src/org/compiere/model/MInvoiceLine.java +++ b/base/src/org/compiere/model/MInvoiceLine.java @@ -1004,7 +1004,7 @@ public class MInvoiceLine extends X_C_InvoiceLine if (lcs.length == 1) { MLandedCost lc = lcs[0]; - if (lc.getM_InOut_ID() != 0) + if (lc.getM_InOut_ID() != 0 && lc.getM_InOutLine_ID() == 0) { // Create List ArrayList list = new ArrayList(); @@ -1065,6 +1065,8 @@ public class MInvoiceLine extends X_C_InvoiceLine MLandedCostAllocation lca = new MLandedCostAllocation (this, lc.getM_CostElement_ID()); lca.setM_Product_ID(iol.getM_Product_ID()); lca.setM_AttributeSetInstance_ID(iol.getM_AttributeSetInstance_ID()); + BigDecimal base = iol.getBase(lc.getLandedCostDistribution()); + lca.setBase(base); lca.setAmt(getLineNetAmt()); // MZ Goodwill // add set Qty from InOutLine diff --git a/base/src/org/compiere/process/BankStatementPayment.java b/base/src/org/compiere/process/BankStatementPayment.java index 181e09b81f..d6deadf000 100644 --- a/base/src/org/compiere/process/BankStatementPayment.java +++ b/base/src/org/compiere/process/BankStatementPayment.java @@ -98,7 +98,7 @@ public class BankStatementPayment extends SvrProcess ibs.setC_Payment_ID(payment.getC_Payment_ID()); ibs.setC_Currency_ID (payment.getC_Currency_ID()); - ibs.setTrxAmt(payment.getPayAmt()); + ibs.setTrxAmt(payment.getPayAmt(true)); ibs.save(); // String retString = "@C_Payment_ID@ = " + payment.getDocumentNo();