X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fitems_cart.inc;h=9d7781deec929f42ff7b730b24e2335b5373c165;hb=6bcd87642330092910f5d6977845a76ac59350ac;hp=92cc1a462c2193a30f3b0ed8d5743eacf933fa2c;hpb=f0e1edfccbf3608463c9da99b40f9c65fd298bb3;p=fa-stable.git diff --git a/includes/ui/items_cart.inc b/includes/ui/items_cart.inc index 92cc1a46..9d7781de 100644 --- a/includes/ui/items_cart.inc +++ b/includes/ui/items_cart.inc @@ -40,7 +40,7 @@ class items_cart var $fixed_asset; - function items_cart($type, $trans_no=0) + function __construct($type, $trans_no=0) { $this->trans_type = $type; $this->order_id = $trans_no; @@ -224,7 +224,7 @@ class items_cart { foreach ($this->gl_items as $gl_item) { - if ($gl_item->person_id) + if (is_subledger_account($gl_item->code_id)) return true; } return false; @@ -309,7 +309,7 @@ class items_cart if (!isset($tax_info['tax_reg']) && isset($tax_info['person_type'])) $tax_info['tax_reg'] = $tax_info['person_type']==PT_CUSTOMER ? TR_OUTPUT : TR_INPUT; - if (count(@$tax_info['net_amount'])) // guess exempt sales/purchase if any tax has been found + if (count_array(@$tax_info['net_amount'])) // guess exempt sales/purchase if any tax has been found { $ex_net = abs($net_sum) - @array_sum($tax_info['net_amount']); if ($ex_net != 0) @@ -407,7 +407,7 @@ class items_cart foreach($cust_trans as $branch_id => $amount) if (floatcmp($amount, 0)) write_cust_journal($this->trans_type, $this->order_id, $branch_id, $this->tran_date, - $this->reference, -$amount, $this->rate); + $this->reference, $amount, $this->rate); // update AP foreach($supp_trans as $supp_id => $amount) if (floatcmp($amount, 0)) @@ -465,7 +465,7 @@ class line_item var $price; var $standard_cost; - function line_item ($stock_id, $qty, $standard_cost=null, $description=null) + function __construct($stock_id, $qty, $standard_cost=null, $description=null) { $item_row = get_item($stock_id); @@ -509,7 +509,7 @@ class gl_item var $branch_id; var $date; - function gl_item($code_id=null, $dimension_id=0, $dimension2_id=0, $amount=0, $memo='', + function __construct($code_id=null, $dimension_id=0, $dimension2_id=0, $amount=0, $memo='', $act_descr=null, $person_id=null, $date=null) { //echo "adding $index, $code_id, $dimension_id, $amount, $reference
";