Improved quick entries.
[fa-stable.git] / includes / ui / items_cart.inc
index 6a535725a0188bdb93ef416534b0d0e72a1eb5d8..66a17feac93570cd727849ff159a8d175cba3a25 100644 (file)
@@ -5,7 +5,7 @@ include_once($path_to_root . "/inventory/includes/inventory_db.inc");
 
 class items_cart
 {
-
+       var $trans_type;
        var $line_items;
        var $gl_items;
 
@@ -24,8 +24,9 @@ class items_cart
        var $person_id;
        var $branch_id;
 
-       function items_cart()
+       function items_cart($type)
        {
+               $this->trans_type = $type;
                $this->clear_items();
        }
 
@@ -82,6 +83,7 @@ class items_cart
                        if ($item_ret != null)
                                return $line_no;
                }
+               return -1;
        }
 
        // ----------- GL item functions
@@ -99,7 +101,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;