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);
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);\r
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);\r
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);\r
-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);\r
+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);\r
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);\r
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);\r
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);\r
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;
" 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);
}
" 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);
}
" 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);
}
" 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);
}
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();
}