public void testGLTransactionImpact() { GLTransaction t = new GLTransaction("Test transaction"); t.createDebit(cashUS, new BigDecimal("1000.00"), null, (short) 840); t.createCredit(cashUS, new BigDecimal("100.00"), null, (short) 1840); assertEquals(new BigDecimal("900.00"), t.getImpact(cashUS, new short[] {840, 1840})); assertEquals(new BigDecimal("1000.00"), t.getImpact(cashUS, new short[] {840})); assertEquals(new BigDecimal("-100.00"), t.getImpact(cashUS, new short[] {1840})); }
private GLTransaction createTransaction(String desc) throws Exception { GLTransaction txn = new GLTransaction(desc); txn.setPostDate(POSTDATE); txn.createDebit(A, new BigDecimal("1000.00"), null); txn.createDebit(A, new BigDecimal("200.00"), null, (short) 858); txn.createCredit(B, new BigDecimal("1000.00"), null); // txn.createCredit (B, new BigDecimal ("200.00"), null, (short) 858); return txn; }