Trial Balance : remove lines where account has no beginning balance and movement?

29 views
Skip to first unread message

Nicolas Micoud

unread,
Jul 18, 2024, 3:19:56 AM (11 days ago) Jul 18
to iDempiere
Hi,

I have a requirement from a customer for the Trial Balance.
ATM, all accounts are shown (because they are active in the CoA).

He would like to know if possible to remove lines with:
 - beginning balance = 0
 - no movement

wdyt?

Thanks,

Nicolas

Carlos Antonio Ruiz Gomez

unread,
Jul 18, 2024, 6:52:42 AM (11 days ago) Jul 18
to idem...@googlegroups.com
That sounds like a good option to add as a parameter for the report.

Nicolas Micoud

unread,
Jul 18, 2024, 7:38:31 AM (11 days ago) Jul 18
to iDempiere
Ok, I'll work on that.
I've made some tests and the best option I found was to add a third step in the TrialBalance.doIt method.

createBalanceLine();

createDetailLines();


Right after add something like :

String sql = "DELETE FROM t_trialbalance WHERE ad_pinstance_id = " + getAD_PInstance_ID()

+ " AND account_id IN (SELECT account_id FROM t_trialbalance WHERE ad_pinstance_id = " + getAD_PInstance_ID() + " AND ad_table_id is null and AmtAcctBalance = 0)"

+ " AND account_id IN (SELECT account_id FROM t_trialbalance WHERE ad_pinstance_id = " + getAD_PInstance_ID() + " GROUP BY account_id HAVING count(*) = 1 )";

System.out.println(sql);

int no =DB.executeUpdateEx(sql, get_TrxName());

System.out.println("del " + no);


As we must test the account is only used on opening balance lines.

I can prepare a PR using this approach unless you have suggestion?

Thanks
Reply all
Reply to author
Forward
Message has been deleted
0 new messages