diff --git a/application/controllers/Items.php b/application/controllers/Items.php index 96eb417ac..4975bcd06 100644 --- a/application/controllers/Items.php +++ b/application/controllers/Items.php @@ -444,7 +444,7 @@ class Items extends Secure_area implements iData_controller $stock_locations = $this->Stock_location->get_undeleted_all()->result_array(); foreach($stock_locations as $location_data) { - $updated_quantity = $this->input->post($location_data['location_id'].'_quantity'); + $updated_quantity = $this->input->post('quantity_' . $location_data['location_id']); $location_detail = array('item_id'=>$item_id, 'location_id'=>$location_data['location_id'], 'quantity'=>$updated_quantity); diff --git a/application/views/items/form.php b/application/views/items/form.php index b73884315..ffa3ed66e 100644 --- a/application/views/items/form.php +++ b/application/views/items/form.php @@ -47,9 +47,9 @@
- lang->line('items_supplier'), 'supplier', array('class'=>'required control-label col-xs-3')); ?> + lang->line('items_supplier'), 'supplier', array('class'=>'control-label col-xs-3')); ?>
- 'required form-control'));?> + 'form-control')); ?>
@@ -135,14 +135,14 @@ ?>
lang->line('items_quantity').' '.$location_detail['location_name'] , - $key.'_quantity', + 'quantity_' . $key, array('class'=>'required control-label col-xs-3')); ?>
$key.'_quantity', - 'id'=>$key.'_quantity', + 'name'=>'quantity_' . $key, + 'id'=>'quantity_' . $key, 'class'=>'required quantity form-control', - 'value'=>isset($item_info->item_id)?$location_detail['quantity']:0) + 'value'=>isset($item_info->item_id) ? $location_detail['quantity'] : 0) );?>
@@ -226,7 +226,7 @@ 'name'=>'allow_alt_description', 'id'=>'allow_alt_description', 'value'=>1, - 'checked'=>($item_info->allow_alt_description)? 1 : 0) + 'checked'=>($item_info->allow_alt_description) ? 1 : 0) );?> @@ -238,7 +238,7 @@ 'name'=>'is_serialized', 'id'=>'is_serialized', 'value'=>1, - 'checked'=>($item_info->is_serialized)? 1 : 0) + 'checked'=>($item_info->is_serialized) ? 1 : 0) );?> @@ -250,7 +250,7 @@ 'name'=>'is_deleted', 'id'=>'is_deleted', 'value'=>1, - 'checked'=>($item_info->deleted)? 1 : 0) + 'checked'=>($item_info->deleted) ? 1 : 0) );?> @@ -348,7 +348,7 @@ category:"required", item_number: { - item_number: true + item_number:true }, cost_price: { @@ -360,12 +360,29 @@ required:true, number:true }, - tax_percent: + $location_detail) + { + ?> + : + { + required:true, + number:true + }, + + receiving_quantity: { required:true, number:true }, reorder_level: + { + required:true, + number:true + }, + tax_percent: { required:true, number:true @@ -385,15 +402,32 @@ required:"lang->line('items_unit_price_required'); ?>", number:"lang->line('items_unit_price_number'); ?>" }, - tax_percent: + $location_detail) { - required:"lang->line('items_tax_percent_required'); ?>", - number:"lang->line('items_tax_percent_number'); ?>" + ?> + : + { + required:"lang->line('items_quantity_required'); ?>", + number:"lang->line('items_quantity_number'); ?>" + }, + + receiving_quantity: + { + required:"lang->line('items_quantity_required'); ?>", + number:"lang->line('items_quantity_number'); ?>" }, reorder_level: { required:"lang->line('items_reorder_level_required'); ?>", number:"lang->line('items_reorder_level_number'); ?>" + }, + tax_percent: + { + required:"lang->line('items_tax_percent_required'); ?>", + number:"lang->line('items_tax_percent_number'); ?>" } } }, dialog_support.error));