From d43015e8c98513da1a6d0998e2c34d7bec89a575 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Mon, 3 Nov 2014 17:49:18 +0100 Subject: [PATCH] Set default receivings value for items to 1 in database Fix item quantity save --- application/controllers/items.php | 1 + database/2.3_to_2.3.1.sql | 3 +-- database/database.sql | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/controllers/items.php b/application/controllers/items.php index c9ef537b5..b3a82b09f 100644 --- a/application/controllers/items.php +++ b/application/controllers/items.php @@ -305,6 +305,7 @@ class Items extends Secure_area implements iData_controller 'cost_price'=>$this->input->post('cost_price'), 'unit_price'=>$this->input->post('unit_price'), 'reorder_level'=>$this->input->post('reorder_level'), + 'receiving_quantity'=>$this->input->post('receiving_quantity'), 'allow_alt_description'=>$this->input->post('allow_alt_description'), 'is_serialized'=>$this->input->post('is_serialized'), 'deleted'=>$this->input->post('is_deleted'), /** Parq 131215 **/ diff --git a/database/2.3_to_2.3.1.sql b/database/2.3_to_2.3.1.sql index 3af1d03cd..bf5fdea88 100644 --- a/database/2.3_to_2.3.1.sql +++ b/database/2.3_to_2.3.1.sql @@ -101,5 +101,4 @@ ALTER TABLE `ospos_sales_suspended` -- add invoice_number column to receivings table ALTER TABLE `ospos_items` - ADD COLUMN `receivings_quantity` int(11) DEFAULT '0', - ADD UNIQUE `invoice_number` (`invoice_number`); + ADD COLUMN `receiving_quantity` int(11) DEFAULT '1'; \ No newline at end of file diff --git a/database/database.sql b/database/database.sql index 45fbdafcd..2fb51b88b 100644 --- a/database/database.sql +++ b/database/database.sql @@ -144,7 +144,7 @@ CREATE TABLE `ospos_items` ( `unit_price` decimal(15,2) NOT NULL, `quantity` decimal(15,2) NOT NULL DEFAULT '0', `reorder_level` decimal(15,2) NOT NULL DEFAULT '0', - `receivings_quantity` int(11) NOT NULL DEFAULT '0', + `receivings_quantity` int(11) NOT NULL DEFAULT '1', `item_id` int(10) NOT NULL AUTO_INCREMENT, `allow_alt_description` tinyint(1) NOT NULL, `is_serialized` tinyint(1) NOT NULL,