X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=item_schedule.php;h=accb8da14034b75e4b37561ccb3dd7a7ad2f82b2;hb=514ad9dfb6f8ea147b9cb9ee9b89d2b0b485b607;hp=8fb4247993b8c33589b038d0cf3df6a5462ad9bf;hpb=725ee2cbbf14949ba2bdebdb6c2bda560580cb9f;p=order_line_extra.git
diff --git a/item_schedule.php b/item_schedule.php
index 8fb4247..accb8da 100644
--- a/item_schedule.php
+++ b/item_schedule.php
@@ -19,6 +19,8 @@ include_once($path_to_root . "/reporting/includes/reporting.inc");
//include_once("includes/item_scheduler.inc");
include_once("hincludes/lib/php/Boot.class.php");
+include_once("includes/db_order_lines.inc");
+include_once("config.php");
$page_security = 'SA_ORDERLINEX_EDIT';
add_access_extensions();
@@ -31,16 +33,13 @@ page($_SESSION['page_title'], false, false, "", $js);
//---------------------------------------------------------------------------------------------
+div_start('item_schedule');
start_form();
+
start_table(TABLESTYLE_NOBORDER);
start_row();
-?>GETPOSTactivate('item_schedule');
+
+if (list_updated('stock_id') || in_ajax()) $Ajax->activate('item_schedule') ;
+//else update_queue_quantities() && update_qoh_for_item();
+
//if (!@$_GET['popup'])
- start_form();
+// start_form();
+
$stock_id = $_POST['stock_id'];
stock_costable_items_list_cells(_("Item:"), 'stock_id', $stock_id);
+
end_row();
end_table(1);
+if(isset($stock_id)) echo '';
-$scheduler = new ItemScheduler($stock_id, 'DEF');
+if(isset($_POST['Update'])) {
+ $Ajax->activate('item_schedule');
+ // Restore the parameters
+ $params = new ScheduleParameters($_SESSION['schedule_parameters']);
+ $params->setMode('update');
+}
+else {
+ $params = in_ajax() && $stock_id == @$_POST['last_stock_id'] ? new ScheduleParameters($_POST) : null;
+ // save parameters form update
+ $_SESSION['schedule_parameters'] = $_POST;
+}
+$scheduler = new ItemScheduler($stock_id, OrderXtraConfig::$default_location, $params);
+$scheduler->action();
-div_start('item_schedule');
start_table(TABLESTYLE);
$th = $scheduler->tableHeader();
@@ -74,15 +89,17 @@ table_header($th);
$scheduler->generateTable();
end_table();
-div_end();
-submit_center_first('Update', _("Update"), '', 'default', false);
-submit_center_last('Cancel', _("Cancel"), '', 'cancel', false);
+if($scheduler->needsUpdate()) {
+ submit_center_first('Update', _("Update"), '', 'default', false);
+ submit_center_last('Cancel', _("Cancel"), '', 'cancel', false);
+}
end_form();
+div_end();
end_page();
?>