Added missing tax_algorithm retrieval in read_po_header()
[fa-stable.git] / purchasing / includes / supp_trans_class.inc
index 293b59a725b11ff69f6a1816b0aef186e83b6cbf..f95a78258e4fc8f4222fbd2c1e3fb9c4e4c27914 100644 (file)
@@ -21,7 +21,6 @@ class supp_trans
        var $gl_codes; /*array of objects of class gl_codes using a counter as the pointer */
        var $supplier_id;
        var $supplier_name;
-       var $terms_description;
        var $terms;
        
        var $tax_description;
@@ -40,6 +39,9 @@ class supp_trans
        var $ov_discount;
        var $ov_gst;
        var $gl_codes_counter=0;
+       var $credit = 0;
+       var $tax_algorithm;
+       var $stored_algorithm;
 
        function supp_trans($trans_type)
        {
@@ -114,7 +116,7 @@ class supp_trans
         if ($tax_group_id == null)
                $tax_group_id = $this->tax_group_id;
         $taxes = get_tax_for_items($items, $prices, $shipping_cost, $tax_group_id, 
-               $this->tax_included);
+               $this->tax_included, null, $this->tax_algorithm);
 
 ///////////////// Joe Hunt 2009.08.18
 
@@ -156,7 +158,9 @@ class supp_trans
                }       
                return $total;
     }
-
+       //
+       //      Returns transaction total 
+       //
        function get_items_total()
        {
                $total = 0;
@@ -164,12 +168,12 @@ class supp_trans
                foreach ($this->grn_items as $ln_itm)
                        $total += round($ln_itm->this_quantity_inv * $ln_itm->chg_price, user_price_dec());
 
-               return $total;
-
                foreach ($this->gl_codes as $gl_line)
-               {
-                       $total += $gl_line->amount;
+               {   //////// 2010-10-10 Joe Hunt
+                       if (!is_tax_account($gl_line->gl_code) || $this->tax_included)
+                               $total += $gl_line->amount;
                }
+               return $total;
        }
 } /* end of class defintion */