IDEMPIERE-4128 Matched invoice posting with wrong precision based on transaction currency instead of schema currency (#317)

- minor unit testing improvement
This commit is contained in:
hengsin 2020-10-27 01:24:57 +08:00 committed by GitHub
parent fa86359570
commit 6e9a547049
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -679,11 +679,15 @@ public class MatchInvTest extends AbstractTestCase {
MFactAcct fa = new MFactAcct(Env.getCtx(), id, getTrxName()); MFactAcct fa = new MFactAcct(Env.getCtx(), id, getTrxName());
if (fa.getAccount_ID() == acctNIR.getAccount_ID()) { if (fa.getAccount_ID() == acctNIR.getAccount_ID()) {
assertTrue(fa.getAmtAcctDr().compareTo(Env.ZERO) >= 0); assertTrue(fa.getAmtAcctDr().compareTo(Env.ZERO) >= 0);
assertTrue(fa.getAmtAcctDr().compareTo(acctAmount) == 0, fa.getAmtAcctDr().toPlainString() + " != " + acctAmount.toPlainString()); assertTrue(fa.getAmtAcctDr().toPlainString().compareTo(acctAmount.toPlainString()) == 0, fa.getAmtAcctDr().toPlainString() + " != " + acctAmount.toPlainString());
// verify source amt and currency
assertTrue(fa.getC_Currency_ID() == japaneseYen.getC_Currency_ID());
assertTrue(fa.getAmtSourceDr().toPlainString().compareTo(acctSource.toPlainString()) == 0, fa.getAmtSourceDr().toPlainString() + " != " + acctSource.toPlainString()); assertTrue(fa.getAmtSourceDr().toPlainString().compareTo(acctSource.toPlainString()) == 0, fa.getAmtSourceDr().toPlainString() + " != " + acctSource.toPlainString());
} else if (fa.getAccount_ID() == acctInvClr.getAccount_ID()) { } else if (fa.getAccount_ID() == acctInvClr.getAccount_ID()) {
assertTrue(fa.getAmtAcctCr().compareTo(Env.ZERO) >= 0); assertTrue(fa.getAmtAcctCr().compareTo(Env.ZERO) >= 0);
assertTrue(fa.getAmtAcctCr().compareTo(acctAmount) == 0, fa.getAmtAcctCr().toPlainString() + " != " + acctAmount.toPlainString()); assertTrue(fa.getAmtAcctCr().toPlainString().compareTo(acctAmount.toPlainString()) == 0, fa.getAmtAcctCr().toPlainString() + " != " + acctAmount.toPlainString());
// verify source amt and currency
assertTrue(fa.getC_Currency_ID() == japaneseYen.getC_Currency_ID());
assertTrue(fa.getAmtSourceCr().toPlainString().compareTo(acctSource.toPlainString()) == 0, fa.getAmtSourceCr().toPlainString() + " != " + acctSource.toPlainString()); assertTrue(fa.getAmtSourceCr().toPlainString().compareTo(acctSource.toPlainString()) == 0, fa.getAmtSourceCr().toPlainString() + " != " + acctSource.toPlainString());
} }
} }