From 218cf521781f112cf4afadc572ad43983ca2edd0 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Sat, 12 Jul 2008 22:23:22 +0000 Subject: [PATCH] Added GL Summary of Tax Report (rep709.php). Usable only if different Tax Accounts are used. --- CHANGELOG.txt | 4 ++++ reporting/rep709.php | 57 ++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 69103e70..a4d44032 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,10 @@ Legend: ! -> Note $ -> Affected files +13-Jul-2008 Joe Hunt ++ Added GL Summary of Tax Report (rep709.php). Usable only if different Tax Accounts are used. +$ /reporting/rep709.php + 12-Jul-2008 Joe Hunt ! Rewrite of Tax Report (rep709.php). $ /reporting/rep709.php diff --git a/reporting/rep709.php b/reporting/rep709.php index c6ce2c3d..6f0139a1 100644 --- a/reporting/rep709.php +++ b/reporting/rep709.php @@ -36,8 +36,6 @@ function getCustTransactions($from, $to) $todate = date2sql($to); $netamount = "IF(".TB_PREF."debtor_trans.type=11,-(ov_amount+ov_freight+ov_discount),ov_amount+ov_freight+ov_discount)*".TB_PREF."debtor_trans.rate"; - // IF(".TB_PREF."debtor_trans.type=11,-(ov_amount+ov_freight+ov_discount),ov_amount+ov_freight+ov_discount)*rate AS NetAmount, - // IF(".TB_PREF."debtor_trans.type=11,-(ov_gst+ov_freight_tax),ov_gst+ov_freight_tax)*rate AS Tax $sql = "SELECT ".TB_PREF."debtor_trans.reference, ".TB_PREF."debtor_trans.trans_no, @@ -390,6 +388,61 @@ function print_tax_report() } $rep->Line($rep->row - 4); + $rep->row -= 16; + $rep->TextCol(0, 5, _("General Ledger")); + $rep->Line($rep->row - 6); + + $rep->row -= 22; + + $trow = $rep->row; + + $idcounter = count($taxes); + $i = 0; + for ($j = 0; $j < $idcounter; $j++) + { + $tx = getTaxInfo($taxes[$j]); + $str = $tx['name'] . " " . number_format2($tx['rate'], $dec) . "%"; + $rep->TextCol($i, $i + 1, $str); + $rep->NewLine(); + } + $i++; + $rep->row = $trow; + for ($j = 0; $j < $idcounter; $j++) + { + $tx = getTaxInfo($taxes[$j]); + $acc = get_gl_account($tx['sales_gl_code']); + $rep->TextCol($i, $i + 1, $acc['account_code']." ".$acc['account_name']); + $rep->NewLine(); + } + $i++; + $rep->row = $trow; + for ($j = 0; $j < $idcounter; $j++) + { + $tx = getTaxInfo($taxes[$j]); + $amount = get_gl_trans_from_to($from, $to, $tx['sales_gl_code']); + $rep->TextCol($i, $i + 1,number_format2(-$amount, $dec)); + $rep->NewLine(); + } + $i++; + $rep->row = $trow; + for ($j = 0; $j < $idcounter; $j++) + { + $tx = getTaxInfo($taxes[$j]); + $acc = get_gl_account($tx['purchasing_gl_code']); + $rep->TextCol($i, $i + 1, $acc['account_code']." ".$acc['account_name']); + $rep->NewLine(); + } + $i++; + $rep->row = $trow; + for ($j = 0; $j < $idcounter; $j++) + { + $tx = getTaxInfo($taxes[$j]); + $amount = get_gl_trans_from_to($from, $to, $tx['purchasing_gl_code']); + $rep->TextCol($i, $i + 1,number_format2($amount, $dec)); + $rep->NewLine(); + } + $rep->Line($rep->row - 4); + $locale = $path_to_root . "lang/" . $_SESSION['language']->code . "/locale.inc"; if (file_exists($locale)) { -- 2.30.2