X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=gl%2Finquiry%2Fgl_trial_balance.php;h=27fc37df0e70b185ccf17a2f85d094e64c31fa70;hb=b814319d8fa32f95ee65de79df28083d9d38f68e;hp=8d1ad8bcba2d79aae5827baa231e750b244c2ba7;hpb=ee99111dd71368df55d64a7b18b313f7f30d96cf;p=fa-stable.git diff --git a/gl/inquiry/gl_trial_balance.php b/gl/inquiry/gl_trial_balance.php index 8d1ad8bc..27fc37df 100644 --- a/gl/inquiry/gl_trial_balance.php +++ b/gl/inquiry/gl_trial_balance.php @@ -1,5 +1,14 @@ . +***********************************************************************/ $page_security = 8; $path_to_root="../.."; @@ -46,7 +55,7 @@ function gl_inquiry_controls() function get_balance($account, $from, $to, $from_incl=true, $to_incl=true) { - $sql = "SELECT SUM(IF(amount >= 0, amount, 0)) as debit, SUM(IF(amount < 0, -amount, 0)) as credit, SUM(amount) as balance + $sql = "SELECT SUM(IF(amount >= 0, amount, 0)) AS debit, SUM(IF(amount < 0, -amount, 0)) AS credit, SUM(amount) AS balance FROM ".TB_PREF."gl_trans,".TB_PREF."chart_master,".TB_PREF."chart_types, ".TB_PREF."chart_class WHERE ".TB_PREF."gl_trans.account=".TB_PREF."chart_master.account_code AND ".TB_PREF."chart_master.account_type=".TB_PREF."chart_types.id AND ".TB_PREF."chart_types.class_id=".TB_PREF."chart_class.cid AND";