From: Joe Hunt Date: Wed, 12 Mar 2008 15:41:21 +0000 (+0000) Subject: Added update of Units of Measure and converting of deptor_trans records from release... X-Git-Tag: v2.4.2~19^2~2188 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=7e627484a9dbc0653469eb5ea22ba0cd2b036cc0;p=fa-stable.git Added update of Units of Measure and converting of deptor_trans records from release 1.XX Removed default insertion of Units of Measure. Not neccessary. --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 493c51d8..e1033c30 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,12 @@ Legend: ! -> Note $ -> Affected files +12-Mar-2008 Joe Hung + + Added update of Units of Measure and converting of deptor_trans records from release 1.XX + - Removed default insertion of Units of Measure. Not neccessary. + $ /sql/alter.sql + /admin/db/maintenance_db.inc (added support for update) + 11-Mar-2008 Janusz Dobrowolski + Table of measure moved into new table item_units ! Removed $themes[] from config.php, theme list based on directory structure diff --git a/admin/db/maintenance_db.inc b/admin/db/maintenance_db.inc index 7520e359..8ed6b7df 100644 --- a/admin/db/maintenance_db.inc +++ b/admin/db/maintenance_db.inc @@ -136,6 +136,12 @@ function db_import($filename, $connection) { $data_queries[] = substr($line, 0, strlen($line) - 1); + // this line does not, too + } + elseif (strtolower(substr($line,0,6)) == "update") + { + $data_queries[] = substr($line, 0, strlen($line) - 1); + // this line does not, too } elseif (strtolower(substr($line, 0, 20)) == "drop table if exists") diff --git a/sql/alter.sql b/sql/alter.sql index 0ce763f6..9d87fc57 100644 --- a/sql/alter.sql +++ b/sql/alter.sql @@ -16,6 +16,7 @@ -- ALTER TABLE -- +DROP TABLE IF EXISTS `0_item_units`; CREATE TABLE IF NOT EXISTS `0_item_units` ( `abbr` varchar(20) NOT NULL, `name` varchar(40) NOT NULL, @@ -23,15 +24,9 @@ CREATE TABLE IF NOT EXISTS `0_item_units` ( PRIMARY KEY (`abbr`), UNIQUE KEY `name` (`name`) ) TYPE = MyISAM; -INSERT INTO `0_item_units` VALUES ('each', 'Each', '0'); -INSERT INTO `0_item_units` VALUES ('m', 'Meter', '0'); -INSERT INTO `0_item_units` VALUES ('kg', 'Kilogram', '0'); -INSERT INTO `0_item_units` VALUES ('tons', 'Tons', '0'); -INSERT INTO `0_item_units` VALUES ('l', 'Liter', '0'); -INSERT INTO `0_item_units` VALUES ('lbs', 'Pounds', '0'); -INSERT INTO `0_item_units` VALUES ('dozen', 'Dozen', '0'); -INSERT INTO `0_item_units` VALUES ('pack', 'Pack', '0'); -INSERT INTO `0_item_units` VALUES ('hrs', 'Hours', '0'); + +INSERT INTO `0_item_units` (`abbr`, `name`, `decimals`) SELECT DISTINCT `units`, CONCAT(UPPER(SUBSTRING(`units`, 1, 1)), LOWER(SUBSTRING(`units`, 2))), 0 FROM `0_stock_master` ; +UPDATE `0_debtor_trans` SET `ov_amount`=-`ov_amount`, `ov_gst`=-`ov_gst`, `ov_freight`=-`ov_freight`, `ov_discount`=-`ov_discount` WHERE `ov_amount` < 0 AND `type` <> 10 AND `type` <> 13 ; DROP TABLE IF EXISTS `0_form_items`;