X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44..53593baa211863fbf66540cf1bcc36c8fb37257f:/sql/Pg-upgrade2/remove_taxkey_15_17_skr04.sql

diff --git a/sql/Pg-upgrade2/remove_taxkey_15_17_skr04.sql b/sql/Pg-upgrade2/remove_taxkey_15_17_skr04.sql
new file mode 100644
index 000000000..e431c51e8
--- /dev/null
+++ b/sql/Pg-upgrade2/remove_taxkey_15_17_skr04.sql
@@ -0,0 +1,19 @@
+-- @tag: remove_taxkey_15_17_skr04
+-- @description: Steuer mit SchlÃ¼ssel 15 und 17 (16%) fÃ¼r SKR04 entfernen, wenn nicht verknÃ¼pft
+-- @depends: release_3_5_5
+
+DELETE FROM tax
+  WHERE (SELECT coa FROM defaults) LIKE 'Germany-DATEV-SKR04EU'
+    AND taxkey = 17
+    AND chart_id = (SELECT chart_id FROM chart WHERE accno LIKE '1403')
+    AND rate = .16
+    AND NOT EXISTS (SELECT id FROM taxkeys WHERE tax_id = tax.id)
+    AND NOT EXISTS (SELECT id FROM acc_trans WHERE tax_id = tax.id);
+
+DELETE FROM tax
+  WHERE (SELECT coa FROM defaults) LIKE 'Germany-DATEV-SKR04EU'
+    AND taxkey = 15
+    AND chart_id = (SELECT chart_id FROM chart WHERE accno LIKE '3803')
+    AND rate = .16
+    AND NOT EXISTS (SELECT id FROM taxkeys WHERE tax_id = tax.id)
+    AND NOT EXISTS (SELECT id FROM acc_trans WHERE tax_id = tax.id);
