From d74a1098ea750fe0093822d6ee1d7dd621bdb8ec Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Wed, 9 Sep 2020 22:43:12 +0200 Subject: [PATCH] =?utf8?q?USTVA:=20Konjunkturpaket=20erwarte=20Pos.=2035?= =?utf8?q?=20und=20Pos.=2036=20f=C3=BCr=20Voranmeldung?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Ferner unlogische Automatiken in SKR03 bereinigt (Steuerkonten haben keine Automatikfunktion auf sich selber). --- ...konjunkturpaket_2020_SKR03-korrekturen.sql | 41 +++++++++++++++++++ ...konjunkturpaket_2020_SKR04-korrekturen.sql | 28 +++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 sql/Pg-upgrade2/konjunkturpaket_2020_SKR03-korrekturen.sql create mode 100644 sql/Pg-upgrade2/konjunkturpaket_2020_SKR04-korrekturen.sql diff --git a/sql/Pg-upgrade2/konjunkturpaket_2020_SKR03-korrekturen.sql b/sql/Pg-upgrade2/konjunkturpaket_2020_SKR03-korrekturen.sql new file mode 100644 index 000000000..4a9eaa979 --- /dev/null +++ b/sql/Pg-upgrade2/konjunkturpaket_2020_SKR03-korrekturen.sql @@ -0,0 +1,41 @@ +-- @tag: konjunkturpaket_2020_SKR03-korrekturen +-- @description: Steuerkonten haben selber keine Steuerautomatik. USTVA-Felder korrigieren +-- @depends: konjunkturpaket_2020_SKR03 +-- @ignore: 0 + +DO $$ +BEGIN + +IF ( select coa from defaults ) = 'Germany-DATEV-SKR03EU' THEN + + -- DEBUG + -- Konto 1771 ist in DATEV vom Typ S und hat keine Steuerautomatik S 1771 Umsatzsteuer 7 % + -- Weitere Liste Konten von diesem (s.u.) -> Steuerkonten haben selber keine Automatik + -- Der Eintrag wird leider für die pos_ustva benötigt (die könnte besser in tabelle tax sein) + -- S 1771 Umsatzsteuer 7 % + -- S 1772 Umsatzsteuer aus innergemeinschaftlichem Erwerb + -- S 1774 Umsatzsteuer aus innergemeinschaftlichem Erwerb 19 % + -- S 1775 Umsatzsteuer 16 % + -- S 1776 Umsatzsteuer 19 % + -- S 1777 Umsatzsteuer aus im Inland steuerpflichtigen EU-Lieferungen + -- S 1778 Umsatzsteuer aus im Inland steuerpflichtigen EU-Lieferungen 19 % + -- S 1779 Umsatzsteuer aus innergemeinschaftlichem Erwerb ohne Vorsteuerabzug + UPDATE taxkeys SET tax_id=0,taxkey_id=0 WHERE chart_id IN + (SELECT id FROM chart WHERE accno in ('1771','1772','1774','1775','1776','1777','1778','1779')); + -- Alle temporären Steuer auf Pos. 36 + UPDATE taxkeys SET pos_ustva=36 WHERE chart_id IN + (SELECT id FROM chart WHERE accno in ('1773')); + + -- Alle temporären 5% und 16% Erlöskonten auf Pos. 35 + -- select accno from chart where id in (select chart_id from taxkeys where tax_id in (select id from tax where taxkey=2 and rate=0.05) and pos_ustva=86) order by accno; + -- accno + -- 2401 8300 8506 8591 8710 8731 8750 8780 8915 8930 8945 + UPDATE taxkeys SET pos_ustva=35 WHERE tax_id in (SELECT id FROM tax WHERE taxkey=2 AND rate=0.05) AND pos_ustva=86; + -- select accno from chart where id in (select chart_id from taxkeys where tax_id in (select id from tax where taxkey=3 and rate=0.16) and pos_ustva=81) order by accno; + -- accno + -- 2405 2700 2750 8400 8500 8508 8540 8595 8600 8720 8735 8736 8760 8790 8800 8801 8820 8910 8920 8925 8935 8940 + UPDATE taxkeys SET pos_ustva=35 WHERE tax_id in (SELECT id FROM tax WHERE taxkey=3 AND rate=0.16) and pos_ustva=81; + +END IF; + +END $$; diff --git a/sql/Pg-upgrade2/konjunkturpaket_2020_SKR04-korrekturen.sql b/sql/Pg-upgrade2/konjunkturpaket_2020_SKR04-korrekturen.sql new file mode 100644 index 000000000..ca1058375 --- /dev/null +++ b/sql/Pg-upgrade2/konjunkturpaket_2020_SKR04-korrekturen.sql @@ -0,0 +1,28 @@ +-- @tag: konjunkturpaket_2020_SKR04-korrekturen +-- @description: USTVA-Felder korrigieren +-- @depends: konjunkturpaket_2020_SKR04 +-- @ignore: 0 + +DO $$ +BEGIN + +IF ( select coa from defaults ) = 'Germany-DATEV-SKR04EU' THEN + + -- Alle temporären Steuer auf Pos. 36 + UPDATE taxkeys SET pos_ustva=36 WHERE chart_id IN + (SELECT id FROM chart WHERE accno in ('3803','3805')); + + -- Alle temporären 5% und 16% Erlöskonten auf Pos. 35 + -- select accno from chart where id in (select chart_id from taxkeys where tax_id in (select id from tax where taxkey=2 and rate=0.05) and pos_ustva=86) order by accno; + -- accno + -- 4300 4566 4610 4630 4670 4710 4731 4750 4780 4941 6281 + UPDATE taxkeys SET pos_ustva=35 WHERE tax_id in (SELECT id FROM tax WHERE taxkey=2 AND rate=0.05) AND pos_ustva=86; + -- select accno from chart where id in (select chart_id from taxkeys where tax_id in (select id from tax where taxkey=3 and rate=0.16)) order by accno; + -- accno + -- 4400 4500 4510 4520 4569 4620 4640 4660 4680 4686 4720 4736 4760 4790 4830 4835 4849 4860 4945 6286 6287 + + UPDATE taxkeys SET pos_ustva=35 WHERE tax_id in (SELECT id FROM tax WHERE taxkey=3 AND rate=0.16); + +END IF; + +END $$; -- 2.20.1