Filter params on new stock
[order_line_extra.git] / item_schedule.php
index 7276bdc5f970d7c2985c90121994348a63e4cc50..69a539898471dd1e00e5456e8a095a6ccc1472e9 100644 (file)
@@ -53,22 +53,23 @@ else {
        }
 }
 
-if (list_updated('stock_id')) 
-       $Ajax->activate('item_schedule');
-if (in_ajax())
-       $Ajax->activate('item_schedule');
+if (list_updated('stock_id') || in_ajax()) $Ajax->activate('item_schedule');
 
 //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 '<input type="hidden" name="last_stock_id" value="'.$stock_id.'">';
 
-$scheduler = new ItemScheduler($stock_id, 'DEF');
+$params = in_ajax() && $stock_id == @$_POST['last_stock_id'] ? new ScheduleParameters($_POST) : null;
+$scheduler = new ItemScheduler($stock_id, 'DEF', $params);
 
 start_table(TABLESTYLE);
 $th = $scheduler->tableHeader();