X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=item_schedule.php;h=608bf90ecbe0ef40537656f535b982b8da469b48;hb=ee3469d3ffd74d2a6be87d3dd0a9541a14bcdfde;hp=329d6fcc6a276d933289758fbd202c54f4afc822;hpb=f32dac729c87051f52b61df2ccca7eff0300d7c0;p=order_line_extra.git
diff --git a/item_schedule.php b/item_schedule.php
index 329d6fc..608bf90 100644
--- a/item_schedule.php
+++ b/item_schedule.php
@@ -1,4 +1,3 @@
-
activate('item_schedule') ;
+//else update_queue_quantities() && update_qoh_for_item();
+
//if (!@$_GET['popup'])
- start_form();
+// start_form();
+
-if (!isset($_POST['stock_id']))
- $_POST['stock_id'] = get_global_stock_item();
$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);
+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();
@@ -65,14 +89,90 @@ table_header($th);
$scheduler->generateTable();
end_table();
-div_end();
-submit_center_first('Update', _("Update"), true, '', 'default', true);
-submit_center_last('Cancel', _("Cancel"), true, '', 'cancel', true);
+if($scheduler->needsUpdate()) {
+ submit_center_first('Update', _("Update"), '', 'default', false);
+ submit_center_last('Cancel', _("Cancel"), '', 'cancel', false);
+}
end_form();
+div_end();
end_page();
?>
+
+
+
+