From 100da407ea6f70526980e8f89c036b6f32e8814a Mon Sep 17 00:00:00 2001 From: vpj-cd Date: Tue, 3 Apr 2007 05:30:18 +0000 Subject: [PATCH] Fixed [ adempiere-Bugs-1693362 ] current ADempiere show credit and debit negative http://sourceforge.net/tracker/?func=detail&atid=879332&aid=1693362&group_id=176962 --- .../server/org/compiere/acct/FactLine.java | 37 ++++++++++++++++++- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/serverRoot/src/main/server/org/compiere/acct/FactLine.java b/serverRoot/src/main/server/org/compiere/acct/FactLine.java index acba7a6d2a..6e34d43dfc 100644 --- a/serverRoot/src/main/server/org/compiere/acct/FactLine.java +++ b/serverRoot/src/main/server/org/compiere/acct/FactLine.java @@ -175,7 +175,27 @@ public final class FactLine extends X_Fact_Acct * @return true, if any if the amount is not zero */ public boolean setAmtSource (int C_Currency_ID, BigDecimal AmtSourceDr, BigDecimal AmtSourceCr) - { + { + // begin Victor Perez e-evolution 30.08.2005 + // fix Debit & Credit + if (AmtSourceDr != null) + { + if (AmtSourceDr.compareTo(Env.ZERO) == -1) + { + AmtSourceCr = AmtSourceDr.abs(); + AmtSourceDr = Env.ZERO; + } + } + if (AmtSourceCr != null) + { + if (AmtSourceCr.compareTo(Env.ZERO) == -1) + { + AmtSourceDr = AmtSourceCr.abs(); + AmtSourceCr = Env.ZERO; + } + } + // end Victor Pérez e-evolution 30.08.2005 + setC_Currency_ID (C_Currency_ID); if (AmtSourceDr != null) setAmtSourceDr (AmtSourceDr); @@ -207,7 +227,20 @@ public final class FactLine extends X_Fact_Acct * @param AmtAcctCr acct amount cr */ public void setAmtAcct(BigDecimal AmtAcctDr, BigDecimal AmtAcctCr) - { + { + // begin Victor Perez e-evolution 30.08.2005 + // fix Debit & Credit + if (AmtAcctDr.compareTo(Env.ZERO) == -1) + { + AmtAcctCr = AmtAcctDr.abs(); + AmtAcctDr = Env.ZERO; + } + if (AmtAcctCr.compareTo(Env.ZERO) == -1) + { + AmtAcctDr = AmtAcctCr.abs(); + AmtAcctCr = Env.ZERO; + } + // end Victor Perez e-evolution 30.08.2005 setAmtAcctDr (AmtAcctDr); setAmtAcctCr (AmtAcctCr); } // setAmtAcct