Merged last changes from stable.
[fa-stable.git] / reporting / rep209.php
index c1632dfd1f1745f869ddff7d90c467af7055bbd8..e5188bc6e812a28d9cd714259855a0534a82bc15 100644 (file)
@@ -34,7 +34,7 @@ print_po();
 function get_po($order_no)
 {
        $sql = "SELECT ".TB_PREF."purch_orders.*, ".TB_PREF."suppliers.supp_name,  "
-               .TB_PREF."suppliers.supp_account_no,".TB_PREF."suppliers.tax_included,".TB_PREF."suppliers.gst_no AS tax_id,
+               .TB_PREF."suppliers.supp_account_no,".TB_PREF."suppliers.tax_included,".TB_PREF."suppliers.tax_algorithm,".TB_PREF."suppliers.gst_no AS tax_id,
                ".TB_PREF."suppliers.curr_code, ".TB_PREF."suppliers.payment_terms, ".TB_PREF."locations.location_name,
                ".TB_PREF."suppliers.address, ".TB_PREF."suppliers.contact, ".TB_PREF."suppliers.tax_group_id
                FROM ".TB_PREF."purch_orders, ".TB_PREF."suppliers, ".TB_PREF."locations
@@ -164,7 +164,7 @@ function print_po()
                $rep->NewLine();
 
                $tax_items = get_tax_for_items($items, $prices, 0,
-                 $myrow['tax_group_id'], $myrow['tax_included'],  null);
+                 $myrow['tax_group_id'], $myrow['tax_included'],  null, $myrow['tax_algorithm']);
                $first = true;
                foreach($tax_items as $tax_item)
                {
@@ -172,7 +172,10 @@ function print_po()
                                continue;
                        $DisplayTax = number_format2($tax_item['Value'], $dec);
 
-                       $tax_type_name = $tax_item['tax_type_name'];
+                       if (isset($suppress_tax_rates) && $suppress_tax_rates == 1)
+                               $tax_type_name = $tax_item['tax_type_name'];
+                       else
+                               $tax_type_name = $tax_item['tax_type_name']." (".$tax_item['rate']."%) ";
 
                        if ($myrow['tax_included'])
                        {