Release 2.3.23
[fa-stable.git] / purchasing / includes / po_class.inc
index b767e9ea9261f66e9ee64245c4f9067bae4bd475..f9f75aacc027574db79d361e770ba2f2c3201d5c 100644 (file)
@@ -33,8 +33,10 @@ class purch_order
        var $tax_group_array = null; // saves db queries
        var $tax_included; // type of prices
        var $terms;
-       
+       var $ex_rate;
+
        var $reference;
+       var $tax_overrides = array();           // array of taxes manually inserted during sales invoice entry (direct invoice)
        
        function purch_order()
        {
@@ -55,7 +57,7 @@ class purch_order
        
        function add_to_order($line_no, $stock_id, $qty, $item_descr, $price, $uom, $req_del_date, $qty_inv, $qty_recd)
        {
-               if ($qty != 0 && isset($qty))
+               if (isset($qty) && $qty != 0)
                {
                        $this->line_items[$line_no] = new po_line_details($line_no, $stock_id, $item_descr, $qty, $price, $uom, 
                                $req_del_date, $qty_inv, $qty_recd);
@@ -148,7 +150,11 @@ class purch_order
                        $val = $taxes['1']['Value'];
                        $val1 = (floatval((intval(round(($val*20),0)))/20));
                        $taxes['1']['Value'] = $val1;
-               } 
+               }
+               foreach($this->tax_overrides as $id => $value) // add values entered manually
+               {
+                       $taxes[$id]['Override'] = $value;
+               }
                return $taxes;
        }