Removed obsolete stock_master.last_cost field.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Wed, 30 Dec 2015 14:46:52 +0000 (15:46 +0100)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sat, 9 Jan 2016 10:57:28 +0000 (11:57 +0100)
fixed_assets/includes/fixed_assets_db.inc
inventory/includes/db/items_trans_db.inc
sql/alter2.4rc1.sql
sql/en_US-demo.sql
sql/en_US-new.sql

index 14dc3860fce3a488f4dbeda4d8fd0a529842ee86..911cdddff438ca11f56250ef35b832cc4253df9e 100644 (file)
@@ -53,8 +53,7 @@ function process_fixed_asset_depreciation($stock_id, $gl_rows, $refline, $memo_)
 
   $sql = "UPDATE ".TB_PREF."stock_master SET 
     depreciation_date='".date2sql($cart->tran_date)."',
-    material_cost=".db_escape($new_cost).",
-    last_cost=".db_escape($old_cost)."
+    material_cost=".db_escape($new_cost)."
     WHERE stock_id=".db_escape($stock_id);
   db_query($sql,"The depreciation start date could not be updated");
 
index c97be95c1861c115c18c512c4d34acfc89cc7c65..84ba75ae43db78de6c211572de1f318d3f8cf729 100644 (file)
@@ -33,7 +33,6 @@ function stock_cost_update($stock_id, $material_cost, $labour_cost, $overhead_co
        $sql = "UPDATE ".TB_PREF."stock_master SET material_cost=".db_escape($material_cost).", 
                labour_cost=".db_escape($labour_cost).", 
                overhead_cost=".db_escape($overhead_cost).", 
-               last_cost=".db_escape($last_cost)."
                WHERE stock_id=".db_escape($stock_id);
        db_query($sql,"The cost details for the inventory item could not be updated");
 
index 47ba2a17f9564403a0007d318c5a9075725a7576..b220d62ad76a268d602ef473549775c06effe06b 100644 (file)
@@ -28,3 +28,5 @@ INSERT IGNORE INTO `0_sys_prefs` VALUES
 
 ALTER TABLE `0_wo_issue_items` ADD COLUMN  `unit_cost` double NOT NULL default '0' AFTER `qty_issued`;
 ALTER TABLE `0_wo_requirements` CHANGE COLUMN `std_cost` `unit_cost` double NOT NULL default '0';
+
+ALTER TABLE `0_stock_master` DROP COLUMN `last_cost`;
index 560d354c7c4952ae74eccceff65d34096aac3dbb..9e364d4e31d7691fec361f3f1cadd01367a01d56 100644 (file)
@@ -1876,7 +1876,6 @@ CREATE TABLE IF NOT EXISTS `0_stock_master` (
   `dimension_id` int(11) DEFAULT NULL,
   `dimension2_id` int(11) DEFAULT NULL,
   `purchase_cost` double NOT NULL DEFAULT '0',
-  `last_cost` double NOT NULL DEFAULT '0',
   `material_cost` double NOT NULL DEFAULT '0',
   `labour_cost` double NOT NULL DEFAULT '0',
   `overhead_cost` double NOT NULL DEFAULT '0',
@@ -1898,12 +1897,12 @@ CREATE TABLE IF NOT EXISTS `0_stock_master` (
 --
 
 INSERT INTO `0_stock_master` VALUES
-('101', '1', '1', 'iPad Air 2 16GB', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '200', '0', '0', '0', '0', '0', '0', 'S', '0', '1', '0000-00-00', '0000-00-00', ''),
-('102', '1', '1', 'iPhone 6 64GB', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '150', '0', '0', '0', '0', '0', '0', 'S', '0', '1', '0000-00-00', '0000-00-00', ''),
-('103', '1', '1', 'iPhone Cover Case', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '10', '0', '0', '0', '0', '0', '0', 'S', '0', '1', '0000-00-00', '0000-00-00', ''),
-('201', '3', '1', 'AP Surf Set', '', 'each', 'M', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '360', '0', '0', '0', '0', '0', '0', 'S', '0', '1', '0000-00-00', '0000-00-00', ''),
-('202', '4', '1', 'Maintenance', '', 'hr', 'D', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', 'S', '0', '1', '0000-00-00', '0000-00-00', ''),
-('301', '4', '1', 'Support', '', 'hr', 'D', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'S', '0', '1', '0000-00-00', '0000-00-00', '');
+('101', '1', '1', 'iPad Air 2 16GB', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '200', '0', '0', '0', '0', '0', '0', 'S', '0', '1', '0000-00-00', '0000-00-00', ''),
+('102', '1', '1', 'iPhone 6 64GB', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '150', '0', '0', '0', '0', '0', '0', 'S', '0', '1', '0000-00-00', '0000-00-00', ''),
+('103', '1', '1', 'iPhone Cover Case', '', 'each', 'B', '4010', '5010', '1510', '5040', '1530', '0', '0',  '0', '10', '0', '0', '0', '0', '0', '0', 'S', '0', '1', '0000-00-00', '0000-00-00', ''),
+('201', '3', '1', 'AP Surf Set', '', 'each', 'M', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '360', '0', '0', '0', '0', '0', '0', 'S', '0', '1', '0000-00-00', '0000-00-00', ''),
+('202', '4', '1', 'Maintenance', '', 'hr', 'D', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', 'S', '0', '1', '0000-00-00', '0000-00-00', ''),
+('301', '4', '1', 'Support', '', 'hr', 'D', '4010', '5010', '1510', '5040', '1530', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'S', '0', '1', '0000-00-00', '0000-00-00', '');
 
 -- --------------------------------------------------------
 
index a7d345eae23941621397100d49e969a9a40ab7ee..41e7a4db6846e91f111138bf8959ddf22d891248 100644 (file)
@@ -1634,7 +1634,6 @@ CREATE TABLE IF NOT EXISTS `0_stock_master` (
   `dimension_id` int(11) default NULL,
   `dimension2_id` int(11) default NULL,
   `purchase_cost` double NOT NULL default '0',
-  `last_cost` double NOT NULL default '0',
   `material_cost` double NOT NULL default '0',
   `labour_cost` double NOT NULL default '0',
   `overhead_cost` double NOT NULL default '0',