X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fincludes%2Fpo_class.inc;h=b767e9ea9261f66e9ee64245c4f9067bae4bd475;hb=4e4ce8577f8582967995919860c66aa94d633afd;hp=fa8961935661a9be7f9caba60f67ca3102ebee5a;hpb=64d4d934eeecbc56ce59b60ec12183878f69b6f6;p=fa-stable.git diff --git a/purchasing/includes/po_class.inc b/purchasing/includes/po_class.inc index fa896193..b767e9ea 100644 --- a/purchasing/includes/po_class.inc +++ b/purchasing/includes/po_class.inc @@ -25,12 +25,14 @@ class purch_order var $supplier_id; var $supplier_name; var $orig_order_date; + var $due_date; var $order_no; /*Only used for modification of existing orders otherwise only established when order committed */ var $lines_on_order = 0; var $credit; var $tax_group_id; var $tax_group_array = null; // saves db queries var $tax_included; // type of prices + var $terms; var $reference; @@ -122,8 +124,12 @@ class purch_order } return 0; } - - function get_taxes($shipping_cost=null) + + // + // Returns taxes for PO/GRN. + // $receival=true in purchase receive context. + // + function get_taxes($shipping_cost=null, $receival=false) { $items = array(); $prices = array(); @@ -132,7 +138,7 @@ class purch_order foreach ($this->line_items as $ln_itm) { $items[] = $ln_itm->stock_id; - $prices[] = round($ln_itm->quantity * $ln_itm->price, user_price_dec()); + $prices[] = round($ln_itm->price * ($receival ? $ln_itm->receive_qty : $ln_itm->quantity), user_price_dec()); } $taxes = get_tax_for_items($items, $prices, $shipping_cost, $this->tax_group_id, $this->tax_included, $this->tax_group_array); @@ -224,6 +230,12 @@ class po_line_details $this->standard_cost =0; $this->grn_item_id = $grn_item_id; } + + function taxfree_charge_price($po) + { + return get_tax_free_price_for_item($this->stock_id, $this->price, + $po->tax_group_id, $po->tax_included, $po->tax_group_array); + } } ?>