Added GL Summary of Tax Report (rep709.php). Usable only if different Tax Accounts...
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sat, 12 Jul 2008 22:23:22 +0000 (22:23 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sat, 12 Jul 2008 22:23:22 +0000 (22:23 +0000)
CHANGELOG.txt
reporting/rep709.php

index 69103e70b7d137ddf770607cb74b462f2945d5c1..a4d44032b7e8ebc224b66f6d3f8ce45156792f01 100644 (file)
@@ -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
index c6ce2c3ddf5c33d5135946557f7c2fd3e14ef810..6f0139a1ff769f94b0bee02f5bbd34c5a3091515 100644 (file)
@@ -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))
        {