X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=item_schedule.php;h=1937108e1a2b834d893d3ade96c8a01ca312e940;hb=e83dd263203cb4f16aec72e084825198b5e12259;hp=4de176c997cd0776f596f6d1d1a743d9fac0e809;hpb=94b18430b11353c6cf14e28fd3062d49007506bc;p=order_line_extra.git diff --git a/item_schedule.php b/item_schedule.php index 4de176c..1937108 100644 --- a/item_schedule.php +++ b/item_schedule.php @@ -19,6 +19,7 @@ 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"); $page_security = 'SA_ORDERLINEX_EDIT'; add_access_extensions(); @@ -34,15 +35,10 @@ page($_SESSION['page_title'], false, false, "", $js); div_start('item_schedule'); start_form(); + start_table(TABLESTYLE_NOBORDER); start_row(); -echo date('h:i:s
',time()); -?>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']; @@ -65,9 +64,21 @@ $stock_id = $_POST['stock_id']; end_row(); end_table(1); +if(isset($stock_id)) echo ''; -$params = in_ajax() ? new ScheduleParameters($_POST) : null; +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, 'DEF', $params); +$scheduler->action(); start_table(TABLESTYLE); $th = $scheduler->tableHeader(); @@ -79,8 +90,10 @@ $scheduler->generateTable(); end_table(); -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); +}