X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fincludes%2Fpo_class.inc;h=b767e9ea9261f66e9ee64245c4f9067bae4bd475;hb=4e4ce8577f8582967995919860c66aa94d633afd;hp=c9ab5b0785570bb935c906e3976cd9c2d966535d;hpb=9af96a2e461b905dbb20f2b87ffb5c28f9b3461c;p=fa-stable.git diff --git a/purchasing/includes/po_class.inc b/purchasing/includes/po_class.inc index c9ab5b07..b767e9ea 100644 --- a/purchasing/includes/po_class.inc +++ b/purchasing/includes/po_class.inc @@ -124,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(); @@ -134,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); @@ -226,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); + } } ?>