From a3704f9b124de46d29b6a13a0b2c9d206f49a266 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Fri, 8 Jul 2016 17:03:27 +0100 Subject: [PATCH] Make inventory to support decimal quantity on transactions logging (#726) --- database/2.4_to_3.0.sql | 5 ++++- database/database.sql | 4 ++-- database/migrate_phppos_dist.sql | 4 ++-- database/tables.sql | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/database/2.4_to_3.0.sql b/database/2.4_to_3.0.sql index 09761d89a..d974dd936 100644 --- a/database/2.4_to_3.0.sql +++ b/database/2.4_to_3.0.sql @@ -10,6 +10,9 @@ ALTER TABLE `ospos_item_kit_items` ALTER TABLE `ospos_item_quantities` MODIFY COLUMN `quantity` decimal(15,3) NOT NULL DEFAULT '0'; +ALTER TABLE `ospos_inventory` + MODIFY COLUMN `trans_inventory` decimal(15,3) NOT NULL DEFAULT '0'; + ALTER TABLE `ospos_receivings` DROP KEY `invoice_number`, CHANGE COLUMN `invoice_number` `reference` varchar(32) DEFAULT NULL, @@ -35,7 +38,7 @@ ALTER TABLE `ospos_items_taxes` MODIFY COLUMN `percent` decimal(15,3) NOT NULL; ALTER TABLE `ospos_customers` - ADD COLUMN `discount_percent` decimal(15,2) NOT NULL DEFAULT '0.00'; + ADD COLUMN `discount_percent` decimal(15,2) NOT NULL DEFAULT '0'; -- alter config table diff --git a/database/database.sql b/database/database.sql index 531e475c8..5495fdb26 100644 --- a/database/database.sql +++ b/database/database.sql @@ -91,7 +91,7 @@ CREATE TABLE `ospos_customers` ( `company_name` varchar(255) DEFAULT NULL, `account_number` varchar(255) DEFAULT NULL, `taxable` int(1) NOT NULL DEFAULT '1', - `discount_percent` decimal(15,2) NOT NULL DEFAULT '0.00', + `discount_percent` decimal(15,2) NOT NULL DEFAULT '0', `deleted` int(1) NOT NULL DEFAULT '0', UNIQUE KEY `account_number` (`account_number`), KEY `person_id` (`person_id`) @@ -160,7 +160,7 @@ CREATE TABLE `ospos_inventory` ( `trans_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `trans_comment` text NOT NULL, `trans_location` int(11) NOT NULL, - `trans_inventory` int(11) NOT NULL DEFAULT '0', + `trans_inventory` decimal(15,3) NOT NULL DEFAULT '0', PRIMARY KEY (`trans_id`), KEY `trans_items` (`trans_items`), KEY `trans_user` (`trans_user`), diff --git a/database/migrate_phppos_dist.sql b/database/migrate_phppos_dist.sql index 149b5d0f8..31f6cbe50 100644 --- a/database/migrate_phppos_dist.sql +++ b/database/migrate_phppos_dist.sql @@ -91,7 +91,7 @@ CREATE TABLE `ospos_customers` ( `company_name` varchar(255) DEFAULT NULL, `account_number` varchar(255) DEFAULT NULL, `taxable` int(1) NOT NULL DEFAULT '1', - `discount_percent` decimal(15,2) NOT NULL DEFAULT '0.00', + `discount_percent` decimal(15,2) NOT NULL DEFAULT '0', `deleted` int(1) NOT NULL DEFAULT '0', UNIQUE KEY `account_number` (`account_number`), KEY `person_id` (`person_id`) @@ -160,7 +160,7 @@ CREATE TABLE `ospos_inventory` ( `trans_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `trans_comment` text NOT NULL, `trans_location` int(11) NOT NULL, - `trans_inventory` int(11) NOT NULL DEFAULT '0', + `trans_inventory` decimal(15,3) NOT NULL DEFAULT '0', PRIMARY KEY (`trans_id`), KEY `trans_items` (`trans_items`), KEY `trans_user` (`trans_user`), diff --git a/database/tables.sql b/database/tables.sql index 0c1f88218..76d2158f0 100644 --- a/database/tables.sql +++ b/database/tables.sql @@ -91,7 +91,7 @@ CREATE TABLE `ospos_customers` ( `company_name` varchar(255) DEFAULT NULL, `account_number` varchar(255) DEFAULT NULL, `taxable` int(1) NOT NULL DEFAULT '1', - `discount_percent` decimal(15,2) NOT NULL DEFAULT '0.00', + `discount_percent` decimal(15,2) NOT NULL DEFAULT '0', `deleted` int(1) NOT NULL DEFAULT '0', UNIQUE KEY `account_number` (`account_number`), KEY `person_id` (`person_id`) @@ -160,7 +160,7 @@ CREATE TABLE `ospos_inventory` ( `trans_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `trans_comment` text NOT NULL, `trans_location` int(11) NOT NULL, - `trans_inventory` int(11) NOT NULL DEFAULT '0', + `trans_inventory` decimal(15,3) NOT NULL DEFAULT '0', PRIMARY KEY (`trans_id`), KEY `trans_items` (`trans_items`), KEY `trans_user` (`trans_user`),