$this->grn_items[$grn_item_id] = new grn_item($grn_item_id, $po_detail_item,
$item_code, $item_description, $qty_recd, $prev_quantity_inv, $this_quantity_inv,
$order_price, $chg_price, $std_cost_unit, $gl_code, $this->tax_included);
$this->grn_items[$grn_item_id] = new grn_item($grn_item_id, $po_detail_item,
$item_code, $item_description, $qty_recd, $prev_quantity_inv, $this_quantity_inv,
$order_price, $chg_price, $std_cost_unit, $gl_code, $this->tax_included);
$this->gl_codes[$this->gl_codes_counter] = new gl_codes($this->gl_codes_counter,
$gl_code, $gl_act_name, $gl_dim, $gl_dim2, $amount, $memo_);
$this->gl_codes_counter++;
$this->gl_codes[$this->gl_codes_counter] = new gl_codes($this->gl_codes_counter,
$gl_code, $gl_act_name, $gl_dim, $gl_dim2, $amount, $memo_);
$this->gl_codes_counter++;
function is_valid_trans_to_post()
{
return (count($this->grn_items) > 0 || count($this->gl_codes) > 0 ||
($this->ov_amount != 0) || ($this->ov_discount > 0));
}
function is_valid_trans_to_post()
{
return (count($this->grn_items) > 0 || count($this->gl_codes) > 0 ||
($this->ov_amount != 0) || ($this->ov_discount > 0));
}
}
if ($tax_group_id == null)
$tax_group_id = $this->tax_group_id;
$taxes = get_tax_for_items($items, $prices, $shipping_cost, $tax_group_id,
}
if ($tax_group_id == null)
$tax_group_id = $this->tax_group_id;
$taxes = get_tax_for_items($items, $prices, $shipping_cost, $tax_group_id,
+ // Taxes included in gl_codes table have exact value, but count to overrides as well.
+ // Therefore when we want to now taxes only for items (gl_codes==false),
+ // we have to subtract gl_taxes from override values.
+ foreach ($this->gl_codes as $gl_code)
// preload the taxgroup !
if ($tax_group_id != null)
$tax_group = get_tax_group_items_as_array($tax_group_id);
// preload the taxgroup !
if ($tax_group_id != null)
$tax_group = get_tax_group_items_as_array($tax_group_id);
foreach ($this->grn_items as $ln_itm)
$total += round(($ln_itm->this_quantity_inv * $ln_itm->taxfree_charge_price($tax_group_id, $tax_group)),
user_price_dec());
foreach ($this->gl_codes as $gl_line)
foreach ($this->grn_items as $ln_itm)
$total += round(($ln_itm->this_quantity_inv * $ln_itm->taxfree_charge_price($tax_group_id, $tax_group)),
user_price_dec());
foreach ($this->gl_codes as $gl_line)
$total += round($ln_itm->this_quantity_inv * $ln_itm->chg_price, user_price_dec());
foreach ($this->gl_codes as $gl_line)
$total += round($ln_itm->this_quantity_inv * $ln_itm->chg_price, user_price_dec());
foreach ($this->gl_codes as $gl_line)
function full_charge_price($tax_group_id, $tax_group=null)
{
return get_full_price_for_item($this->item_code,
$this->chg_price, $tax_group_id, $this->tax_included, $tax_group);
}
function full_charge_price($tax_group_id, $tax_group=null)
{
return get_full_price_for_item($this->item_code,
$this->chg_price, $tax_group_id, $this->tax_included, $tax_group);
}
return get_tax_free_price_for_item($this->item_code, $this->chg_price,
$tax_group_id, $this->tax_included, $tax_group);
}
return get_tax_free_price_for_item($this->item_code, $this->chg_price,
$tax_group_id, $this->tax_included, $tax_group);
}