Files
apart-moment/web/scripts_SQL/1-Correction tax_rule.sql

16 lines
993 B
SQL

-- Application de la TVA à 20% à tous les pays
INSERT INTO `tax_rule_country` (`tax_rule_id`, `country_id`, `state_id`, `tax_id`, `position`, `created_at`, `updated_at`)
(SELECT 1, c.id, null, 1, 1, NOW(), NOW() FROM country c WHERE c.visible AND c.id != 64);
-- Correction des deux commandes qui posaient problème
INSERT INTO `order_product_tax` (`id`, `order_product_id`,`title`,`description`,`amount`,`promo_amount`,`created_at`,`updated_at`)
(SELECT max(opt.id)+1, op.id, 'TVA française à 20%', NULL, 496.708333, 496.708333, '2021-01-25 10:45:23.0', NOW()
FROM `order_product` op, `order_product_tax` opt
WHERE op.order_id=173);
INSERT INTO `order_product_tax` (`id`, `order_product_id`,`title`,`description`,`amount`,`promo_amount`,`created_at`,`updated_at`)
(SELECT max(opt.id)+1, op.id, 'TVA française à 20%', NULL, 465.000000, 465.000000, '2020-09-03 13:38:49.0', NOW()
FROM `order_product` op, `order_product_tax` opt
WHERE op.order_id=127);