From: Janusz Dobrowolski Date: Mon, 8 Jul 2019 19:47:56 +0000 (+0200) Subject: Removed uniqueness on workorders.wo_ref key, removed obsolete additional_costs field... X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=d33885e362355a59606b95a3ef8c73f68e7631c2 Removed uniqueness on workorders.wo_ref key, removed obsolete additional_costs field in work_orders table. --- diff --git a/manufacturing/includes/db/work_orders_db.inc b/manufacturing/includes/db/work_orders_db.inc index 845253fe..2cd0ced3 100644 --- a/manufacturing/includes/db/work_orders_db.inc +++ b/manufacturing/includes/db/work_orders_db.inc @@ -289,8 +289,7 @@ function void_work_order($woid) void_wo_requirements($woid); // close workorder - // FIXME: due to bug in 2.4 db scheme (conflicting wo_ref unique key) we have to fix wo_ref here: - $sql = "UPDATE ".TB_PREF."workorders SET closed=1,units_reqd=0,units_issued=0, wo_ref=CONCAT(wo_ref, ' ', '".uniqid()."') WHERE id = " + $sql = "UPDATE ".TB_PREF."workorders SET closed=1,units_reqd=0,units_issued=0 WHERE id = " .db_escape($woid); db_query($sql, "The work order couldn't be voided"); diff --git a/manufacturing/work_order_entry.php b/manufacturing/work_order_entry.php index 4aea96fb..b4200871 100644 --- a/manufacturing/work_order_entry.php +++ b/manufacturing/work_order_entry.php @@ -344,7 +344,6 @@ if (isset($selected_id)) $_POST['RequDate'] = sql2date($myrow["required_by"]); $_POST['released_date'] = sql2date($myrow["released_date"]); $_POST['units_issued'] = $myrow["units_issued"]; - $_POST['Costs'] = price_format($myrow["additional_costs"]); $_POST['memo_'] = get_comments_string(ST_WORKORDER, $selected_id); diff --git a/sql/alter2.5.sql b/sql/alter2.5.sql index d5dcea0b..215b18ed 100644 --- a/sql/alter2.5.sql +++ b/sql/alter2.5.sql @@ -1,6 +1,11 @@ # reliable cost change log in stock_moves ALTER TABLE `0_stock_moves` CHANGE COLUMN `standard_cost` `unit_cost` double NOT NULL DEFAULT '0'; ALTER TABLE `0_debtor_trans_details` CHANGE COLUMN `standard_cost` `unit_cost` double NOT NULL DEFAULT '0'; -#naming cleanups + +# naming cleanups ALTER TABLE `0_purch_orders` CHANGE COLUMN `requisition_no` `supp_reference` tinytext; +# cleanups in work orders +ALTER TABLE `0_workorders` DROP INDEX `wo_ref`; +ALTER TABLE `0_workorders` ADD KEY `wo_ref` (`wo_ref`); +ALTER TABLE `0_workorders` DROP COLUMN `additional_costs`; \ No newline at end of file diff --git a/sql/en_US-demo.sql b/sql/en_US-demo.sql index ca9656ba..20d7d2e7 100644 --- a/sql/en_US-demo.sql +++ b/sql/en_US-demo.sql @@ -2269,14 +2269,13 @@ CREATE TABLE `0_workorders` ( `units_issued` double NOT NULL DEFAULT '0', `closed` tinyint(1) NOT NULL DEFAULT '0', `released` tinyint(1) NOT NULL DEFAULT '0', - `additional_costs` double NOT NULL DEFAULT '0', PRIMARY KEY (`id`), - UNIQUE KEY `wo_ref` (`wo_ref`) + KEY `wo_ref` (`wo_ref`) ) ENGINE=InnoDB AUTO_INCREMENT=4 ; -- Data of table `0_workorders` -- INSERT INTO `0_workorders` VALUES -('1', '001/2018', 'DEF', '2', '201', '2018-05-05', '0', '2018-05-05', '2018-05-05', '2', '1', '1', '0'), -('2', '002/2018', 'DEF', '5', '201', '2018-05-07', '2', '2018-05-27', '2018-05-07', '0', '0', '1', '0'), -('3', '003/2018', 'DEF', '5', '201', '2018-05-07', '2', '2018-05-27', '0000-00-00', '0', '0', '0', '0'); \ No newline at end of file +('1', '001/2018', 'DEF', '2', '201', '2018-05-05', '0', '2018-05-05', '2018-05-05', '2', '1', '1'), +('2', '002/2018', 'DEF', '5', '201', '2018-05-07', '2', '2018-05-27', '2018-05-07', '0', '0', '1'), +('3', '003/2018', 'DEF', '5', '201', '2018-05-07', '2', '2018-05-27', '0000-00-00', '0', '0', '0'); \ No newline at end of file diff --git a/sql/en_US-new.sql b/sql/en_US-new.sql index 6e8d8241..3dbb1de7 100644 --- a/sql/en_US-new.sql +++ b/sql/en_US-new.sql @@ -1917,9 +1917,8 @@ CREATE TABLE `0_workorders` ( `units_issued` double NOT NULL DEFAULT '0', `closed` tinyint(1) NOT NULL DEFAULT '0', `released` tinyint(1) NOT NULL DEFAULT '0', - `additional_costs` double NOT NULL DEFAULT '0', PRIMARY KEY (`id`), - UNIQUE KEY `wo_ref` (`wo_ref`) + KEY `wo_ref` (`wo_ref`) ) ENGINE=InnoDB; -- Data of table `0_workorders` --