X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fitems_cart.inc;h=2178fba1dfe5a467d34df7cc01b8bcdc77d2d720;hb=2e181b13aa722a43e78b897404912d6b13a0a937;hp=6a535725a0188bdb93ef416534b0d0e72a1eb5d8;hpb=5dabbe588fe7f06a6d4f2e6fc1ce074ff5f7e8a4;p=fa-stable.git diff --git a/includes/ui/items_cart.inc b/includes/ui/items_cart.inc index 6a535725..2178fba1 100644 --- a/includes/ui/items_cart.inc +++ b/includes/ui/items_cart.inc @@ -1,11 +1,20 @@ . +***********************************************************************/ include_once($path_to_root . "/includes/prefs/sysprefs.inc"); include_once($path_to_root . "/inventory/includes/inventory_db.inc"); class items_cart { - + var $trans_type; var $line_items; var $gl_items; @@ -24,8 +33,9 @@ class items_cart var $person_id; var $branch_id; - function items_cart() + function items_cart($type) { + $this->trans_type = $type; $this->clear_items(); } @@ -66,7 +76,7 @@ class items_cart function remove_from_cart($line_no) { - unset($this->line_items[$line_no]); + array_splice($this->line_items, $line_no, 1); } function count_items() @@ -82,6 +92,7 @@ class items_cart if ($item_ret != null) return $line_no; } + return -1; } // ----------- GL item functions @@ -99,7 +110,7 @@ class items_cart else { // shouldn't come here under normal circumstances - display_db_error("unexpected - adding an invalid item or null quantity", "", true); + display_db_error("unexpected - invalid parameters in add_gl_item($code_id, $dimension_id, $dimension2_id, $amount,...)", "", true); } return false; @@ -121,7 +132,7 @@ class items_cart { if (isset($index)) { - unset($this->gl_items[$index]); + array_splice($this->gl_items, $line_no, 1); } }