X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fincludes%2Fpo_class.inc;h=0464c42b6fe73fdaa627f257be9d408f0e1a330f;hb=927ebef2443b6dda544056e33ec84b71d2bdb6c2;hp=840569271349a309d4a6184fcedf351417bd8a98;hpb=c696fcc9ed013beb349faca8a5ea95d0632d66b7;p=fa-stable.git diff --git a/purchasing/includes/po_class.inc b/purchasing/includes/po_class.inc index 84056927..0464c42b 100644 --- a/purchasing/includes/po_class.inc +++ b/purchasing/includes/po_class.inc @@ -35,9 +35,16 @@ class purch_order var $tax_algorithm; var $stored_algorithm; // copy to find the change after invoice in processed var $terms; - + var $ex_rate; + var $cash_account; + var $reference; + var $tax_overrides = array(); // array of taxes manually inserted during sales invoice entry (direct invoice) + var $prep_amount = 0; // prepayment required + var $alloc; // sum of payments allocated + var $prepayments = array(); + function purch_order() { /*Constructor function initialises a new purchase order object */ @@ -58,7 +65,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); @@ -145,11 +152,17 @@ class purch_order } $taxes = get_tax_for_items($items, $prices, $shipping_cost, $this->tax_group_id, $this->tax_included, $this->tax_group_array, $this->tax_algorithm); + // Adjustment for swiss franken, we always have 5 rappen = 1/20 franken if ($this->curr_code == 'CHF') { $val = $taxes['1']['Value']; - $taxes['1']['Value'] = (floatval((intval(round(($val*20),0)))/20)); - } + $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; } @@ -239,4 +252,3 @@ class po_line_details } } -?>