X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/e7a9cbbb3df30a419d86805db74cf0efa08310d5..9ceafde6395689d82f625f1d63ff6eb384b87b96:/sql/Germany-DATEV-SKR04EU-chart.sql

diff --git a/sql/Germany-DATEV-SKR04EU-chart.sql b/sql/Germany-DATEV-SKR04EU-chart.sql
index c12bf63a0..ea0db7ab0 100644
--- a/sql/Germany-DATEV-SKR04EU-chart.sql
+++ b/sql/Germany-DATEV-SKR04EU-chart.sql
@@ -375,61 +375,70 @@ insert into tax (chart_id,rate,taxnumber, taxkey, taxdescription) values ((selec
 insert into tax (chart_id,rate,taxnumber, taxkey, taxdescription) values ((select id from chart where accno = '1402'),'0.07','1402','18','Steuerpflicht. EG-Erwerb 7%');
 insert into tax (chart_id,rate,taxnumber, taxkey, taxdescription) values ((select id from chart where accno = '1402'),'0.16','1403','19','Steuerpflicht. EG-Erwerb 16%');
 
--- Buchungsgruppen
+-- Ergaenzungen fuer 19% UmSt. ab 1.01.2007
+insert into taxkeys (chart_id, tax_id, taxkey_id, pos_ustva, startdate) select chart.id, tax.id, taxkey_id, pos_ustva, '1970-01-01' from chart LEFT JOIN tax on (tax.taxkey=chart.taxkey_id) WHERE taxkey_id is not null;
+insert into taxkeys (chart_id, tax_id, taxkey_id,startdate) SELECT 0, id, taxkey, '1970-01-01' FROM tax;
+INSERT INTO chart (accno, description, charttype, category, link, taxkey_id, pos_ustva, pos_eur)
+      VALUES ('3806','Umsatzsteuer 19 %', 'A', 'I', 'AR_tax:IC_taxpart:IC_taxservice:CT_tax', 0, 511,6);
+INSERT INTO chart (accno, description, charttype, category, link, taxkey_id, pos_ustva, pos_eur)
+      VALUES ('1406','Abziehbare Vorsteuer 19 %', 'A', 'E', 'AP_tax:IC_taxpart:IC_taxservice:CT_tax', 0, 66,27);
+INSERT INTO tax (chart_id, rate, taxnumber, taxkey, taxdescription) VALUES ((SELECT id from CHART WHERE accno='3806'), 0.19, '3806', 3, 'Umsatzsteuer 19%');
+INSERT INTO tax (chart_id, rate, taxnumber, taxkey, taxdescription) VALUES ((SELECT id from CHART WHERE accno='1406'), 0.19, '1406', 9, 'Vorsteuer 19%');
+insert into taxkeys (chart_id, tax_id, taxkey_id, pos_ustva, startdate) select chart.id, (SELECT id from tax where taxdescription='Umsatzsteuer 19%'), 3, pos_ustva, '2007-01-01' from chart WHERE taxkey_id=3;
+insert into taxkeys (chart_id, tax_id, taxkey_id, pos_ustva, startdate) select chart.id, (SELECT id from tax where taxdescription='Vorsteuer 19%'), 9, pos_ustva, '2007-01-01' from chart WHERE taxkey_id=9;
 
--- Erst einkommentieren, wenn in lx-office.sql das 2.4.0er Schema
--- inklusive der Tabelle 'buchungsgruppen' enthalten ist.
+-- Buchungsgruppen
 
--- INSERT INTO buchungsgruppen
---   (description, inventory_accno_id,
---    income_accno_id_0, expense_accno_id_0,
---    income_accno_id_1, expense_accno_id_1,
---    income_accno_id_2, expense_accno_id_2,
---    income_accno_id_3, expense_accno_id_3)
---  VALUES
---   ('Standard 16%',
---    -- 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'));
+INSERT INTO buchungsgruppen
+  (description, inventory_accno_id,
+   income_accno_id_0, expense_accno_id_0,
+   income_accno_id_1, expense_accno_id_1,
+   income_accno_id_2, expense_accno_id_2,
+   income_accno_id_3, expense_accno_id_3)
+ VALUES
+  ('Standard 16%',
+   -- 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'));
 
--- INSERT INTO buchungsgruppen
---   (description, inventory_accno_id,
---    income_accno_id_0, expense_accno_id_0,
---    income_accno_id_1, expense_accno_id_1,
---    income_accno_id_2, expense_accno_id_2,
---    income_accno_id_3, expense_accno_id_3)
---  VALUES
---   ('Standard 7%',
---    -- 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'));
+INSERT INTO buchungsgruppen
+  (description, inventory_accno_id,
+   income_accno_id_0, expense_accno_id_0,
+   income_accno_id_1, expense_accno_id_1,
+   income_accno_id_2, expense_accno_id_2,
+   income_accno_id_3, expense_accno_id_3)
+ VALUES
+  ('Standard 7%',
+   -- 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'));
