]> wagnertech.de Git - mfinanz.git/blob - sql/Pg-upgrade2/undo_delete_wrong_charts_for_taxkeys.sql
restart apache2 in postinst
[mfinanz.git] / sql / Pg-upgrade2 / undo_delete_wrong_charts_for_taxkeys.sql
1 -- @tag: undo_delete_wrong_charts_for_taxkeys
2 -- @description: chart_id kann doch mehrdeutig sein in der Tabelle für SKR04
3 -- @depends: release_3_7_0 delete_wrong_charts_for_taxkeys delete_wrong_charts_for_taxkeys_04
4 ALTER TABLE tax DROP CONSTRAINT IF EXISTS chart_id_unique_tax;
5 -- skr04
6
7 update tax set chart_id = (select chart_id from tax where chart_id is not null and taxkey=7 and rate=0.16) where chart_id is null
8 AND taxkey=9 and rate=0.16 AND EXISTS (SELECT * FROM defaults WHERE coa = 'Germany-DATEV-SKR04EU');
9
10 update tax set chart_id = (select chart_id from tax where chart_id is not null and taxkey=5 and rate=0.16) where chart_id is null and taxkey=3 and rate=0.16
11 AND EXISTS (SELECT * FROM defaults WHERE coa = 'Germany-DATEV-SKR04EU');
12