include_once("includes/order_lines.inc");
include_once("includes/splitter.inc");
+include_once("includes/bulk_updater.inc");
$page_security = 'SA_ORDERLINEX_EDIT';
add_access_extensions();
filter_data($_POST);
update_extra_order_details();
split_order_details();
+bulk_update_order_details();
$js = "";
display_db_pager($table);
function display_split_area() {
-start_table(TABLESTYLE_NOBORDER);
qty_cells('Before', 'start_offset', -5);
-date_cells('Start', 'start_date');
-date_cells('End', 'end_date');
+date_cells('Start', 'start_date', null, null, 0, 0, 1001);
+date_cells('End', 'end_date', null, null, 0, 0, 1001);
qty_cells('After', 'end_offset', 2);
qty_cells('Max', 'max_quantity', 6);
submit_cells('Split', 'Split');
-end_table();
}
+
+function display_bulk_area() {
+date_cells('Priority', 'bulk[priority_date]', null, null, 0, 0, 1001);
+qty_cells(null, 'bulk[priority_time]', '12:00:00');
+date_cells('Hold', 'bulk[hold_until_date]', null, null, 0, 0, 1001);
+date_cells('Required', 'bulk[required_date]', null, null, 0, 0, 1001);
+date_cells('Expiry', 'bulk[expiry_date]', null, null, 0, 0, 1001);
+text_cells('Comment', 'bulk[comment]');
+submit_cells('Bulk', 'Bulk');
+}
+
+
+if($customer_id !== null) {
+start_table(TABLESTYLE);
+start_table(TABLESTYLE_NOBORDER);
display_split_area();
+end_table();
+start_table(TABLESTYLE_NOBORDER);
+display_bulk_area();
+end_table();
+end_table();
+}
br(1);
'#checkAll': function (e) {
e.onchange = function() {
$('.check_detail').prop('checked', e.checked)
+ $('.check_detail').trigger('change');
}
}
+ ,'tr': function(e) {
+ // find if there is a check detail box on link all input to it
+ var tr = $(e);
+ var check = tr.find('.check_detail');
+ if(check.length != 1) return;
+ check = check[0];
+ var jcheck = $(check);
+ var inputs = tr.find('input');
+ inputs.each(function(index, input) {
+ if(input === check) return;
+ $(input).prop('disabled', true)
+ })
+
+ check.onchange = function() {
+ inputs.each(function(index, input) {
+ var on = jcheck.prop('checked')
+ if(input == check) return;
+ $(input).prop('disabled', !on);
+ })
+ };
+ }
}
Behaviour.register(inserts);
</script>