Topic: Closing a fiscal year needs to update the query a bit.
The fiscal year close needs to change the query to get the amount.
It was now like this.
// retrieve total balances from balance sheet accounts
$sql = "SELECT SUM(amount) FROM ".TB_PREF."gl_trans INNER JOIN ".TB_PREF."chart_master ON account=account_code
INNER JOIN ".TB_PREF."chart_types ON account_type=id INNER JOIN ".TB_PREF."chart_class ON class_id=cid
WHERE ctype>=".CL_ASSETS." AND ctype <=".CL_EQUITY." AND tran_date <= '$to'";
And it should be like this
// retrieve total balances from balance sheet accounts
$sql = "SELECT SUM(amount) FROM ".TB_PREF."gl_trans trans LEFT JOIN ".TB_PREF."voided v ON trans.type_no=v.id AND v.type=trans.type INNER JOIN ".TB_PREF."chart_master ON account=account_code
INNER JOIN ".TB_PREF."chart_types types ON account_type=types.id INNER JOIN ".TB_PREF."chart_class ON class_id=cid WHERE ctype>=".CL_ASSETS." AND ctype <=".CL_EQUITY." AND tran_date <= '$to' AND ISNULL(v.date_)";
I think we missed to check voided transactions before getting results.
HRM CRM POS batch Themes