From 3e26b0b633f244ad5d6ad7e18b813b39237865a1 Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Fri, 6 Feb 2009 11:15:50 +0000 Subject: [PATCH] BF [ 1896880 ] Unlink Payment if TrxAmt is zero https://sourceforge.net/tracker/?func=detail&atid=879332&aid=1896880&group_id=176962 --- base/src/org/compiere/model/MBankStatementLine.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/base/src/org/compiere/model/MBankStatementLine.java b/base/src/org/compiere/model/MBankStatementLine.java index afd259dbe9..92e89a03fd 100644 --- a/base/src/org/compiere/model/MBankStatementLine.java +++ b/base/src/org/compiere/model/MBankStatementLine.java @@ -36,6 +36,7 @@ import org.compiere.util.Msg; * [ 1619076 ] Bank statement's StatementDifference becames NULL * * @author Teo Sarca, SC ARHIPAC SERVICE SRL + *
  • BF [ 1896880 ] Unlink Payment if TrxAmt is zero *
  • BF [ 1896885 ] BS Line: don't update header if after save/delete fails */ public class MBankStatementLine extends X_C_BankStatementLine @@ -153,6 +154,12 @@ import org.compiere.util.Msg; log.saveError("FillMandatory", Msg.getElement(getCtx(), "C_Charge_ID")); return false; } + // Un-link Payment if TrxAmt is zero - teo_sarca BF [ 1896880 ] + if (getTrxAmt().signum() == 0 && getC_Payment_ID() > 0) + { + setC_Payment_ID(I_ZERO); + setC_Invoice_ID(I_ZERO); + } // Set Line No if (getLine() == 0) {