X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sql%2Falter2.4.sql;h=727e91c3a39e83c979ff677fb058f5382d156edc;hb=fec081ddbcf4f2ceb4b325f30cfc1005e855b724;hp=c00bee34ffa328a40cc288837104c3a17d3780f2;hpb=15b522128f3033b684f005b54d4d5a836d49c382;p=fa-stable.git diff --git a/sql/alter2.4.sql b/sql/alter2.4.sql index c00bee34..727e91c3 100644 --- a/sql/alter2.4.sql +++ b/sql/alter2.4.sql @@ -115,7 +115,6 @@ ALTER TABLE `0_groups` ENGINE=InnoDB; ALTER TABLE `0_item_codes` ENGINE=InnoDB; ALTER TABLE `0_item_units` ENGINE=InnoDB; ALTER TABLE `0_locations` ENGINE=InnoDB; -ALTER TABLE `0_movement_types` ENGINE=InnoDB; ALTER TABLE `0_payment_terms` ENGINE=InnoDB; ALTER TABLE `0_prices` ENGINE=InnoDB; ALTER TABLE `0_printers` ENGINE=InnoDB; @@ -222,3 +221,21 @@ INSERT IGNORE INTO `0_sys_prefs` VALUES ('bcc_email', 'setup.company', 'varchar', 100, ''), ('alternative_tax_include_on_docs', 'setup.company', 'tinyint', 1, '0'), ('suppress_tax_rates', 'setup.company', 'tinyint', 1, '0'); + +# stock_moves.visible field is obsolete +# removing obsolete moves for writeoffs +DELETE moves + FROM `0_stock_moves` moves + INNER JOIN (SELECT * FROM `0_stock_moves` WHERE `type`=11 AND `qty`<0) writeoffs ON writeoffs.`trans_no`=moves.`trans_no` AND writeoffs.`type`=11 + WHERE moves.`type`=11; + +ALTER TABLE `0_stock_moves` DROP COLUMN `visible`; +# stock_moves.discount_percent field are obsolete + +UPDATE `0_stock_moves` SET + price = price*(1-discount_percent); +ALTER TABLE `0_stock_moves` DROP COLUMN `discount_percent`; + +ALTER TABLE `0_stock_moves` DROP COLUMN `person_id`; + +DROP TABLE IF EXISTS `0_movement_types`;