Added trans_type parameter to items_cart()
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 29 Jun 2008 21:12:32 +0000 (21:12 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 29 Jun 2008 21:12:32 +0000 (21:12 +0000)
includes/ui/items_cart.inc
inventory/adjustments.php
inventory/transfers.php
manufacturing/work_order_issue.php

index 6a535725a0188bdb93ef416534b0d0e72a1eb5d8..fb2ac021694058ed01d676935ebb70fe15951122 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();
        }
 
index 2f837fa0d7394c8aacc149fc6d10af1196348380..dda848d7da92f306fab1d9c4683255e9e0cdcb59 100644 (file)
@@ -81,7 +81,7 @@ function handle_new_order()
 
     session_register("adj_items");
 
-    $_SESSION['adj_items'] = new items_cart;
+    $_SESSION['adj_items'] = new items_cart(systypes::inventory_adjustment());
        $_POST['AdjDate'] = Today();
        if (!is_date_in_fiscalyear($_POST['AdjDate']))
                $_POST['AdjDate'] = end_fiscalyear();
@@ -247,8 +247,8 @@ echo "</TD>";
 end_row();
 end_table(1);
 
-submit_center_first('Update', _("Update"), '', true);
-submit_center_last('Process', _("Process Transfer"), '', true);
+submit_center_first('Update', _("Update"), '', null);
+submit_center_last('Process', _("Process Adjustment"), '', true);
 
 end_form();
 end_page();
index b76557a0fb6aa9e27ccdbdb45eb7d8b220e2f97f..a17253d50bb1e7b95bfac6b47c97687c133b9533 100644 (file)
@@ -79,7 +79,7 @@ function handle_new_order()
 
     session_register("transfer_items");
 
-       $_SESSION['transfer_items'] = new items_cart;
+       $_SESSION['transfer_items'] = new items_cart(systypes::location_transfer());
        $_POST['AdjDate'] = Today();
        if (!is_date_in_fiscalyear($_POST['AdjDate']))
                $_POST['AdjDate'] = end_fiscalyear();
@@ -214,9 +214,6 @@ $id = find_submit('Delete');
 if ($id != -1)
        handle_delete_item($id);
 
-//if (isset($_GET['Delete']) || isset($_GET['Edit']))
-//     copy_from_st();
-
 if (isset($_POST['AddItem']) || isset($_POST['UpdateItem'])) {
        copy_to_st();
        line_start_focus();
@@ -252,7 +249,7 @@ echo "</td>";
 end_row();
 end_table(1);
 
-submit_center_first('Update', _("Update"), '', true);
+submit_center_first('Update', _("Update"), '', null);
 submit_center_last('Process', _("Process Transfer"), '', true);
 
 end_form();
index d2f8e2f0c8ad236567d5640f3b3d263cd61df971..31269cfc753b56e52ffa0446e48a567e1cae7f1e 100644 (file)
@@ -50,7 +50,7 @@ function handle_new_order()
 
      Session_register("issue_items");
 
-     $_SESSION['issue_items'] = new items_cart;
+     $_SESSION['issue_items'] = new items_cart(28);
      $_SESSION['issue_items']->order_id = $_GET['trans_no'];
 }