begin;
-- DATEV SKR03
--
SELECT account_heading_save(NULL, '0000000', '', NULL);
SELECT account_save(NULL,'0002700','EDV-Software','A','0002700', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0010000','Fabrikbauten','A','0010000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0011000','Garagen','A','0011000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0011100','Außenanlagen','A','0011100', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0011200','Hof-und Wegebefestigung','A','0011200', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0011500','Andere Bauten','A','0011500', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0016500','Geschäftsbauten','A','0016500', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0008500','Grundstückswert eige.bebau.Grundst.','A','0008500', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0009000','Geschäftsbauten','A','0009000', NULL, false, false, string_to_array('', ':'));
SELECT account_heading_save(NULL, '0016000', 'Bauten auf fremden Grundstücken', NULL);
SELECT account_save(NULL,'0017000','Fabrikbauten','A','0017000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0017500','Garagen','A','0017500', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0017600','Außenanlage','A','0017600', NULL, false, false, string_to_array('', ':'));
SELECT account_heading_save(NULL, '0020000', 'Techn.Anlagen und Maschinen', NULL);
SELECT account_save(NULL,'0021000','Maschinen','A','0021000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0022000','Maschinengebundene Werkzeuge','A','0022000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0024000','Maschinelle Anlagen','A','0024000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0028000','Betriebsvorrichtung','A','0028000', NULL, false, false, string_to_array('', ':'));
SELECT account_heading_save(NULL, '0030000', 'Andere Anlagen,Betrieb-und Geschäftsaus', NULL);
SELECT account_save(NULL,'0031000','Andere Anlagen','A','0031000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0032000','PKW','A','0032000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0035000','LKW','A','0035000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0040000','Betriebsausstattung','A','0040000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0041000','Geschäftsausstattung','A','0041000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0042000','Büroeinrichtung','A','0042000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0043000','Ladeneinrichtung','A','0043000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0048000','Geringwertige Wirtschaftsg.b.410EUR','A','0048000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0049000','Sons.Betriebs- Geschäftsausstattung','A','0049000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0050400','Ant.a.herr.o.m.Mehrh.bet.Ges.schaft','A','0050400', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0051300','Typisch stille Beteiligungen','A','0051300', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0063100','- Restlaufzeit bis 1 Jahr','L','0063100', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0051600','Atypische stille Beteiligungen','A','0051600', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0064000','- Restlaufzeit 1 bis 5 Jahre','L','0064000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0065000','- Restlaufzeit größer als 5 Jahre','L','0065000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0099600','Pauschalwertb.m.Restlaufzeit v. 1J.','A','0099600', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0140000','Ford. a.Lieferungen und Leistungen','A','0140000', NULL, false, false, string_to_array('AR', ':'));
SELECT account_save(NULL,'0080000','Gezeichnetes Kapital','Q','0080000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0150000','Sonstige Vermögensgegenstände','A','0150000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0153000','Forderungen gegen Personal','A','0153000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0154500','Umsatzsteuerforderungen','A','0154500', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0100000','Kasse','A','0100000', NULL, false, false, string_to_array('AR_paid:AP_paid', ':'));
SELECT account_save(NULL,'0120000','Bank','A','0120000', NULL, false, false, string_to_array('AR_paid:AP_paid', ':'));
SELECT account_save(NULL,'0096300','Körperschaftssteuerrückstellung','Q','0096300', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0095500','Steuerrückstellung','Q','0095500', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0095700','Gewerbesteuerrückstellung','Q','0095700', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0080100','Ausst.Einl.a.d.gezeichnete Kapital','Q','0080100', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0084000','Kapitalrücklage','Q','0084000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0086000','Gewinnvortrag vor Verwendung','Q','0086000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0086900','Vortrag auf neue Rechnungen','Q','0086900', NULL, false, false, string_to_array('', ':'));
SELECT account_heading_save(NULL, '0000500', 'Sachanlagen', NULL);
SELECT account_heading_save(NULL, '0050000', 'Finanzanlagen', NULL);
SELECT account_save(NULL,'0051000','Beteiligungen','A','0051000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0063000','Verbindl.gegenüber Kreditinstituten','L','0063000', NULL, false, false, string_to_array('', ':'));
SELECT account_heading_save(NULL, '0060000', 'Verbindlichkeiten', NULL);
SELECT account_save(NULL,'0086800','Verlustvortrag vor Verwendung','L','0086800', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0097000','Sonstige Rückstellungen','L','0097000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0097400','Rückstellungen für Gewährleistungen','L','0097400', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0097700','Rücks.f.Abschluß-u.Prüfungskosten','L','0097700', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0097800','Aufwandsrückstellungen','L','0097800', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0098000','Aktive Rechnungsabgrenzung','A','0098000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0099000','Passive Rechnungsabgrenzung','L','0099000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0099200','Wertberichtigungen','A','0099200', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0099800','Einzelwertber.m.Restlaufzeit v.1 J.','A','0099800', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0146000','Zweifelhafte Forderungen','A','0146000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0151000','Geleistete Anzahlung auf Vorräte','A','0151000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0151100','Geleistete Anzahlungen 7%','A','0151100', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0151700','Geleistete Anzahlung 16%','A','0151700', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0152500','Kautionen','A','0152500', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0154000','Steuerüberzahlungen','A','0154000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0157000','Abziehbare Vorsteuer','A','0157000', NULL, false, false, string_to_array('AR_tax:AP_tax', ':'));
SELECT account_save(NULL,'0160000','Verbindlichkeiten aus Lief.u.Leist.','L','0160000', NULL, false, false, string_to_array('AP', ':'));
SELECT account_save(NULL,'0174100','Verbindl.a.Lohn-und Kirchensteuer','L','0174100', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0178000','Umsatzsteuer-Vorauszahlungen','L','0178000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0178100','Umsatzsteuer-Vorauszahlung 1/11','L','0178100', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0178900','Umsatzsteuer laufendes Jahr','L','0178900', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0179000','Umsatzsteuer Vorjahr','L','0179000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0179100','Umsatzsteuer frühere Jahre','L','0179100', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0180000','Privatentnahme allgemein','Q','0180000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0189000','Privateinlagen','Q','0189000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0210000','Zinsen und ähnl.Aufwendungen','E','0210000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0211000','Zinsaufwendung f.kurzf.Verbindlichk','E','0211000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0212000','Zinsaufwendung f.langf.Verbindlichk','E','0212000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0221000','Kapitalertragssteuer','E','0221000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0231000','Anlagenabgänge - bei Buchverlust','E','0231000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0231500','Anlagenabgänge-Buchgewinn','I','0231500', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0237500','Grundsteuer','E','0237500', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0245000','Einstell.i.d.Pauschalwertbe.z.Forde','E','0245000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0245100','Einstell.i.d.Einzelwertb.z.Forderun','E','0245100', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0250000','Außerordentliche Erträge','I','0250000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0251000','Betriebsfremde Erträge n.außerorden','I','0251000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0252000','Periodenfremde Erträge nicht außero','I','0252000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0270000','Sonstige Erträge','I','0270000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0272000','Ertr.a.d.Abgang v.Gegens.d.Anlageve','I','0272000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0272500','Ertr.a.d.Abg.v.Gegenst.d.Umlaufverm','I','0272500', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0273000','Ertr.a.Herab.d.Pauschal.z.Forderung','I','0273000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0273100','Ertr.a.Herab.d.Einzelw.z.Forderunge','I','0273100', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0273200','Ertr. aus abgeschriebenen Forderung','I','0273200', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0274200','Versicherungsentschädigungen','I','0274200', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0286000','Gewinnvortrag nach Verwendung','L','0286000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0286800','Verlustvortrag nach Verwendung','L','0286800', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0286900','Vortrag auf neue Rechnungen','L','0286900', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0375000','Erhaltene Boni 7% Vorsteuer','I','0375000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0376000','Erhaltene Boni 16% Vorsteuer','I','0376000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0380000','Anschaffungsnebenkosten','E','0380000', NULL, false, false, string_to_array('IC_cogs:IC_expense', ':'));
SELECT account_save(NULL,'0383000','Leergut','E','0383000', NULL, false, false, string_to_array('IC_cogs:IC_expense', ':'));
SELECT account_save(NULL,'0385000','Zölle und Einfuhrabgaben','E','0385000', NULL, false, false, string_to_array('IC_cogs:IC_expense', ':'));
SELECT account_save(NULL,'0396000','Bestandsver.Roh-,Hilfs-.Betriebs.','E','0396000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0397000','Bestand Roh-,Hilfs-,u.Betriebsstoff','A','0397000', NULL, false, false, string_to_array('IC', ':'));
SELECT account_save(NULL,'0398000','Bestand Waren','E','0398000', NULL, false, false, string_to_array('IC', ':'));
SELECT account_save(NULL,'0399000','Verrechnete Stoffkosten','E','0399000', NULL, false, false, string_to_array('IC_cogs:IC_expense', ':'));
SELECT account_save(NULL,'0400000','Material-und Stoffverbrauch','E','0400000', NULL, false, false, string_to_array('IC_cogs:IC_expense', ':'));
SELECT account_save(NULL,'0410000','Löhne und Gehälter','E','0410000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0412500','Ehegattengehalt','E','0412500', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0340000','Wareneingang 16% Vorsteuer','E','0340000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0342000','Innergemein.Erwerb 7% VorSt u. Ust','E','0342000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0342500','Innergem.Erwerb 16% VorSt u. Ust','E','0342500', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0373100','Erhaltene Skonti 7% Vorsteuer','I','0373100', NULL, false, false, string_to_array('AP_paid', ':'));
SELECT account_save(NULL,'0373500','Erhaltene Skonti 16% Vorsteuer','I','0373500', NULL, false, false, string_to_array('AP_paid', ':'));
SELECT account_save(NULL,'0330000','Wareneingang 7% Vorsteuer','E','0330000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0413000','Gesetzlich soziale Aufwendungen','E','0413000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0413800','Beiträge zur Berufsgenossenschaftr','E','0413800', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0414500','Freiwillige sozi.Aufw.lohnsteuerfr.','E','0414500', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0414900','Pauschale Lohnsteuera.sons.Bezüge','E','0414900', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0416500','Aufwendung f.Altersversorgung','E','0416500', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0417000','Vermögenswirksame Leistungen','E','0417000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0420000','Raumkosten','E','0420000', NULL, false, false, string_to_array('AP_amount:AP_tax', ':'));
SELECT account_save(NULL,'0417500','Fahrtkostenerst.Wohnung/Arbeitsstät','E','0417500', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0419000','Aushilfslöhne','E','0419000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0419900','Lohnsteuer für Aushilfe','E','0419900', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0159000','Durchlaufende Posten','A','0159000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0422000','Pacht','E','0422000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0423000','Heizung','E','0423000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0424000','Gas,Strom, Wasser','E','0424000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0425000','Reinigung','E','0425000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0426000','Instandhaltung betrieb.Räume','E','0426000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0428000','Sonstige Raumkosten','E','0428000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0432000','Gewerbesteuer','E','0432000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0434000','Sonstige Betriebssteuern','E','0434000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0436000','Versicherungen','E','0436000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0438000','Beiträge','E','0438000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0439000','Sonstige Abgaben','E','0439000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0450000','Fahrzugkosten','E','0450000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0451000','Kfz-Steuer','E','0451000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0452000','Kfz-Versicherungen','E','0452000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0453000','Laufende Kfz-Betriebskosten','E','0453000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0454000','Kfz-Reparaturen','E','0454000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0455000','Garagenmiete','E','0455000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0457000','Fremdfahrzeuge','E','0457000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0458000','Sonstige Kfz-Kosten','E','0458000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0461000','Werbekosten','E','0461000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0463000','Geschenke bis 40 EUR','E','0463000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0463500','Geschenke über 40 EUR','E','0463500', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0464000','Repräsentationskosten','E','0464000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0465000','Bewirtungskosten','E','0465000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0465400','Nicht abzugsfähige Bewirtungskosten','E','0465400', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0465500','Nicht abzugsfähige Betriebsausgaben','E','0465500', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0466300','Reisekosten Arbeitn.m.Vorsteuerabzu','E','0466300', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0466600','Reisekosten Arbeitn.Übernachtungsau','E','0466600', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0466800','Kilometerentgelderstattung Arbeitne','E','0466800', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0467400','Reisekosten Untern.Verpflegungsmehr','E','0467400', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0467600','Reisekosten Untern.Übernachtungsauf','E','0467600', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0467800','Kilometererstattungsgeld Unternehme','E','0467800', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0470000','Kosten der Warenabgabe','E','0470000', NULL, false, false, string_to_array('IC_cogs', ':'));
SELECT account_save(NULL,'0471000','Verpackungsmaterial','E','0471000', NULL, false, false, string_to_array('IC_cogs', ':'));
SELECT account_save(NULL,'0473000','Ausgangsfracht','E','0473000', NULL, false, false, string_to_array('IC_cogs', ':'));
SELECT account_save(NULL,'0475000','Transportversicherung','E','0475000', NULL, false, false, string_to_array('IC_cogs', ':'));
SELECT account_save(NULL,'0476000','Verkaufsprovision','E','0476000', NULL, false, false, string_to_array('IC_cogs', ':'));
SELECT account_save(NULL,'0478000','Fremdarbeiten','E','0478000', NULL, false, false, string_to_array('IC_cogs', ':'));
SELECT account_save(NULL,'0479000','Aufwand für Gewährleistungen','E','0479000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0480900','Sonstige Reparaturen u.Instandhalt.','E','0480900', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0481000','Mietleasing','E','0481000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0481500','Kaufleasing','E','0481500', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0482000','AfA a.Aufw.f.d.Inga.u.Erw.Geschäfts','E','0482000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0482100','AfA a.Aufw.f.d.Währungsumst.a.Euro','E','0482100', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0483000','Abschreibungen auf Sachanlagen','E','0483000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0485500','Sofortabschreibung GWG','E','0485500', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0491000','Porto','E','0491000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0492000','Telefon','E','0492000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0492500','Telefax','E','0492500', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0493000','Bürobedarf','E','0493000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0494000','Zeitschriften, Bücher','E','0494000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0494500','Fortbildungskosten','E','0494500', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0494600','Freiwillige Sozialleistungen','E','0494600', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0495000','Rechts- und Beratungskosten','E','0495000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0495500','Buchführungskosten','E','0495500', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0495700','Abschluß- und Prüfungskosten','E','0495700', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0496000','Mieten für Einrichtungen','E','0496000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0497000','Nebenkosten des Geldverkehrs','E','0497000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0498000','Betriebsbedarf','E','0498000', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0498500','Werkzeuge und Kleingeräte','E','0498500', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0498600','Sonstige Aufwendungen (Ausbuchung)','E','0498600', NULL, false, false, string_to_array('AP_amount', ':'));
SELECT account_save(NULL,'0700000','Unfertige Erzeu.unfert.Leistungen','A','0700000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0136000','Geldtransit','A','0136000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0705000','Unfertige Erzeugnisse','A','0705000', NULL, false, false, string_to_array('IC', ':'));
SELECT account_save(NULL,'0708000','Unfertige Leistungen','A','0708000', NULL, false, false, string_to_array('IC', ':'));
SELECT account_save(NULL,'0711000','Fertige Erzeugnisse (Bestand)','A','0711000', NULL, false, false, string_to_array('IC', ':'));
SELECT account_save(NULL,'0714000','Waren (Bestand)','A','0714000', NULL, false, false, string_to_array('IC', ':'));
SELECT account_save(NULL,'0873100','Gewährte Skonti 7% USt','I','0873100', NULL, false, false, string_to_array('AP_paid', ':'));
SELECT account_save(NULL,'0873500','Gewährte Skonti 16% USt.','I','0873500', NULL, false, false, string_to_array('AP_paid', ':'));
SELECT account_save(NULL,'0875000','Gewährte Boni 7% USt.','I','0875000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0876000','Gewährte Boni 16% USt.','I','0876000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0882000','Erlöse aus Anlageverkäufen 16%Ust','I','0882000', NULL, false, false, string_to_array('IC_sale', ':'));
SELECT account_save(NULL,'0895500','Umsatzsteuervergütungen','I','0895500', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0890500','Entnahme v. Gegenst.o.USt.','I','0890500', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0900000','Saldenverträge,Sachkonten','A','0900000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0900800','Saldenverträge,Debitoren','A','0900800', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0900900','Saldenverträge,Kreditoren','L','0900900', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0266000','Erträge aus Kursdifferenzen','I','0266000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0215000','Aufwendungen aus Kursdifferenzen','E','0215000', NULL, false, false, string_to_array('', ':'));
SELECT account_save(NULL,'0850000','Provisionserlöse','I','0850000', NULL, false, false, string_to_array('AR_amount:IC_income', ':'));
SELECT account_save(NULL,'0157100','Abziebare Vorsteuer 7%','A','0157100', NULL, false, false, string_to_array('AP_tax', ':'));
SELECT account_save(NULL,'0157500','Abziehbare Vorsteuer 16%','A','0157500', NULL, false, false, string_to_array('AP_tax:AP_paid', ':'));
SELECT account_save(NULL,'0177100','Umsatzsteuer 7%','L','0177100', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':'));
SELECT account_save(NULL,'0177500','Umsatzsteuer 16%','L','0177500', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':'));
SELECT account_save(NULL,'0830000','Erlöse 7%USt','I','0830000', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':'));
SELECT account_save(NULL,'0840000','Erlöse 16% USt.','I','0840000', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':'));
SELECT account_heading_save(NULL, '950', 'Rückstellungen', NULL);
--
INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '0398000'));

 INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '0840000'));

 INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '0399000'));

 INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '0266000'));

 INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '0215000'));

 INSERT INTO defaults (setting_key, value) VALUES ('curr', 'EUR:USD');

 INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg');
--
INSERT INTO tax (chart_id,rate) VALUES ((SELECT id FROM chart WHERE accno = '0157100'),0.07);
INSERT INTO tax (chart_id,rate) VALUES ((SELECT id FROM chart WHERE accno = '0157500'),0.16);
INSERT INTO tax (chart_id,rate) VALUES ((SELECT id FROM chart WHERE accno = '0177100'),0.07);
INSERT INTO tax (chart_id,rate) VALUES ((SELECT id FROM chart WHERE accno = '0177500'),0.16);

commit;
UPDATE account
   SET tax = true
WHERE id
   IN (SELECT account_id
       FROM account_link
       WHERE description LIKE '%_tax');

SELECT cr_coa_to_account_save(accno, accno || '--' || description)
FROM account WHERE accno = '0120000';

