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();