From: Moritz Bunkus Date: Fri, 8 Dec 2006 15:08:42 +0000 (+0000) Subject: Fix zum SKR03 und SKR04: Konto 3559 bzw. 5559 "Steuerfreie Einfuhren" ist ein Aufwand... X-Git-Tag: release-2.4.0^2~100 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=5311b7f8a8b6241c3861af31d3186672bda07718;p=kivitendo-erp.git Fix zum SKR03 und SKR04: Konto 3559 bzw. 5559 "Steuerfreie Einfuhren" ist ein Aufwandskonto. Ausserdem die Auswahl der Konten für die beiden neu angelegten Standardbuchungsgruppen angepasst. --- diff --git a/sql/Germany-DATEV-SKR03EU-chart.sql b/sql/Germany-DATEV-SKR03EU-chart.sql index 1395d0bfc..7367c2790 100644 --- a/sql/Germany-DATEV-SKR03EU-chart.sql +++ b/sql/Germany-DATEV-SKR03EU-chart.sql @@ -216,7 +216,7 @@ INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, ta INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik) VALUES ('2746', 'Steuerfr.Erträge a.d.Auflös.v.SoPo m.Rücklageanteil', 'A', 'I', '', '2746', 0, NULL, NULL, NULL, 2, FALSE); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik) VALUES ('2747', 'Sonst.steuerfreie Betriebseinnahmen', 'A', 'I', '', '2747', 0, NULL, NULL, NULL, 2, FALSE); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik) VALUES ('2797', 'Entnahmen a.satzungsmäßigen Rücklagen', 'A', 'E', '', '2797', 0, NULL, NULL, NULL, NULL, FALSE); -INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik) VALUES ('3559', 'Steuerfreie Einfuhren', 'A', 'E', '', '3559', 0, NULL, NULL, NULL, 8, FALSE); +INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik) VALUES ('3559', 'Steuerfreie Einfuhren', 'A', 'E', 'AP_amount:IC_cogs', '3559', 0, 91, NULL, NULL, 8, FALSE); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik) VALUES ('3580', 'Wareneinkauf z.allg.Umsatzsteuersatz (EÜR)', 'A', 'E', '', '3580', 0, 0, 4, NULL, 8, FALSE); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik) VALUES ('3581', 'Wareneinkauf z.erm.Umsatzsteuersatz(EÜR)', 'A', 'E', '', '3581', 0, 0, 4, NULL, 8, FALSE); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik) VALUES ('3582', 'Wareneinkauf ohne Vorsteuerabzug(EÜR)', 'A', 'E', '', '3582', 0, 0, 4, NULL, 8, FALSE); diff --git a/sql/Germany-DATEV-SKR04EU-chart.sql b/sql/Germany-DATEV-SKR04EU-chart.sql index b267268a8..3c31d488b 100644 --- a/sql/Germany-DATEV-SKR04EU-chart.sql +++ b/sql/Germany-DATEV-SKR04EU-chart.sql @@ -156,7 +156,7 @@ INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, ta INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik) VALUES ('5425', 'Innergem.Erwerb 16% VorSt u. Ust', 'A', 'E', 'AP_amount:IC_cogs', '5425', 0, 97, 4, NULL, 8, TRUE); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik) VALUES ('5440', 'Innergem.Erwerb v.Neufahrz.v.Lief.o.USt.Identnr.16%VSt.u.16%USt.', 'A', 'E', 'AP_amount:IC_cogs', '5440', 19, 94, NULL, NULL, 8, TRUE); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik) VALUES ('5550', 'Steuerfreier innergem.Erwerb', 'A', 'E', 'AP_amount:IC_cogs', '5550', 0, 91, NULL, NULL, 8, FALSE); -INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik) VALUES ('5559', 'Steuerfreie Einfuhren', 'A', 'E', '', '5559', 0, NULL, NULL, NULL, 8, FALSE); +INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik) VALUES ('5559', 'Steuerfreie Einfuhren', 'A', 'E', 'AP_amount:IC_cogs', '5559', 0, 91, NULL, NULL, 8, FALSE); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik) VALUES ('5580', 'Wareneinkauf z.allg.Umsatzsteuersatz (EÜR)', 'A', 'E', '', '5580', 0, 0, 4, NULL, 8, FALSE); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik) VALUES ('5581', 'Wareneinkauf z.erm.Umsatzsteuersatz(EÜR)', 'A', 'E', '', '5581', 0, 0, 4, NULL, 8, FALSE); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik) VALUES ('5582', 'Wareneinkauf ohne Vorsteuerabzug(EÜR)', 'A', 'E', '', '5582', 0, 0, 4, NULL, 8, FALSE); diff --git a/sql/Pg-upgrade/Pg-upgrade-2.2.0.28-2.2.0.29.pl b/sql/Pg-upgrade/Pg-upgrade-2.2.0.28-2.2.0.29.pl index 209a6168a..d2b6e6542 100644 --- a/sql/Pg-upgrade/Pg-upgrade-2.2.0.28-2.2.0.29.pl +++ b/sql/Pg-upgrade/Pg-upgrade-2.2.0.28-2.2.0.29.pl @@ -16,6 +16,32 @@ sub myshowerror { return 2; } +sub fix_skr03 { + my $query; + + $query = + "UPDATE chart " . + "SET link = 'AP_amount:IC_cogs', pos_ustva = 91 " . + "WHERE accno = '3559'"; + $dbh->do($query) || mydberror($query); + + $dbh->commit(); + $dbh->begin_work(); +} + +sub fix_skr04 { + my $query; + + $query = + "UPDATE chart " . + "SET link = 'AP_amount:IC_cogs', pos_ustva = 91 " . + "WHERE accno = '5559'"; + $dbh->do($query) || mydberror($query); + + $dbh->commit(); + $dbh->begin_work(); +} + sub create_standard_buchungsgruppen_skr03 { my $query; @@ -33,28 +59,24 @@ sub create_standard_buchungsgruppen_skr03 { " income_accno_id_3, expense_accno_id_3) " . "VALUES " . "('Standard 16%', " . - ($main::eur ? - "(SELECT id FROM chart WHERE link = 'IC' " . - " ORDER BY id ASC LIMIT 1), " - : - # 3980: Bestand Waren - " (SELECT id FROM chart WHERE accno = '3980'), ") . - # 8400: Erlöse 16% USt. - # 3400: Wareneingang 16% Vorsteuer - " (SELECT id FROM chart WHERE accno = '8400'), " . - " (SELECT id FROM chart WHERE accno = '3400'), " . - # 8125: Steuerfrei innergem. Lieferungen §41bUStG - # 3550: Steuerfreier innergem.Erwerb - " (SELECT id FROM chart WHERE accno = '8125'), " . - " (SELECT id FROM chart WHERE accno = '3550'), " . - # 8400: Erlöse 16% USt. - # 3400: Wareneingang 16% Vorsteuer - " (SELECT id FROM chart WHERE accno = '8400'), " . - " (SELECT id FROM chart WHERE accno = '3400'), " . - # 8120: Steuerfreie Umsätze §4Nr.1a UstG - # 3550: Steuerfreier innergem.Erwerb - " (SELECT id FROM chart WHERE accno = '8120'), " . - " (SELECT id FROM chart WHERE accno = '3550'))"; + # 3980: Bestand Waren + " (SELECT id FROM chart WHERE accno = '3980'), " . + # 8400: Erlöse 16% USt. + # 3400: Wareneingang 16% Vorsteuer + " (SELECT id FROM chart WHERE accno = '8400'), " . + " (SELECT id FROM chart WHERE accno = '3400'), " . + # 8320: Erlöse aus im and.EG-Land steuerpfl.Lieferungen + # 3550: Steuerfreier innergem.Erwerb + " (SELECT id FROM chart WHERE accno = '8320'), " . + " (SELECT id FROM chart WHERE accno = '3550'), " . + # 8315: Erlös Inland stpfl.EG-Lieferung 16% + # 3425: Innergem.Erwerb 16% VorSt u. Ust + " (SELECT id FROM chart WHERE accno = '8315'), " . + " (SELECT id FROM chart WHERE accno = '3425'), " . + # 8120: Steuerfreie Umsätze §4Nr.1a UstG + # 3559: Steuerfreie Einfuhren + " (SELECT id FROM chart WHERE accno = '8120'), " . + " (SELECT id FROM chart WHERE accno = '3559'))"; $dbh->do($query) || mydberror($query); } @@ -72,28 +94,24 @@ sub create_standard_buchungsgruppen_skr03 { " income_accno_id_3, expense_accno_id_3) " . "VALUES " . "('Standard 7%', " . - ($main::eur ? - "(SELECT id FROM chart WHERE link = 'IC' " . - " ORDER BY id ASC LIMIT 1), " - : - # 3980: Bestand Waren - " (SELECT id FROM chart WHERE accno = '3980'), ") . - # 8300: Erlöse 7% USt. - # 3300: Wareneingang 7% Vorsteuer - " (SELECT id FROM chart WHERE accno = '8300'), " . - " (SELECT id FROM chart WHERE accno = '3300'), " . - # 8125: Steuerfrei innergem. Lieferungen §41bUStG - # 3550: Steuerfreier innergem.Erwerb - " (SELECT id FROM chart WHERE accno = '8125'), " . - " (SELECT id FROM chart WHERE accno = '3550'), " . - # 8300: Erlöse 7% USt. - # 3420: Innergemein.Erwerb 7% VorSt u. Ust - " (SELECT id FROM chart WHERE accno = '8300'), " . - " (SELECT id FROM chart WHERE accno = '3420'), " . - # 8120: Steuerfreie Umsätze §4Nr.1a UstG - # 3300: Wareneingang 7% Vorsteuer - " (SELECT id FROM chart WHERE accno = '8120'), " . - " (SELECT id FROM chart WHERE accno = '3300'))"; + # 3980: Bestand Waren + " (SELECT id FROM chart WHERE accno = '3980'), " . + # 8300: Erlöse 7% USt. + # 3300: Wareneingang 7% Vorsteuer + " (SELECT id FROM chart WHERE accno = '8300'), " . + " (SELECT id FROM chart WHERE accno = '3300'), " . + # 8125: Steuerfrei innergem. Lieferungen §41bUStG + # 3550: Steuerfreier innergem.Erwerb + " (SELECT id FROM chart WHERE accno = '8125'), " . + " (SELECT id FROM chart WHERE accno = '3550'), " . + # 8310: Erlöse Inland stpfl. EG-Lieferung7% + # 3420: Innergemein.Erwerb 7% VorSt u. Ust + " (SELECT id FROM chart WHERE accno = '8310'), " . + " (SELECT id FROM chart WHERE accno = '3420'), " . + # 8120: Steuerfreie Umsätze §4Nr.1a UstG + # 3559: Steuerfreie Einfuhren + " (SELECT id FROM chart WHERE accno = '8120'), " . + " (SELECT id FROM chart WHERE accno = '3559'))"; $dbh->do($query) || mydberror($query); } @@ -117,28 +135,24 @@ sub create_standard_buchungsgruppen_skr04 { " income_accno_id_3, expense_accno_id_3) " . "VALUES " . "('Standard 16%', " . - ($main::eur ? - "(SELECT id FROM chart WHERE link = 'IC' " . - " ORDER BY id ASC LIMIT 1), " - : - # 1140: Bestand Waren - " (SELECT id FROM chart WHERE accno = '1140'), ") . - # 4400: Erlöse 16% USt. - # 5400: Wareneingang 16% Vorsteuer - " (SELECT id FROM chart WHERE accno = '4400'), " . - " (SELECT id FROM chart WHERE accno = '5400'), " . - # 4125: Steuerfrei innergem. Lieferungen §41bUStG - # 5550: Steuerfreier innergem.Erwerb - " (SELECT id FROM chart WHERE accno = '4125'), " . - " (SELECT id FROM chart WHERE accno = '5550'), " . - # 4315: Erlös Inland stpfl.EG-Lieferung 16% - # 5425: Innergem.Erwerb 16% VorSt u. Ust - " (SELECT id FROM chart WHERE accno = '4315'), " . - " (SELECT id FROM chart WHERE accno = '5425'), " . - # 4150: Sonstige steuerfreie Umsätze §42-7UStG - # 5550: Steuerfreier innergem.Erwerb - " (SELECT id FROM chart WHERE accno = '4150'), " . - " (SELECT id FROM chart WHERE accno = '5550'))"; + # 1140: Bestand Waren + " (SELECT id FROM chart WHERE accno = '1140'), " . + # 4400: Erlöse 16% USt. + # 5400: Wareneingang 16% Vorsteuer + " (SELECT id FROM chart WHERE accno = '4400'), " . + " (SELECT id FROM chart WHERE accno = '5400'), " . + # 4125: Steuerfrei innergem. Lieferungen §41bUStG + # 5550: Steuerfreier innergem.Erwerb + " (SELECT id FROM chart WHERE accno = '4125'), " . + " (SELECT id FROM chart WHERE accno = '5550'), " . + # 4315: Erlös Inland stpfl.EG-Lieferung 16% + # 5425: Innergem.Erwerb 16% VorSt u. Ust + " (SELECT id FROM chart WHERE accno = '4315'), " . + " (SELECT id FROM chart WHERE accno = '5425'), " . + # 4150: Sonstige steuerfreie Umsätze §42-7UStG + # 5559: Steuerfreie Einfuhren + " (SELECT id FROM chart WHERE accno = '4150'), " . + " (SELECT id FROM chart WHERE accno = '5559'))"; $dbh->do($query) || mydberror($query); } @@ -156,28 +170,24 @@ sub create_standard_buchungsgruppen_skr04 { " income_accno_id_3, expense_accno_id_3) " . "VALUES " . "('Standard 7%', " . - ($main::eur ? - "(SELECT id FROM chart WHERE link = 'IC' " . - " ORDER BY id ASC LIMIT 1), " - : - # 1140: Bestand Waren - " (SELECT id FROM chart WHERE accno = '1140'), ") . - # 4300: Erlöse 7%USt - # 5300: Wareneingang 7% Vorsteuer - " (SELECT id FROM chart WHERE accno = '4300'), " . - " (SELECT id FROM chart WHERE accno = '5300'), " . - # 4125: Steuerfrei innergem. Lieferungen §41bUStG - # 5550: Steuerfreier innergem.Erwerb - " (SELECT id FROM chart WHERE accno = '4125'), " . - " (SELECT id FROM chart WHERE accno = '5550'), " . - # 4310: Erlöse Inland stpfl. EG-Lieferung7% - # 5420: Innergemein.Erwerb 7% VorSt u. Ust - " (SELECT id FROM chart WHERE accno = '4310'), " . - " (SELECT id FROM chart WHERE accno = '5420'), " . - # 4150: Sonstige steuerfreie Umsätze §42-7UStG - # 5550: Steuerfreier innergem.Erwerb - " (SELECT id FROM chart WHERE accno = '4150'), " . - " (SELECT id FROM chart WHERE accno = '5550'))"; + # 1140: Bestand Waren + " (SELECT id FROM chart WHERE accno = '1140'), " . + # 4300: Erlöse 7%USt + # 5300: Wareneingang 7% Vorsteuer + " (SELECT id FROM chart WHERE accno = '4300'), " . + " (SELECT id FROM chart WHERE accno = '5300'), " . + # 4125: Steuerfrei innergem. Lieferungen §41bUStG + # 5550: Steuerfreier innergem.Erwerb + " (SELECT id FROM chart WHERE accno = '4125'), " . + " (SELECT id FROM chart WHERE accno = '5550'), " . + # 4310: Erlöse Inland stpfl. EG-Lieferung7% + # 5420: Innergemein.Erwerb 7% VorSt u. Ust + " (SELECT id FROM chart WHERE accno = '4310'), " . + " (SELECT id FROM chart WHERE accno = '5420'), " . + # 4150: Sonstige steuerfreie Umsätze §42-7UStG + # 5559; Steuerfreie Einfuhren + " (SELECT id FROM chart WHERE accno = '4150'), " . + " (SELECT id FROM chart WHERE accno = '5559'))"; $dbh->do($query) || mydberror($query); } @@ -191,8 +201,11 @@ sub create_standard_buchungsgruppen { my ($coa) = $dbh->selectrow_array($query); if ($coa eq "Germany-DATEV-SKR03EU") { + fix_skr03(); return create_standard_buchungsgruppen_skr03(); + } elsif ($coa eq "Germany-DATEV-SKR04EU") { + fix_skr03(); return create_standard_buchungsgruppen_skr04(); }