From 8e5b1f0e363dd22883e931006b8ac414bad9bbc5 Mon Sep 17 00:00:00 2001 From: Rolf Fluehmann Date: Fri, 20 Nov 2015 12:49:21 +0100 Subject: [PATCH] Consolidation and extended test runs --- SL/Form.pm | 16 +- sql/Pg-upgrade2/defaults_datev_check.pl | 2 +- sql/Switzerland-deutsch-MWST-2014-chart.sql | 729 +++++++----------- sql/Switzerland-deutsch-keineMWST-chart.sql | 329 -------- ...witzerland-deutsch-ohneMWST-2014-chart.sql | 700 +++++++---------- t/000setup_database.t | 25 +- t/background_job/create_periodic_invoices.t | 22 +- ...ales_order_with_periodic_invoices_config.t | 21 +- .../financial_overview/sales_orders.t | 21 +- t/db_helper/acts_as_list.t | 6 +- t/db_helper/convert_invoice.t | 30 +- t/db_helper/payment.t | 448 +++++++---- t/db_helper/price_tax_calculator.t | 106 ++- t/db_helper/record_links.t | 12 +- t/form/arap.t | 154 ++-- t/form/format_amount.t | 9 +- t/form/parse_amount.t | 29 + 17 files changed, 1170 insertions(+), 1489 deletions(-) delete mode 100644 sql/Switzerland-deutsch-keineMWST-chart.sql diff --git a/SL/Form.pm b/SL/Form.pm index 6a65a82bc..5d754efec 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -945,15 +945,13 @@ sub parse_amount { return 0; } - if ($myconfig->{numberformat} eq '1,000.00') { - $amount =~ s/,//g; - } elsif ($myconfig->{numberformat} eq '1.000,00') { + $amount =~ s/\'//g; + if ( ($myconfig->{numberformat} eq '1.000,00') + || ($myconfig->{numberformat} eq '1000,00')) { $amount =~ s/\.//g; - } elsif ($myconfig->{numberformat} eq "1'000.00") { - $amount =~ s/\'//g; + $amount =~ s/,/\./g; } - - $amount =~ s/,/\./g; + $amount =~ s/,//g; $main::lxdebug->leave_sub(2); @@ -2898,8 +2896,8 @@ sub create_links { (SELECT cu.name FROM currencies cu WHERE cu.id=d.currency_id) AS defaultcurrency, (SELECT c.accno FROM chart c WHERE d.fxgain_accno_id = c.id) AS fxgain_accno, (SELECT c.accno FROM chart c WHERE d.fxloss_accno_id = c.id) AS fxloss_accno, - (SELECT c.accno FROM chart c WHERE d.rndgain_accno_id = c.id) AS rndgain_accno, - (SELECT c.accno FROM chart c WHERE d.rndloss_accno_id = c.id) AS rndloss_accno + (SELECT c.accno FROM chart c WHERE d.rndgain_accno_id = c.id) AS rndgain_accno, + (SELECT c.accno FROM chart c WHERE d.rndloss_accno_id = c.id) AS rndloss_accno FROM defaults d|; $ref = selectfirst_hashref_query($self, $dbh, $query); map { $self->{$_} = $ref->{$_} } keys %$ref; diff --git a/sql/Pg-upgrade2/defaults_datev_check.pl b/sql/Pg-upgrade2/defaults_datev_check.pl index 956bc810e..9b742ed52 100644 --- a/sql/Pg-upgrade2/defaults_datev_check.pl +++ b/sql/Pg-upgrade2/defaults_datev_check.pl @@ -23,7 +23,7 @@ sub run { # if checks are not set in config set it to true foreach my $check (qw(check_on_sales_invoice check_on_purchase_invoice check_on_ar_transaction check_on_ap_transaction check_on_gl_transaction)) { my $check_set = 1; - if ($::lx_office_conf{datev_check}->{$check} == 0 && defined ($::lx_office_conf{datev_check}->{$check})) { + if (defined ($::lx_office_conf{datev_check}->{$check}) && $::lx_office_conf{datev_check}->{$check} == 0) { $check_set = 0; } diff --git a/sql/Switzerland-deutsch-MWST-2014-chart.sql b/sql/Switzerland-deutsch-MWST-2014-chart.sql index a2fa115ba..3fab61a7b 100644 --- a/sql/Switzerland-deutsch-MWST-2014-chart.sql +++ b/sql/Switzerland-deutsch-MWST-2014-chart.sql @@ -1,463 +1,314 @@ -- deutschsprachiger Kontenplan nach Schweizer Kontenrahmen KMU für Firmen in der Schweiz, die mehrwertsteuerpflichtig sind -- Erstellt am 4.6.2014 --- Grundlage: Revision OR Stand 1.1.2013, insbesondere Art. 957a Abs. 2 --- Redaktion: Andreas Rudin, http://www.revamp-it.ch --- Copyright 2014 Andreas Rudin - --- This file is part of kivitendo. --- kivitendo is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- kivitendo is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- You should have received a copy of the GNU General Public License --- along with kivitendo. If not, see . - -DELETE FROM buchungsgruppen; - -INSERT INTO buchungsgruppen (id, 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 -(1,'Standard',16,72,90,72,90,72,90,72,90); - +-- Korrigiert: November 2015 +-- Grundlage: Revision OR Stand 1.1.2013, insbesondere Art. 957a Abs. 2 DELETE FROM chart; -INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik, itime, mtime, new_chart_id, valid_from) VALUES -(1,1,'AKTIVEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(2,10,'UMLAUFSVERMÖGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(3,100,'Flüssige Mittel','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(4,1000,'Kasse','A','A','AR_paid:AP_paid',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(5,1020,'Postfinance oder Bank1','A','A','AR_paid:AP_paid',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(6,1021,'Bank2','A','A','AR_paid:AP_paid',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(7,106,'Kurzfristig gehaltene Aktiven mit Börsenkurs','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(8,110,'Forderungen aus Lieferungen und Leistungen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(9,1100,'Forderungen aus Lieferungen und Leistungen','A','A','AR',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(10,114,'Übrige kurzfristige Forderungen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(11,1140,'Vorschüsse, kurzfristige Darlehen','A','A','AR',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(12,1170,'Vorsteuer auf Aufwand','A','A','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(13,1171,'Vorsteuer auf Investitionen','A','A','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(14,1176,'Verrechnungssteuer','A','A','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(15,120,'Vorräte und nicht fakturierte Dienstleistungen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(16,1200,'Handelswaren','A','A','IC',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(17,1210,'Rohstoffe','A','A','IC',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(18,1280,'Nicht fakturierte Dienstleistungen','A','A','IC',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(19,1290,'Angefangene Arbeiten','A','A','IC',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(20,130,'Aktive Rechnungsabgrenzungen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(21,1300,'Aktive Rechnungsabgrenzungen','A','A','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(22,14,'ANLAGEVERMÖGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(23,140,'Finanzanlagen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(24,148,'Beteiligungen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(25,150,'Mobile Sachanlagen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(26,1500,'Maschinen und Apparate','A','A','IC',NULL,6,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(27,1510,'Mobiliar und Einrichtungen','A','A','IC',NULL,6,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(28,1520,'Büromaschinen, Informatik','A','A','IC',NULL,6,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(29,1530,'Fahrzeuge','A','A','IC',NULL,6,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(30,1540,'Werkzeuge und Geräte','A','A','IC',NULL,6,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(31,160,'Immobile Sachanlagen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(32,170,'Immaterielle Werte','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(33,180,'Nicht einbezahltes Grund- Gesellschafter- oder Stiftungskapital','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(34,2,'PASSIVEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(35,20,'KURZFRISTIGES FREMDKAPITAL','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(36,200,'Verbindlichkeiten aus Lieferungen und Leistungen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(37,2000,'Verbindlichkeiten aus Lieferungen und Leistungen','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(38,2001,'Übrige Kreditoren','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(39,2030,'Anzahlungen von Kundinnen und Kunden','A','L','AR_paid:AP_paid',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(40,210,'Kurzfristige verzinsliche Verbindlichkeiten','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(41,2100,'Bankverbindlichkeiten','A','L','AR_paid:AP_paid',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(42,2140,'Übrige verzinsliche Verbindlichkeiten','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(43,220,'Übrige kurzfristige Verbindlichkeiten','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(44,2200,'Geschuldete MWST(2,5)','A','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(45,2201,'Geschuldete MWST(8,0)','A','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(46,2206,'Verrechnungssteuer','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(47,2210,'Geschuldete Steuern','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(48,2250,'Personalaufwand','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(49,2270,'Verbindlichkeiten Sozialversicherungen und Vorsorgeeinrichtungen','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(50,230,'Passive Rechnungsabgrenzungen und kurzfristige Rückstellungen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(51,2300,'Passive Rechnungsabgrenzungen','A','L','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(52,2330,'Kurzfristige Rückstellungen','A','L','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(53,24,'LANGFRISTIGES FREMDKAPITAL','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(54,240,'Langfristige verzinsliche Verbindlichkeiten','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL),(55,2400,'Bankverbindlichkeiten','A','L','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(56,2450,'Langfristige verzinsliche Darlehen','A','L','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(57,250,'Übrige langfristige Verbindlichkeiten','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(58,2500,'Zinslose Darlehen','A','L','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(59,260,'Rückstellungen sowie vom Gesetz vorgesehene ähnliche Positionen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(60,28,'EIGENKAPITAL','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(61,280,'Grund-, Gesellschafter- oder Stiftungskapital','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(62,2800,'Stammkapital','A','Q','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(63,290,'Reserven, Jahresgewinn oder Jahresverlust','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(64,2900,'Gesetzliche Kapitalreserve','A','Q','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(65,2950,'Gesetzliche Gewinnreserve','A','Q','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(66,2960,'Freiwillige Gewinnreserve','A','Q','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(67,2970,'Gewinn- oder Verlustvortrag','A','Q','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(68,2979,'Jahresgewinn oder -verlust','A','Q','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(69,2980,'Eigene Kapitalanteile','A','Q','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(70,3,'BETRIEBLICHER ERTRAG AUS LIEFERUNGEN UND LEISTUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(71,30,'PRODUKTIONSERLÖSE','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(72,3000,'Produktionserlöse','A','I','AR_amount:IC_sale',NULL,2,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(73,32,'HANDELSERLÖSE','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(74,3200,'Handelserlöse','A','I','AR_amount:IC_sale',NULL,2,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(75,34,'DIENSTLEISTUNGSERLÖSE','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(76,3400,'Dienstleistungserlöse','A','I','AR_amount:IC_income',NULL,2,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(77,36,'ÜBRIGE ERLÖSE AUS LIEFERUNGEN UND LEISTUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(78,3600,'Übrige Erlöse aus Lieferungen und Leistungen','A','I','IC_income',NULL,2,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(79,37,'EIGENLEISTUNGEN UND EIGENVERBRAUCH','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(80,3700,'Eigenleistungen','A','I','',NULL,2,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(81,38,'ERLÖSMINDERUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(82,3800,'Skonti','A','E','IC_sale:IC_cogs:IC_income:IC_expense',NULL,2,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(83,3801,'Rabatte, Preisnachlässe','A','E','IC_sale:IC_cogs:IC_income:IC_expense',NULL,2,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(84,3805,'Verluste aus Forderungen','A','E','IC_sale:IC_cogs:IC_income:IC_expense',NULL,2,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(85,3809,'MWST - nur Saldosteuersatz','A','E','IC_sale:IC_cogs:IC_income:IC_expense',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(86,39,'BESTANDESÄNDERUNGEN AN UNFERTIGEN UND FERTIGEN ERZEUGNISSEN SOWIE AN NICHT FAKTURIERTEN DIENSTLEISTUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(87,3900,'Bestandesänderungen','A','I','',NULL,2,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(88,4,'AUFWAND FÜR MATERIAL, HANDELSWAREN, DIENSTLEISTUNGEN UND ENERGIE','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(89,40,'MATERIALAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(90,4000,'Materialeinkauf','A','E','AP_amount:IC_cogs',NULL,4,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(91,42,'HANDELSWARENAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(92,4200,'Einkauf Handelswaren','A','E','AP_amount:IC_cogs',NULL,4,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(93,4208,'Bestandsänderungen Handelswaren','A','E','AP_amount:IC_cogs',NULL,4,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(94,44,'AUFWAND FÜR BEZOGENE DRITTLEISTUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(95,4400,'Aufwand für Drittleistungen','A','E','AP_amount:IC_expense',NULL,4,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(96,45,'ENERGIEAUFWAND ZUR LEISTUNGSERSTELLUNG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(97,4500,'Energieaufwand zur Leistungserstellung','A','E','AP_amount:IC_expense',NULL,4,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(98,46,'ÜBRIGER AUFWAND FÜR MATERIAL, HANDELSWAREN UND DIENSTLEISTUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(99,47,'DIREKTE EINKAUFSSPESEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(100,4700,'Einkaufsspesen','A','E','AP_amount:IC_expense',NULL,4,NULL,NULL,NULL,6, 'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(101,48,'BESTANDESÄNDERUNGEN UND MATERIAL-/WARENVERLUSTE','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(102,4800,'Bestandesänderungen','A','E','',NULL,4,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(103,49,'EINKAUFSPREISMINDERUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(104,4900,'Skonti, Rabatte, Preisnachlässe','A','I','AP_amount:IC_expense',NULL,4,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(105,5,'PERSONALAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(106,500,'Löhne und Gehälter','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(107,5000,'Löhne und Gehälter','A','E','IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(108,5001,'Erfolgsbeteiligungen','A','E','IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(109,5005,'Leistungen von Sozialversicherungen','A','I','IC_income',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(110,57,'SOZIALVERSICHERUNGSAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(111,5700,'AHV, IV, EO, ALV','A','E','AP_amount:IC_income:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(112,5710,'FAK','A','E','AP_amount:IC_income:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(113,5720,'Berufliche Vorsorge','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(114,5730,'Unfallversicherung','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(115,5740,'Krankentaggeldversicherung','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(116,5790,'Quellensteuer','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(117,58,'ÜBRIGER PERSONALAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(118,5800,'Aufwand für Personaleinstellung','A','E','IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(119,5810,'Weiterbildungskosten','A','E','IC_expense',NULL,1,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(120,5830,'Spesen','A','E','IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(121,5880,'Sonstiger Personalaufwand','A','E','IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(122,59,'LEISTUNGEN DRITTER','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(123,6,'ÜBRIGER BETRIEBLICHER AUFWAND, ABSCHREIBUNGEN UND WERTBERICHTIGUNGEN SOWIE FINANZERGEBNIS','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(124,60,'RAUMAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(125,6000,'Miete','A','E','IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(126,6040,'Reinigung','A','E','IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(127,6050,'Übriger Raumaufwand','A','E','IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(128,61,'UNTERHALT, REPARATUREN, ERSATZ, LEASING, MOBILE SACHANLAGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(129,6100,'Unterhalt','A','E','AP_amount:IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(130,62,'FAHRZEUG- UND TRANSPORTAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(131,6200,'Fahrzeugaufwand','A','E','AP_amount:IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(132,6201,'Transportaufwand','A','E','AP_amount:IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(133,63,'SACHVERSICHERUNGEN, ABGABEN, GEBÜHREN, BEWILLIGUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(134,6300,'Betriebsversicherungen','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(135,6360,'Abgaben, Gebühren und Bewilligungen','A','E','AP_amount:IC_expense',NULL,1,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(136,64,'ENERGIE- UND ENTSORGUNGSAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(137,6400,'Strom, Gas, Wasser','A','E','AP_amount:IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(138,6460,'Entsorgungsaufwand','A','E','AP_amount:IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(139,65,'VERWALTUNGS- UND INFORMATIKAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(140,6500,'Büromaterial, Drucksachen','A','E','AP_amount:IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(141,6503,'Fachliteratur','A','E','AP_amount:IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(142,6510,'Telefon, Fax, Porti Internet','A','E','AP_amount:IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(143,6520,'Beiträge, Spenden','A','E','AP_amount:IC_expense',NULL,1,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(144,6530,'Buchführungs- und Beratungsaufwand','A','E','AP_amount:IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(145,6540,'Verwaltungsrat, GV, Revision','A','E','AP_amount:IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(146,6570,'Informatikaufwand','A','E','AP_amount:IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(147,6590,'Übriger Verwaltungsaufwand','A','E','AP_amount:IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(148,66,'WERBEAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(149,6600,'Werbeaufwand','A','E','AP_amount:IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(150,67,'SONSTIGER BETRIEBLICHER AUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(151,6720,'Forschung und Entwicklung','A','E','AP_amount:IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(152,6790,'Übriger Betriebsaufwand','A','E','AP_amount:IC_expense',NULL,6,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(153,68,'ABSCHREIBUNGEN UND WERTBERICHTIGUNGEN AUF POSITIONEN DES ANLAGEVERMÖGENS','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(154,6800,'Abschreibungen Finanzanlagen','A','E','',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(155,6810,'Abschreibungen Beteiligungen','A','E','',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(156,6820,'Abschreibungen mobile Sachanlagen','A','E','',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(157,6840,'Abschreibungen immaterielle Anlagen','A','E','',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(158,69,'FINANZAUFWAND UND FINANZERTRAG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(159,690,'Finanzaufwand','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(160,6900,'Finanzaufwand','A','E','',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(161,6940,'Bankspesen','A','E','',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(162,6942,'Kursverluste','A','E','',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(163,6943,'Rundungsaufwand','A','E','',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(164,695,'Finanzertrag','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(165,6950,'Finanzertrag','A','I','',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(166,6952,'Kursgewinne','A','I','',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(167,6953,'Rundungsertrag','A','I','',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(168,6970,'Mitgliederbeiträge','A','I','AR_amount:IC_income',NULL,1,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(169,6980,'Spenden','A','I','AR_amount:IC_income',NULL,1,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL),(170,7,'BETRIEBLICHER NEBENERFOLG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(171,70,'ERFOLG AUS NEBENBETRIEBEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(172,75,'ERFOLG AUS BETRIEBLICHEN LIEGENSCHAFTEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(173,8,'BETRIEBSFREMDER, AUSSERORDENTLICHER, EINMALIGER UND PERIODENFREMDER AUFWAND UND ERTRAG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(174,80,'BETRIEBSFREMDER AUFWAND UND BETRIEBSFREMDER ERTRAG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(175,8000,'Betriebsfremder Aufwand','A','E','AP_amount:IC_cogs',NULL,4,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(176,8100,'Betriebsfremder Ertrag','A','I','AR_amount:IC_sale',NULL,2,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(177,85,'AUSSERORDENTLICHER, EINMALIGER AUFWAND UND ERTRAG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(178,8500,'Ausserordentlicher Aufwand','A','E','AP_amount:IC_cogs',NULL,4,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(179,8510,'Ausserordentlicher Ertrag','A','I','AR_amount:IC_sale',NULL,2,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(180,87,'PERIODENFREMDER AUFWAND UND ERTRAG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(181,8700,'Periodenfremder Aufwand','A','E','AP_amount:IC_cogs',NULL,4,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(182,8710,'Periodenfremder Ertrag','A','I','AR_amount:IC_sale',NULL,2,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(183,89,'DIREKTE STEUERN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(184,8900,'Direkte Steuern','A','E','',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(185,9,'ABSCHLUSS','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(186,90,'ERFOLGSRECHNUNG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(187,91,'BILANZ','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(188,9100,'Eröffnungsbilanz','A','E','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(189,92,'GEWINNVERWENDUNG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(190,95,'JAHRESERGEBNISSE','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(191,99,'HILFSKONTEN NEBENBÜCHER','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL); +INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik, valid_from) VALUES +('1', 'AKTIVEN','H','','','1',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('10', 'UMLAUFSVERMÖGEN','H','','','10',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('100', 'Flüssige Mittel','H','','','100',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1000', 'Kasse','A','A','AR_paid:AP_paid','1000',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1020', 'Postfinance oder Bank1','A','A','AR_paid:AP_paid','1020',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1021', 'Bank2','A','A','AR_paid:AP_paid','1021',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('106', 'Kurzfristig gehaltene Aktiven mit Börsenkurs','H','','','106',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('110', 'Forderungen aus Lieferungen und Leistungen','H','','','110',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1100', 'Forderungen aus Lieferungen und Leistungen','A','A','AR','1100',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('114', 'Übrige kurzfristige Forderungen','H','','','114',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1140', 'Vorschüsse, kurzfristige Darlehen','A','A','AR','1140',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1170', 'Vorsteuer auf Aufwand','A','A','','1170',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1171', 'Vorsteuer auf Investitionen','A','A','','1171',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1176', 'Verrechnungssteuer','A','A','','1176',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('120', 'Vorräte und nicht fakturierte Dienstleistungen','H','','','120',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1200', 'Handelswaren','A','A','IC','1200',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1210', 'Rohstoffe','A','A','IC','1210',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1280', 'Nicht fakturierte Dienstleistungen','A','A','IC','1280',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1290', 'Angefangene Arbeiten','A','A','IC','1290',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('130', 'Aktive Rechnungsabgrenzungen','H','','','130',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1300', 'Aktive Rechnungsabgrenzungen','A','A','','1300',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('14', 'ANLAGEVERMÖGEN','H','','','14',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('140', 'Finanzanlagen','H','','','140',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('148', 'Beteiligungen','H','','','148',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('150', 'Mobile Sachanlagen','H','','','150',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1500', 'Maschinen und Apparate','A','A','IC','1500',6,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1510', 'Mobiliar und Einrichtungen','A','A','IC','1510',6,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1520', 'Büromaschinen, Informatik','A','A','IC','1520',6,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1530', 'Fahrzeuge','A','A','IC','1530',6,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1540', 'Werkzeuge und Geräte','A','A','IC','1540',6,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('160', 'Immobile Sachanlagen','H','','','160',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('170', 'Immaterielle Werte','H','','','170',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('180', 'Nicht einbezahltes Grund- Gesellschafter- oder Stiftungskapital','H','','','180',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2', 'PASSIVEN','H','','','2',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('20', 'KURZFRISTIGES FREMDKAPITAL','H','','','20',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('200', 'Verbindlichkeiten aus Lieferungen und Leistungen','H','','','200',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2000', 'Verbindlichkeiten aus Lieferungen und Leistungen','A','L','AP','2000',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2001', 'Übrige Kreditoren','A','L','AP','2001',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2030', 'Anzahlungen von Kundinnen und Kunden','A','L','AR_paid:AP_paid','2030',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('210', 'Kurzfristige verzinsliche Verbindlichkeiten','H','','','210',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2100', 'Bankverbindlichkeiten','A','L','AR_paid:AP_paid','2100',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2140', 'Übrige verzinsliche Verbindlichkeiten','A','L','AP','2140',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('220', 'Übrige kurzfristige Verbindlichkeiten','H','','','220',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2200', 'Geschuldete MWST(8%)','A','L','AR_tax:IC_taxpart:IC_taxservice:CT_tax','2200',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2201', 'Geschuldete MWST(2.5%)','A','L','AR_tax:IC_taxpart:IC_taxservice:CT_tax','2201',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2206', 'Verrechnungssteuer','A','L','AP','2206',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2210', 'Geschuldete Steuern','A','L','AP','2210',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2250', 'Personalaufwand','A','L','AP','2250',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2270', 'Verbindlichkeiten Sozialversicherungen und Vorsorgeeinrichtungen','A','L','AP','2270',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('230', 'Passive Rechnungsabgrenzungen und kurzfristige Rückstellungen','H','','','230',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2300', 'Passive Rechnungsabgrenzungen','A','L','','2300',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2330', 'Kurzfristige Rückstellungen','A','L','','2330',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('24', 'LANGFRISTIGES FREMDKAPITAL','H','','','24',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('240', 'Langfristige verzinsliche Verbindlichkeiten','H','','','240',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2400', 'Bankverbindlichkeiten','A','L','','2400',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2450', 'Langfristige verzinsliche Darlehen','A','L','','2450',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('250', 'Übrige langfristige Verbindlichkeiten','H','','','250',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2500', 'Zinslose Darlehen','A','L','','2500',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('260', 'Rückstellungen sowie vom Gesetz vorgesehene ähnliche Positionen','H','','','260',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('28', 'EIGENKAPITAL','H','','','28',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('280', 'Grund-, Gesellschafter- oder Stiftungskapital','H','','','280',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2800', 'Stammkapital','A','Q','','2800',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('290', 'Reserven, Jahresgewinn oder Jahresverlust','H','','','290',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2900', 'Gesetzliche Kapitalreserve','A','Q','','2900',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2950', 'Gesetzliche Gewinnreserve','A','Q','','2950',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2960', 'Freiwillige Gewinnreserve','A','Q','','2960',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2970', 'Gewinn- oder Verlustvortrag','A','Q','','2970',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2979', 'Jahresgewinn oder -verlust','A','Q','','2979',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2980', 'Eigene Kapitalanteile','A','Q','','2980',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('3', 'BETRIEBLICHER ERTRAG AUS LIEFERUNGEN UND LEISTUNGEN','H','','','3',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('30', 'PRODUKTIONSERLÖSE','H','','','30',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('3000', 'Produktionserlöse','A','I','AR_amount:IC_sale','3000',2,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('32', 'HANDELSERLÖSE','H','','','32',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('3200', 'Handelserlöse 8%','A','I','AR_amount:IC_sale','3200',2,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('3201', 'Handelserlöse 2.5%','A','I','AR_amount:IC_sale','3201',3,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('34', 'DIENSTLEISTUNGSERLÖSE','H','','','34',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('3400', 'Dienstleistungserlöse','A','I','AR_amount:IC_income','3400',2,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('36', 'ÜBRIGE ERLÖSE AUS LIEFERUNGEN UND LEISTUNGEN','H','','','36',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('3600', 'Übrige Erlöse aus Lieferungen und Leistungen','A','I','IC_sale:IC_income','3600',2,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('37', 'EIGENLEISTUNGEN UND EIGENVERBRAUCH','H','','','37',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('3700', 'Eigenleistungen','A','I','','3700',2,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('38', 'ERLÖSMINDERUNGEN','H','','','38',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('3800', 'Skonti','A','E','AR_paid','3800',2,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('3801', 'Rabatte, Preisnachlässe','A','E','AR_paid','3801',2,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('3805', 'Verluste aus Forderungen','A','E','AR_paid','3805',2,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('3809', 'MWST - nur Saldosteuersatz','A','E','AR_paid','3809',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('39', 'BESTANDESÄNDERUNGEN AN UNFERTIGEN UND FERTIGEN ERZEUGNISSEN SOWIE AN NICHT FAKTURIERTEN DIENSTLEISTUNGEN','H','','','39',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('3900', 'Bestandesänderungen','A','I','','3900',2,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('4', 'AUFWAND FÜR MATERIAL, HANDELSWAREN, DIENSTLEISTUNGEN UND ENERGIE','H','','','4',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('40', 'MATERIALAUFWAND','H','','','40',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('4000', 'Materialeinkauf','A','E','AP_amount:IC_cogs','4000',4,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('42', 'HANDELSWARENAUFWAND','H','','','42',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('4200', 'Einkauf Handelswaren 8%','A','E','AP_amount:IC_cogs','4200',4,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('4201', 'Einkauf Handelswaren 2.5%','A','E','AP_amount:IC_cogs','4201',5,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('4208', 'Bestandsänderungen Handelswaren','A','E','AP_amount:IC_cogs','4208',4,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('44', 'AUFWAND FÜR BEZOGENE DRITTLEISTUNGEN','H','','','44',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('4400', 'Aufwand für Drittleistungen','A','E','AP_amount:IC_expense','4400',4,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('45', 'ENERGIEAUFWAND ZUR LEISTUNGSERSTELLUNG','H','','','45',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('4500', 'Energieaufwand zur Leistungserstellung','A','E','AP_amount:IC_expense','4500',4,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('46', 'ÜBRIGER AUFWAND FÜR MATERIAL, HANDELSWAREN UND DIENSTLEISTUNGEN','H','','','46',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('47', 'DIREKTE EINKAUFSSPESEN','H','','','47',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('4700', 'Einkaufsspesen','A','E','AP_amount:IC_expense','4700',4,NULL,NULL,NULL,6, FALSE,'2011-01-01 00:00:00.000000'), +('48', 'BESTANDESÄNDERUNGEN UND MATERIAL-/WARENVERLUSTE','H','','','48',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('4800', 'Bestandesänderungen','A','E','','4800',4,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('49', 'EINKAUFSPREISMINDERUNGEN','H','','','49',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('4900', 'Skonti, Rabatte, Preisnachlässe','A','I','AP_paid','4900',4,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5', 'PERSONALAUFWAND','H','','','5',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('500', 'Löhne und Gehälter','H','','','500',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('5000', 'Löhne und Gehälter','A','E','IC_expense','5000',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5001', 'Erfolgsbeteiligungen','A','E','IC_expense','5001',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5005', 'Leistungen von Sozialversicherungen','A','I','IC_income','5005',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('57', 'SOZIALVERSICHERUNGSAUFWAND','H','','','57',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('5700', 'AHV, IV, EO, ALV','A','E','AP_amount:IC_expense','5700',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5710', 'FAK','A','E','AP_amount:IC_expense','5710',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5720', 'Berufliche Vorsorge','A','E','AP_amount:IC_expense','5720',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5730', 'Unfallversicherung','A','E','AP_amount:IC_expense','5730',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5740', 'Krankentaggeldversicherung','A','E','AP_amount:IC_expense','5740',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5790', 'Quellensteuer','A','E','AP_amount:IC_expense','5790',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('58', 'ÜBRIGER PERSONALAUFWAND','H','','','58',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('5800', 'Aufwand für Personaleinstellung','A','E','IC_expense','5800',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5810', 'Weiterbildungskosten','A','E','IC_expense','5810',1,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5830', 'Spesen','A','E','IC_expense','5830',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5880', 'Sonstiger Personalaufwand','A','E','IC_expense','5880',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('59', 'LEISTUNGEN DRITTER','H','','','59',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6', 'ÜBRIGER BETRIEBLICHER AUFWAND, ABSCHREIBUNGEN UND WERTBERICHTIGUNGEN SOWIE FINANZERGEBNIS','H','','','6',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('60', 'RAUMAUFWAND','H','','','60',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6000', 'Miete','A','E','AP_amount:IC_expense','6000',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6040', 'Reinigung','A','E','AP_amount:IC_expense','6040',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6050', 'Übriger Raumaufwand','A','E','AP_amount:IC_expense','6050',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('61', 'UNTERHALT, REPARATUREN, ERSATZ, LEASING, MOBILE SACHANLAGEN','H','','','61',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6100', 'Unterhalt','A','E','AP_amount:IC_expense','6100',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('62', 'FAHRZEUG- UND TRANSPORTAUFWAND','H','','','62',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6200', 'Fahrzeugaufwand','A','E','AP_amount:IC_expense','6200',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6201', 'Transportaufwand','A','E','AP_amount:IC_expense','6201',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('63', 'SACHVERSICHERUNGEN, ABGABEN, GEBÜHREN, BEWILLIGUNGEN','H','','','63',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6300', 'Betriebsversicherungen','A','E','AP_amount:IC_expense','6300',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6360', 'Abgaben, Gebühren und Bewilligungen','A','E','AP_amount:IC_expense','6360',1,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('64', 'ENERGIE- UND ENTSORGUNGSAUFWAND','H','','','64',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6400', 'Strom, Gas, Wasser','A','E','AP_amount:IC_expense','6400',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6460', 'Entsorgungsaufwand','A','E','AP_amount:IC_expense','6460',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('65', 'VERWALTUNGS- UND INFORMATIKAUFWAND','H','','','65',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6500', 'Büromaterial, Drucksachen','A','E','AP_amount:IC_expense','6500',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6503', 'Fachliteratur','A','E','AP_amount:IC_expense','6503',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6510', 'Telefon, Fax, Porti Internet','A','E','AP_amount:IC_expense','6510',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6520', 'Beiträge, Spenden','A','E','AP_amount:IC_expense','6520',1,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6530', 'Buchführungs- und Beratungsaufwand','A','E','AP_amount:IC_expense','6530',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6540', 'Verwaltungsrat, GV, Revision','A','E','AP_amount:IC_expense','6540',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6570', 'Informatikaufwand','A','E','AP_amount:IC_expense','6570',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6590', 'Übriger Verwaltungsaufwand','A','E','AP_amount:IC_expense','6590',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('66', 'WERBEAUFWAND','H','','','66',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6600', 'Werbeaufwand','A','E','AP_amount:IC_expense','6600',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('67', 'SONSTIGER BETRIEBLICHER AUFWAND','H','','','67',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6720', 'Forschung und Entwicklung','A','E','AP_amount:IC_expense','6720',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6790', 'Übriger Betriebsaufwand','A','E','AP_amount:IC_expense','6790',6,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('68', 'ABSCHREIBUNGEN UND WERTBERICHTIGUNGEN AUF POSITIONEN DES ANLAGEVERMÖGENS','H','','','68',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6800', 'Abschreibungen Finanzanlagen','A','E','','6800',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6810', 'Abschreibungen Beteiligungen','A','E','','6810',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6820', 'Abschreibungen mobile Sachanlagen','A','E','','6820',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6840', 'Abschreibungen immaterielle Anlagen','A','E','','6840',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('69', 'FINANZAUFWAND UND FINANZERTRAG','H','','','69',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('690', 'Finanzaufwand','H','','','690',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6900', 'Finanzaufwand','A','E','','6900',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6940', 'Bankspesen','A','E','','6940',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6942', 'Kursverluste','A','E','','6942',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6943', 'Rundungsaufwand','A','E','','6943',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('695', 'Finanzertrag','H','','','695',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6950', 'Finanzertrag','A','I','','6950',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('6952', 'Kursgewinne','A','I','','6952',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('6953', 'Rundungsertrag','A','I','','6953',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('6970', 'Mitgliederbeiträge','A','I','AR_amount:IC_income','6970',1,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('6980', 'Spenden','A','I','AR_amount:IC_income','6980',1,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('7', 'BETRIEBLICHER NEBENERFOLG','H','','','7',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('70', 'ERFOLG AUS NEBENBETRIEBEN','H','','','70',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('75', 'ERFOLG AUS BETRIEBLICHEN LIEGENSCHAFTEN','H','','','75',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('8', 'BETRIEBSFREMDER, AUSSERORDENTLICHER, EINMALIGER UND PERIODENFREMDER AUFWAND UND ERTRAG','H','','','8',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('80', 'BETRIEBSFREMDER AUFWAND UND BETRIEBSFREMDER ERTRAG','H','','','80',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('8000', 'Betriebsfremder Aufwand','A','E','AP_amount:IC_cogs:IC_expense','8000',4,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('8100', 'Betriebsfremder Ertrag','A','I','AR_amount:IC_sale:IC_income','8100',2,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('85', 'AUSSERORDENTLICHER, EINMALIGER AUFWAND UND ERTRAG','H','','','85',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('8500', 'Ausserordentlicher Aufwand','A','E','AP_amount:IC_cogs:IC_expense','8500',4,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('8510', 'Ausserordentlicher Ertrag','A','I','AR_amount:IC_sale:IC_income','8510',2,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('87', 'PERIODENFREMDER AUFWAND UND ERTRAG','H','','','87',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('8700', 'Periodenfremder Aufwand','A','E','AP_amount:IC_cogs:IC_expense','8700',4,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('8710', 'Periodenfremder Ertrag','A','I','AR_amount:IC_sale:IC_income','8710',2,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('89', 'DIREKTE STEUERN','H','','','89',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('8900', 'Direkte Steuern','A','E','','8900',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('9', 'ABSCHLUSS','H','','','9',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('90', 'ERFOLGSRECHNUNG','H','','','90',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('91', 'BILANZ','H','','','91',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('9100', 'Eröffnungsbilanz','A','E','','9100',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('92', 'GEWINNVERWENDUNG','H','','','92',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('95', 'JAHRESERGEBNISSE','H','','','95',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('99', 'HILFSKONTEN NEBENBÜCHER','H','','','99',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'); -DELETE FROM defaults; +DELETE FROM buchungsgruppen; -INSERT INTO defaults (inventory_accno_id, income_accno_id, expense_accno_id, fxgain_accno_id, fxloss_accno_id, invnumber, sonumber, weightunit, businessnumber, version, curr, closedto, revtrans, ponumber, sqnumber, rfqnumber, customernumber, vendornumber, audittrail, articlenumber, servicenumber, coa, itime, mtime, rmanumber, cnnumber, accounting_method, inventory_system, profit_determination) VALUES -(16,72,90,166,162,0,0,'kg','','3.1.0 CH','CHF:EUR',NULL,'f',0,0,0,0,0,'f',0,0,'Switzerland-deutsch-MWST','2014-01-01 00:00:00.000000',NULL,0,0,'accrual','periodic','balance'); +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 8%',(SELECT id FROM chart WHERE accno = '1200'), + (SELECT id FROM chart WHERE accno = '3200'), (SELECT id FROM chart WHERE accno = '4200'), + (SELECT id FROM chart WHERE accno = '3200'), (SELECT id FROM chart WHERE accno = '4200'), + (SELECT id FROM chart WHERE accno = '3200'), (SELECT id FROM chart WHERE accno = '4200'), + (SELECT id FROM chart WHERE accno = '3200'), (SELECT id FROM chart WHERE accno = '4200') +),( + 'Standard 2.5%',(SELECT id FROM chart WHERE accno = '1200'), + (SELECT id FROM chart WHERE accno = '3201'), (SELECT id FROM chart WHERE accno = '4201'), + (SELECT id FROM chart WHERE accno = '3201'), (SELECT id FROM chart WHERE accno = '4201'), + (SELECT id FROM chart WHERE accno = '3201'), (SELECT id FROM chart WHERE accno = '4201'), + (SELECT id FROM chart WHERE accno = '3201'), (SELECT id FROM chart WHERE accno = '4201') +); -DELETE FROM tax; +DELETE FROM tax_zones; -INSERT INTO tax (rate, taxkey, taxdescription, itime, mtime, id) VALUES -(0,0,'Keine Steuer','2014-01-01 00:00:00.000000',NULL,0), -(0,1,'mehrwertsteuerfrei','2014-01-01 00:00:00.000000',NULL,1); +INSERT INTO tax_zones (id, description) VALUES +(0, 'Schweiz'), -- siehe auch Pg-upgrade2/taxzone_id_in_oe_delivery_orders.sql )=: +(1, 'EU mit USt-ID Nummer'), +(2, 'EU ohne USt-ID Nummer'), +(3, 'Ausserhalb EU'); -INSERT INTO tax (chart_id, rate, taxnumber, taxkey, taxdescription, itime, mtime, id) VALUES -(45,0.08000,2201,2,'MWST 8% Verkauf','2014-01-01 00:00:00.000000',NULL,2), -(44,0.02500,2200,3,'MWST 2.5% Verkauf','2014-01-01 00:00:00.000000',NULL,3), -(12,0.08000,1170,4,'MWST 8% Aufwand','2014-01-01 00:00:00.000000',NULL,4), -(12,0.02500,1170,5,'MWST 2.5% Aufwand','2014-01-01 00:00:00.000000',NULL,5), -(13,0.08000,1171,6,'MWST 8% Investitionen','2014-01-01 00:00:00.000000',NULL,6), -(13,0.02500,1171,7,'MWST 2.5% Investitionen','2014-01-01 00:00:00.000000',NULL,7); +DELETE FROM tax; -DELETE FROM tax_zones; +INSERT INTO tax (taxkey, taxdescription, rate) VALUES +(0, 'Keine Steuer', 0), +(1, 'Mehrwertsteuerfrei', 0); -INSERT INTO tax_zones (id, description) VALUES -(0,'Schweiz'), -(1,'EU mit USt-ID Nummer'), -(2,'EU ohne USt-ID Nummer'), -(3,'Ausserhalb EU'); +INSERT INTO tax (taxkey, taxdescription, rate, taxnumber, chart_id) VALUES +(2, 'MWST 8% Ertrag', 0.08000, '2200', (SELECT id FROM chart WHERE accno='2200')), +(3, 'MWST 2.5% Ertrag', 0.02500, '2201', (SELECT id FROM chart WHERE accno='2201')), +(4, 'MWST 8% Aufwand', 0.08000, '1170', (SELECT id FROM chart WHERE accno='1170')), +(5, 'MWST 2.5% Aufwand', 0.02500, '1170', (SELECT id FROM chart WHERE accno='1170')), +(6, 'MWST 8% Investitionen', 0.08000, '1171', (SELECT id FROM chart WHERE accno='1171')), +(7, 'MWST 2.5% Investitionen', 0.02500, '1171', (SELECT id FROM chart WHERE accno='1171')); DELETE FROM taxkeys; -INSERT INTO taxkeys (id, chart_id, tax_id, taxkey_id, pos_ustva, startdate) VALUES -(0,0,0,0,NULL,'2014-01-01'), -(1,1,0,0,NULL,'2014-01-01'), -(2,2,0,0,NULL,'2014-01-01'), -(3,3,0,0,NULL,'2014-01-01'), -(4,4,0,0,NULL,'2014-01-01'), -(5,5,0,0,NULL,'2014-01-01'), -(6,6,0,0,NULL,'2014-01-01'), -(7,7,0,0,NULL,'2014-01-01'), -(8,8,0,0,NULL,'2014-01-01'), -(9,9,0,0,NULL,'2014-01-01'), -(10,10,0,0,NULL,'2014-01-01'), -(11,11,0,0,NULL,'2014-01-01'), -(12,12,0,0,NULL,'2014-01-01'), -(13,13,0,0,NULL,'2014-01-01'), -(14,14,0,0,NULL,'2014-01-01'), -(15,15,0,0,NULL,'2014-01-01'), -(16,16,0,0,NULL,'2014-01-01'), -(17,17,0,0,NULL,'2014-01-01'), -(18,18,0,0,NULL,'2014-01-01'), -(19,19,0,0,NULL,'2014-01-01'), -(20,20,0,0,NULL,'2014-01-01'), -(21,21,0,0,NULL,'2014-01-01'), -(22,22,0,0,NULL,'2014-01-01'), -(23,23,0,0,NULL,'2014-01-01'), -(24,24,0,0,NULL,'2014-01-01'), -(25,25,0,0,NULL,'2014-01-01'), -(26,26,0,0,NULL,'2014-01-01'), -(27,27,0,0,NULL,'2014-01-01'), -(28,28,0,0,NULL,'2014-01-01'), -(29,29,0,0,NULL,'2014-01-01'), -(30,30,0,0,NULL,'2014-01-01'), -(31,31,0,0,NULL,'2014-01-01'), -(32,32,0,0,NULL,'2014-01-01'), -(33,33,0,0,NULL,'2014-01-01'), -(34,34,0,0,NULL,'2014-01-01'), -(35,35,0,0,NULL,'2014-01-01'), -(36,36,0,0,NULL,'2014-01-01'), -(37,37,0,0,NULL,'2014-01-01'), -(38,38,0,0,NULL,'2014-01-01'), -(39,39,0,0,NULL,'2014-01-01'), -(40,40,0,0,NULL,'2014-01-01'), -(41,41,0,0,NULL,'2014-01-01'), -(42,42,0,0,NULL,'2014-01-01'), -(43,43,0,0,NULL,'2014-01-01'), -(44,44,0,0,NULL,'2014-01-01'), -(45,45,0,0,NULL,'2014-01-01'), -(46,46,0,0,NULL,'2014-01-01'), -(47,47,0,0,NULL,'2014-01-01'), -(48,48,0,0,NULL,'2014-01-01'), -(49,49,0,0,NULL,'2014-01-01'), -(50,50,0,0,NULL,'2014-01-01'), -(51,51,0,0,NULL,'2014-01-01'), -(52,52,0,0,NULL,'2014-01-01'), -(53,53,0,0,NULL,'2014-01-01'), -(54,54,0,0,NULL,'2014-01-01'), -(55,55,0,0,NULL,'2014-01-01'), -(56,56,0,0,NULL,'2014-01-01'), -(57,57,0,0,NULL,'2014-01-01'), -(58,58,0,0,NULL,'2014-01-01'), -(59,59,0,0,NULL,'2014-01-01'), -(60,60,0,0,NULL,'2014-01-01'), -(61,61,0,0,NULL,'2014-01-01'), -(62,62,0,0,NULL,'2014-01-01'), -(63,63,0,0,NULL,'2014-01-01'), -(64,64,0,0,NULL,'2014-01-01'), -(65,65,0,0,NULL,'2014-01-01'), -(66,66,0,0,NULL,'2014-01-01'), -(67,67,0,0,NULL,'2014-01-01'), -(68,68,0,0,NULL,'2014-01-01'), -(69,69,0,0,NULL,'2014-01-01'), -(70,70,0,0,NULL,'2014-01-01'), -(71,71,0,0,NULL,'2014-01-01'), -(72,72,0,0,NULL,'2014-01-01'), -(73,73,0,0,NULL,'2014-01-01'), -(74,74,0,0,NULL,'2014-01-01'), -(75,75,0,0,NULL,'2014-01-01'), -(76,76,0,0,NULL,'2014-01-01'), -(77,77,0,0,NULL,'2014-01-01'), -(78,78,0,0,NULL,'2014-01-01'), -(79,79,0,0,NULL,'2014-01-01'), -(80,80,0,0,NULL,'2014-01-01'), -(81,81,0,0,NULL,'2014-01-01'), -(82,82,0,0,NULL,'2014-01-01'), -(83,83,0,0,NULL,'2014-01-01'), -(84,84,0,0,NULL,'2014-01-01'), -(85,85,0,0,NULL,'2014-01-01'), -(86,86,0,0,NULL,'2014-01-01'), -(87,87,0,0,NULL,'2014-01-01'), -(88,88,0,0,NULL,'2014-01-01'), -(89,89,0,0,NULL,'2014-01-01'), -(90,90,0,0,NULL,'2014-01-01'), -(91,91,0,0,NULL,'2014-01-01'), -(92,92,0,0,NULL,'2014-01-01'), -(93,93,0,0,NULL,'2014-01-01'), -(94,94,0,0,NULL,'2014-01-01'), -(95,95,0,0,NULL,'2014-01-01'), -(96,96,0,0,NULL,'2014-01-01'), -(97,97,0,0,NULL,'2014-01-01'), -(98,98,0,0,NULL,'2014-01-01'), -(99,99,0,0,NULL,'2014-01-01'), -(100,100,0,0,NULL,'2014-01-01'), -(101,101,0,0,NULL,'2014-01-01'), -(102,102,0,0,NULL,'2014-01-01'), -(103,103,0,0,NULL,'2014-01-01'), -(104,104,0,0,NULL,'2014-01-01'), -(105,105,0,0,NULL,'2014-01-01'), -(106,106,0,0,NULL,'2014-01-01'), -(107,107,0,0,NULL,'2014-01-01'), -(108,108,0,0,NULL,'2014-01-01'), -(109,109,0,0,NULL,'2014-01-01'), -(110,110,0,0,NULL,'2014-01-01'), -(111,111,0,0,NULL,'2014-01-01'), -(112,112,0,0,NULL,'2014-01-01'), -(113,113,0,0,NULL,'2014-01-01'), -(114,114,0,0,NULL,'2014-01-01'), -(115,115,0,0,NULL,'2014-01-01'), -(116,116,0,0,NULL,'2014-01-01'), -(117,117,0,0,NULL,'2014-01-01'), -(118,118,0,0,NULL,'2014-01-01'), -(119,119,0,0,NULL,'2014-01-01'), -(120,120,0,0,NULL,'2014-01-01'), -(121,121,0,0,NULL,'2014-01-01'), -(122,122,0,0,NULL,'2014-01-01'), -(123,123,0,0,NULL,'2014-01-01'), -(124,124,0,0,NULL,'2014-01-01'), -(125,125,0,0,NULL,'2014-01-01'), -(126,126,0,0,NULL,'2014-01-01'), -(127,127,0,0,NULL,'2014-01-01'), -(128,128,0,0,NULL,'2014-01-01'), -(129,129,0,0,NULL,'2014-01-01'), -(130,130,0,0,NULL,'2014-01-01'), -(131,131,0,0,NULL,'2014-01-01'), -(132,132,0,0,NULL,'2014-01-01'), -(133,133,0,0,NULL,'2014-01-01'), -(134,134,0,0,NULL,'2014-01-01'), -(135,135,0,0,NULL,'2014-01-01'), -(136,136,0,0,NULL,'2014-01-01'), -(137,137,0,0,NULL,'2014-01-01'), -(138,138,0,0,NULL,'2014-01-01'), -(139,139,0,0,NULL,'2014-01-01'), -(140,140,0,0,NULL,'2014-01-01'), -(141,141,0,0,NULL,'2014-01-01'), -(142,142,0,0,NULL,'2014-01-01'), -(143,143,0,0,NULL,'2014-01-01'), -(144,144,0,0,NULL,'2014-01-01'), -(145,145,0,0,NULL,'2014-01-01'), -(146,146,0,0,NULL,'2014-01-01'), -(147,147,0,0,NULL,'2014-01-01'), -(148,148,0,0,NULL,'2014-01-01'), -(149,149,0,0,NULL,'2014-01-01'), -(150,150,0,0,NULL,'2014-01-01'), -(151,151,0,0,NULL,'2014-01-01'), -(152,152,0,0,NULL,'2014-01-01'), -(153,153,0,0,NULL,'2014-01-01'), -(154,154,0,0,NULL,'2014-01-01'), -(155,155,0,0,NULL,'2014-01-01'), -(156,156,0,0,NULL,'2014-01-01'), -(157,157,0,0,NULL,'2014-01-01'), -(158,158,0,0,NULL,'2014-01-01'), -(159,159,0,0,NULL,'2014-01-01'), -(160,160,0,0,NULL,'2014-01-01'), -(161,161,0,0,NULL,'2014-01-01'), -(162,162,0,0,NULL,'2014-01-01'), -(163,163,0,0,NULL,'2014-01-01'), -(164,164,0,0,NULL,'2014-01-01'), -(165,165,0,0,NULL,'2014-01-01'), -(166,166,0,0,NULL,'2014-01-01'), -(167,167,0,0,NULL,'2014-01-01'), -(168,168,0,0,NULL,'2014-01-01'), -(169,169,0,0,NULL,'2014-01-01'), -(170,170,0,0,NULL,'2014-01-01'), -(171,171,0,0,NULL,'2014-01-01'), -(172,172,0,0,NULL,'2014-01-01'), -(173,173,0,0,NULL,'2014-01-01'), -(174,174,0,0,NULL,'2014-01-01'), -(175,175,0,0,NULL,'2014-01-01'), -(176,176,0,0,NULL,'2014-01-01'), -(177,177,0,0,NULL,'2014-01-01'), -(178,178,0,0,NULL,'2014-01-01'), -(179,179,0,0,NULL,'2014-01-01'), -(180,180,0,0,NULL,'2014-01-01'), -(181,181,0,0,NULL,'2014-01-01'), -(182,182,0,0,NULL,'2014-01-01'), -(183,183,0,0,NULL,'2014-01-01'), -(184,184,0,0,NULL,'2014-01-01'), -(185,185,0,0,NULL,'2014-01-01'), -(186,186,0,0,NULL,'2014-01-01'), -(187,187,0,0,NULL,'2014-01-01'), -(188,188,0,0,NULL,'2014-01-01'), -(189,189,0,0,NULL,'2014-01-01'), -(190,190,0,0,NULL,'2014-01-01'), -(191,191,0,0,NULL,'2014-01-01'); +INSERT INTO taxkeys (taxkey_id, tax_id, chart_id, startdate) SELECT 0, (SELECT tax.id FROM tax WHERE taxkey=0), chart.id, '2011-01-01' FROM chart WHERE taxkey_id=0; +INSERT INTO taxkeys (taxkey_id, tax_id, chart_id, startdate) SELECT 1, (SELECT tax.id FROM tax WHERE taxkey=1), chart.id, '2011-01-01' FROM chart WHERE taxkey_id=1; +INSERT INTO taxkeys (taxkey_id, tax_id, chart_id, startdate) SELECT 2, (SELECT tax.id FROM tax WHERE taxkey=2), chart.id, '2011-01-01' FROM chart WHERE taxkey_id=2; +INSERT INTO taxkeys (taxkey_id, tax_id, chart_id, startdate) SELECT 3, (SELECT tax.id FROM tax WHERE taxkey=3), chart.id, '2011-01-01' FROM chart WHERE taxkey_id=3; +INSERT INTO taxkeys (taxkey_id, tax_id, chart_id, startdate) SELECT 4, (SELECT tax.id FROM tax WHERE taxkey=4), chart.id, '2011-01-01' FROM chart WHERE taxkey_id=4; +INSERT INTO taxkeys (taxkey_id, tax_id, chart_id, startdate) SELECT 5, (SELECT tax.id FROM tax WHERE taxkey=5), chart.id, '2011-01-01' FROM chart WHERE taxkey_id=5; +INSERT INTO taxkeys (taxkey_id, tax_id, chart_id, startdate) SELECT 6, (SELECT tax.id FROM tax WHERE taxkey=6), chart.id, '2011-01-01' FROM chart WHERE taxkey_id=6; +INSERT INTO taxkeys (taxkey_id, tax_id, chart_id, startdate) SELECT 7, (SELECT tax.id FROM tax WHERE taxkey=7), chart.id, '2011-01-01' FROM chart WHERE taxkey_id=7; + DELETE FROM units; INSERT INTO units (name, base_unit, factor, type) VALUES -('Stck',NULL,0.00000,'dimension'), -('mg',NULL,0.00000,'dimension'), -('g','mg',1000.00000,'dimension'), -('kg','g',1000.00000,'dimension'), -('t','kg',1000.00000,'dimension'), -('ml',NULL,0.00000,'dimension'), -('L','ml',1000.00000,'dimension'), -('pauschal',NULL,0.00000,'service'), -('Min',NULL,0.00000,'service'), -('Std','Min',60.00000,'service'), -('Tag','Std',8.00000,'service'), -('Wo',NULL,0.00000,'service'), -('Mt','Wo',4.00000,'service'), -('Jahr','Mt',12.00000,'service'); +('Stck', NULL, 0.00000, 'dimension'), +('mg', NULL, 0.00000, 'dimension'), +('g', 'mg', 1000.00000, 'dimension'), +('kg', 'g', 1000.00000, 'dimension'), +('t', 'kg', 1000.00000, 'dimension'), +('ml', NULL, 0.00000, 'dimension'), +('L', 'ml', 1000.00000, 'dimension'), +('pauschal', NULL, 0.00000, 'service'), +('Min', NULL, 0.00000, 'service'), +('Std', 'Min', 60.00000, 'service'), +('Tag', 'Std', 8.00000, 'service'), +('Wo', NULL, 0.00000, 'service'), +('Mt', 'Wo', 4.00000, 'service'), +('Jahr', 'Mt', 12.00000, 'service'); + + +DELETE FROM defaults; +INSERT INTO defaults ( + inventory_accno_id, + income_accno_id, expense_accno_id, + fxgain_accno_id, fxloss_accno_id, + invnumber, sonumber, + weightunit, + businessnumber, + version, + closedto, + revtrans, + ponumber, sqnumber, rfqnumber, + customernumber, vendornumber, + audittrail, + articlenumber, servicenumber, + rmanumber, cnnumber +) VALUES ( + (SELECT id FROM CHART WHERE accno='1200'), + (SELECT id FROM CHART WHERE accno='3200'), (SELECT id FROM CHART WHERE accno='4200'), + (SELECT id FROM CHART WHERE accno='6952'), (SELECT id FROM CHART WHERE accno='6942'), + 0, 0, + 'kg', + '', + '3.1.0 CH', + NULL, + FALSE, + 0, 0, 0, + 0, 0, + FALSE, + 0, 0, + 0, 0 +); diff --git a/sql/Switzerland-deutsch-keineMWST-chart.sql b/sql/Switzerland-deutsch-keineMWST-chart.sql deleted file mode 100644 index 4dd375183..000000000 --- a/sql/Switzerland-deutsch-keineMWST-chart.sql +++ /dev/null @@ -1,329 +0,0 @@ --- deutschsprachiger KMU-Kontenplan nach Sterchi für Firmen in der Schweiz, die nicht mehrwertsteuerpflichtig sind --- Erstellt am 24.7.2013 --- Redaktion: Andreas Rudin, http://www.revamp-it.ch - - - -INSERT INTO buchungsgruppen (id, 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 -(1,'Standard',13,50,67,50,67,50,67,50,67); - - -INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik, itime, mtime, new_chart_id, valid_from) VALUES -(1,1,'AKTIVEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(2,10,'UMLAUFSVERMÖGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(3,100,'Flüssige Mittel','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(4,1000,'Kasse','A','A','AR_paid:AP_paid',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(5,1010,'Post','A','A','AR_paid:AP_paid',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(6,1020,'Bank','A','A','AR_paid:AP_paid',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(7,110,'Forderungen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(8,1100,'Debitoren','A','A','AR',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(9,1170,'Vorsteuer auf Aufwand','A','A','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(10,1171,'Vorsteuer auf Investitionen','A','A','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(11,1176,'Guthaben aus Verrechnungssteuer','A','A','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(12,120,'Vorräte und angefangene Arbeiten','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(13,1200,'Warenvorräte','A','A','IC',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(14,1280,'Angefangene Arbeiten','A','A','IC',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(15,130,'Aktive Rechnungsabgrenzung','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(16,1300,'Aktive Rechnungsabgrenzung','A','A','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(17,14,'ANLAGEVERMÖGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(18,1450,'Mobiliar und Einrichtungen','A','A','IC',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(19,1460,'Büromaschinen, EDV','A','A','IC',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(20,180,'AKTIVIERTER AUFWAND UND AKTIVE BERICHTIGUNGSPOSTEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(21,1800,'Gründungsaufwand','A','A','IC_expense',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(22,1801,'Entwicklungsaufwand','A','A','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(23,2,'PASSIVEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(24,20,'FREMDKAPITAL KURZFRISTIG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(25,200,'Kurzfristige Verbindlichkeiten aus Lieferungen und Leistungen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(26,2000,'Lieferanten','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(27,210,'Kurzfristige Finanzverbindlichkeiten','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(28,2101,'Personalaufwand','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(29,2102,'Sozialversicherungen','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(30,2105,'Leasing','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(31,2110,'Gesellschafter','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(32,2111,'Privat','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(33,220,'Andere kurzfristige Verbindlichkeiten','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(34,2200,'MWST(2,5)','A','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(35,2201,'MWST(8,0)','A','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(36,2210,'Geschuldete Steuern','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(37,230,'Passive Rechnungsabgrenzung, kurzfristige Rückstellungen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(38,2300,'Passive Rechnungsabgrenzung','A','L','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(39,2330,'Rückstellungen','A','L','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(40,24,'FREMDKAPITAL LANGFRISTIG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(41,2400,'Gesellschafter','A','L','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(42,28,'EIGENKAPITAL','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(43,2800,'Stammkapital','A','Q','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(44,290,'Reserven, Bilanzgewinn','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(45,2900,'Reserven','A','Q','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(46,2990,'Gewinnvortrag','A','Q','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(47,2991,'Jahresgewinn','A','Q','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(48,3,'BETRIEBSERTRAG AUS LIEFERUNGEN UND LEISTUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(49,30,'PRODUKTIONSERTRAG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(50,3000,'Ertrag Produktion','A','I','AR_amount:IC_sale',NULL,0,NULL,NULL,NULL,1,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(51,32,'HANDELSERTRAG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(52,3200,'Ertrag Handel','A','I','AR_amount:IC_sale',NULL,0,NULL,NULL,NULL,1,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(53,34,'DIENSTLEISTUNGSERTRAG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(54,3400,'Ertrag Dienstleistung','A','I','AR_amount:IC_income',NULL,0,NULL,NULL,NULL,1,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(55,36,'ÜBRIGER ERTRAG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(56,3600,'diverser Ertrag','A','I','IC_income',NULL,0,NULL,NULL,NULL,2,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(57,37,'EIGENLEISTUNGEN UND EIGENVERBRAUCH','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(58,3700,'Eigenleistungen','A','I','',NULL,0,NULL,NULL,NULL,2,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(59,38,'BESTANDESÄNDERUNGEN ANGEFANGENE UND FERTIGGESTELLTE ARBEITEN AUS PRODUKTION UND DIENSTLEISTUNG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(60,3800,'Bestandesänderungen','A','I','',NULL,0,NULL,NULL,NULL,2,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(61,39,'ERTRAGSMINDERUNGEN AUS PRODUKTIONS-, HANDELS- UND DIENSTLEISTUNGSERTRÄGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(62,3900,'Skonti','A','E','IC_sale:IC_cogs:IC_income:IC_expense',NULL,0,NULL,NULL,NULL,1,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(63,3901,'Rabatte, Preisnachlässe','A','E','IC_sale:IC_cogs:IC_income:IC_expense',NULL,0,NULL,NULL,NULL,1,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(64,3905,'Verluste aus Forderungen','A','E','IC_sale:IC_cogs:IC_income:IC_expense',NULL,0,NULL,NULL,NULL,1,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(65,4,'AUFWAND FÜR MATERIAL, WAREN UND DIENSTLEISTUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(66,40,'MATERIALAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(67,4000,'Materialeinkauf','A','E','AP_amount:IC_cogs',NULL,0,NULL,NULL,NULL,8,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(68,42,'HANDELSWARENAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(69,4200,'Einkauf Handelswaren','A','E','AP_amount:IC_cogs',NULL,0,NULL,NULL,NULL,8,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(70,4208,'Bestandsänderungen Handelswaren','A','E','AP_amount:IC_cogs',NULL,0,NULL,NULL,NULL,8,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(71,44,'AUFWAND FÜR DRITTLEISTUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(72,4400,'Aufwand für Drittleistungen','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,8,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(73,46,'ÜBRIGER AUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(74,47,'DIREKTE EINKAUFSSPESEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(75,4700,'Einkaufsspesen','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,8, 'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(76,48,'BESTANDESVERÄNDERUNGEN, MATERIAL- UND WARENVERLUSTE','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(77,4800,'Bestandesänderungen','A','E','',NULL,0,NULL,NULL,NULL,8,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(78,49,'AUFWANDMINDERUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(79,4900,'Skonti, Rabatte, Preisnachlässe','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,8,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(80,5,'PERSONALAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(81,5000,'Löhne und Gehälter','A','E','IC_expense',NULL,0,NULL,NULL,NULL,9,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(82,5001,'Erfolgsbeteiligungen','A','E','IC_expense',NULL,0,NULL,NULL,NULL,9,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(83,5005,'Leistungen von Sozialversicherung','A','I','IC_income',NULL,0,NULL,NULL,NULL,9,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(84,507,'SOZIALVERSICHERUNGSAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(85,5070,'AHV, IV, EO, ALV','A','E','AP_amount:IC_income:IC_expense',NULL,0,NULL,NULL,NULL,10,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(86,5071,'FAK','A','E','AP_amount:IC_income:IC_expense',NULL,0,NULL,NULL,NULL,10,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(87,5072,'Berufliche Vorsorge','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,10,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(88,5073,'Unfallversicherung','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,10,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(89,5074,'Krankentaggeldversicherung','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,10,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(90,508,'ÜBRIGER PERSONALAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(91,5083,'Spesen','A','E','IC_expense',NULL,0,NULL,NULL,NULL,9,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(92,5089,'Sonstiger Personalaufwand','A','E','IC_expense',NULL,0,NULL,NULL,NULL,9,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(93,509,'ARBEITSLEISTUNGEN DRITTER','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(94,6,'ÜBRIGER BETRIEBSAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(95,600,'RAUMAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(96,6000,'Miete','A','E','IC_expense',NULL,0,NULL,NULL,NULL,11,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(97,6040,'Reinigung','A','E','IC_expense',NULL,0,NULL,NULL,NULL,11,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(98,6050,'Übriger Raumaufwand','A','E','IC_expense',NULL,0,NULL,NULL,NULL,11,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(99,610,'UNTERHALT, REPARATUREN, ERSATZ, LEASINGAUFWAND MOBILE SACHANLAGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(100,6100,'Unterhalt','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,13,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(101,620,'FAHRZEUG- UND TRANSPORTAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(102,6200,'Fahrzeugaufwand','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,17,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(103,6201,'Transportaufwand','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,17,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(104,630,'SACHVERSICHERUNGEN, ABGABEN, GEBÜHREN, BEWILLIGUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(105,6300,'Betriebsversicherungen','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,14,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(106,650,'VERWALTUNGS- UND INFORMATIKAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(107,6500,'Büromaterial','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,23,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(108,6510,'Telefon, Fax, Internet','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,23,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(109,6520,'Porti','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,23,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(110,6530,'Fachliteratur','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,20,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(111,6540,'Informatikaufwand','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,23,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(112,6590,'Übriger Verwaltungsaufwand','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,24,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(113,660,'WERBEAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(114,6600,'Werbeaufwand','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,18,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(115,670,'ÜBRIGER BETRIEBSAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(116,6750,'Übriger Betriebsaufwand','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,24,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(117,680,'FINANZAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(118,6800,'Finanzaufwand','A','E','',NULL,0,NULL,NULL,NULL,29,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(119,685,'FINANZERTRAG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(120,6850,'Finanzertrag','A','I','',NULL,0,NULL,NULL,NULL,4,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(121,690,'ABSCHREIBUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(122,6900,'Abschreibungen','A','E','',NULL,0,NULL,NULL,NULL,25,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(123,8,'AUSSERORDENTLICHER UND BETRIEBSFREMDER ERFOLG, STEUERN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(124,8000,'Ausserordentlicher Ertrag','A','I','',NULL,0,NULL,NULL,NULL,5,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(125,8100,'Ausserordentlicher Aufwand','A','E','',NULL,0,NULL,NULL,NULL,30,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(126,89,'STEUERAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(127,8900,'Steuern','A','E','',NULL,0,NULL,NULL,NULL,31,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(128,9,'ABSCHLUSS','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(129,90,'ERFOLGSRECHNUNG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(130,92,'BILANZ','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(131,9200,'Eröffnungsbilanz','A','E','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(132,93,'GEWINNVERWENDUNG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(133,95,'JAHRESERGEBNISSE','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL), -(134,99,'SAMMEL- UND FEHLBUCHUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2013-01-01 00:00:00.000000',NULL,NULL,NULL); - - -DELETE FROM defaults; - -INSERT INTO defaults (inventory_accno_id, income_accno_id, expense_accno_id, fxgain_accno_id, fxloss_accno_id, invnumber, sonumber, weightunit, businessnumber, version, curr, closedto, revtrans, ponumber, sqnumber, rfqnumber, customernumber, vendornumber, audittrail, articlenumber, servicenumber, coa, itime, mtime, rmanumber, cnnumber, accounting_method, inventory_system, profit_determination) VALUES -(13,50,67,120,118,0,0,'kg','','3.0.0','CHF:EUR',NULL,'f',0,0,0,0,0,'f',0,0,'Switzerland-deutsch-keineMWST','2013-01-01 00:00:00.000000',NULL,0,0,'accrual','periodic','balance'); - -INSERT INTO tax (rate, taxkey, taxdescription, itime, mtime, id) VALUES -(0,0,'Keine Steuer','2013-01-01 00:00:00.000000',NULL,0), -(0,1,'mehrwertsteuerfrei','2013-01-01 00:00:00.000000',NULL,1); - -INSERT INTO tax (chart_id, rate, taxnumber, taxkey, taxdescription, itime, mtime, id) VALUES -(35,0.08000,2201,2,'MWST 8% Verkauf','2013-01-01 00:00:00.000000',NULL,2), -(34,0.02500,2200,3,'MWST 2.5% Verkauf','2013-01-01 00:00:00.000000',NULL,3), -(9,0.08000,1170,4,'MWST 8% Aufwand','2013-01-01 00:00:00.000000',NULL,4), -(9,0.02500,1170,5,'MWST 2.5% Aufwand','2013-01-01 00:00:00.000000',NULL,5), -(10,0.08000,1171,6,'MWST 8% Investitionen','2013-01-01 00:00:00.000000',NULL,6), -(10,0.02500,1171,7,'MWST 2.5% Investitionen','2013-01-01 00:00:00.000000',NULL,7); - - -DELETE FROM tax_zones; - -INSERT INTO tax_zones (id, description) VALUES -(0,'Inland'), -(1,'EU mit USt-ID Nummer'), -(2,'EU ohne USt-ID Nummer'), -(3,'Ausserhalb EU'); - - -INSERT INTO taxkeys (id, chart_id, tax_id, taxkey_id, pos_ustva, startdate) VALUES -(1,1,0,0,NULL,'2013-01-01'), -(2,2,0,0,NULL,'2013-01-01'), -(3,3,0,0,NULL,'2013-01-01'), -(4,4,0,0,NULL,'2013-01-01'), -(5,5,0,0,NULL,'2013-01-01'), -(6,6,0,0,NULL,'2013-01-01'), -(7,7,0,0,NULL,'2013-01-01'), -(8,8,0,0,NULL,'2013-01-01'), -(9,9,0,0,NULL,'2013-01-01'), -(10,10,0,0,NULL,'2013-01-01'), -(11,11,0,0,NULL,'2013-01-01'), -(12,12,0,0,NULL,'2013-01-01'), -(13,13,0,0,NULL,'2013-01-01'), -(14,14,0,0,NULL,'2013-01-01'), -(15,15,0,0,NULL,'2013-01-01'), -(16,16,0,0,NULL,'2013-01-01'), -(17,17,0,0,NULL,'2013-01-01'), -(18,18,0,0,NULL,'2013-01-01'), -(19,19,0,0,NULL,'2013-01-01'), -(20,20,0,0,NULL,'2013-01-01'), -(21,21,0,0,NULL,'2013-01-01'), -(22,22,0,0,NULL,'2013-01-01'), -(23,23,0,0,NULL,'2013-01-01'), -(24,24,0,0,NULL,'2013-01-01'), -(25,25,0,0,NULL,'2013-01-01'), -(26,26,0,0,NULL,'2013-01-01'), -(27,27,0,0,NULL,'2013-01-01'), -(28,28,0,0,NULL,'2013-01-01'), -(29,29,0,0,NULL,'2013-01-01'), -(30,30,0,0,NULL,'2013-01-01'), -(31,31,0,0,NULL,'2013-01-01'), -(32,32,0,0,NULL,'2013-01-01'), -(33,33,0,0,NULL,'2013-01-01'), -(34,34,0,0,NULL,'2013-01-01'), -(35,35,0,0,NULL,'2013-01-01'), -(36,36,0,0,NULL,'2013-01-01'), -(37,37,0,0,NULL,'2013-01-01'), -(38,38,0,0,NULL,'2013-01-01'), -(39,39,0,0,NULL,'2013-01-01'), -(40,40,0,0,NULL,'2013-01-01'), -(41,41,0,0,NULL,'2013-01-01'), -(42,42,0,0,NULL,'2013-01-01'), -(43,43,0,0,NULL,'2013-01-01'), -(44,44,0,0,NULL,'2013-01-01'), -(45,45,0,0,NULL,'2013-01-01'), -(46,46,0,0,NULL,'2013-01-01'), -(47,47,0,0,NULL,'2013-01-01'), -(48,48,0,0,NULL,'2013-01-01'), -(49,49,0,0,NULL,'2013-01-01'), -(50,50,0,0,NULL,'2013-01-01'), -(51,51,0,0,NULL,'2013-01-01'), -(52,52,0,0,NULL,'2013-01-01'), -(53,53,0,0,NULL,'2013-01-01'), -(54,54,0,0,NULL,'2013-01-01'), -(55,55,0,0,NULL,'2013-01-01'), -(56,56,0,0,NULL,'2013-01-01'), -(57,57,0,0,NULL,'2013-01-01'), -(58,58,0,0,NULL,'2013-01-01'), -(59,59,0,0,NULL,'2013-01-01'), -(60,60,0,0,NULL,'2013-01-01'), -(61,61,0,0,NULL,'2013-01-01'), -(62,62,0,0,NULL,'2013-01-01'), -(63,63,0,0,NULL,'2013-01-01'), -(64,64,0,0,NULL,'2013-01-01'), -(65,65,0,0,NULL,'2013-01-01'), -(66,66,0,0,NULL,'2013-01-01'), -(67,67,0,0,NULL,'2013-01-01'), -(68,68,0,0,NULL,'2013-01-01'), -(69,69,0,0,NULL,'2013-01-01'), -(70,70,0,0,NULL,'2013-01-01'), -(71,71,0,0,NULL,'2013-01-01'), -(72,72,0,0,NULL,'2013-01-01'), -(73,73,0,0,NULL,'2013-01-01'), -(74,74,0,0,NULL,'2013-01-01'), -(75,75,0,0,NULL,'2013-01-01'), -(76,76,0,0,NULL,'2013-01-01'), -(77,77,0,0,NULL,'2013-01-01'), -(78,78,0,0,NULL,'2013-01-01'), -(79,79,0,0,NULL,'2013-01-01'), -(80,80,0,0,NULL,'2013-01-01'), -(81,81,0,0,NULL,'2013-01-01'), -(82,82,0,0,NULL,'2013-01-01'), -(83,83,0,0,NULL,'2013-01-01'), -(84,84,0,0,NULL,'2013-01-01'), -(85,85,0,0,NULL,'2013-01-01'), -(86,86,0,0,NULL,'2013-01-01'), -(87,87,0,0,NULL,'2013-01-01'), -(88,88,0,0,NULL,'2013-01-01'), -(89,89,0,0,NULL,'2013-01-01'), -(90,90,0,0,NULL,'2013-01-01'), -(91,91,0,0,NULL,'2013-01-01'), -(92,92,0,0,NULL,'2013-01-01'), -(93,93,0,0,NULL,'2013-01-01'), -(94,94,0,0,NULL,'2013-01-01'), -(95,95,0,0,NULL,'2013-01-01'), -(96,96,0,0,NULL,'2013-01-01'), -(97,97,0,0,NULL,'2013-01-01'), -(98,98,0,0,NULL,'2013-01-01'), -(99,99,0,0,NULL,'2013-01-01'), -(100,100,0,0,NULL,'2013-01-01'), -(101,101,0,0,NULL,'2013-01-01'), -(102,102,0,0,NULL,'2013-01-01'), -(103,103,0,0,NULL,'2013-01-01'), -(104,104,0,0,NULL,'2013-01-01'), -(105,105,0,0,NULL,'2013-01-01'), -(106,106,0,0,NULL,'2013-01-01'), -(107,107,0,0,NULL,'2013-01-01'), -(108,108,0,0,NULL,'2013-01-01'), -(109,109,0,0,NULL,'2013-01-01'), -(110,110,0,0,NULL,'2013-01-01'), -(111,111,0,0,NULL,'2013-01-01'), -(112,112,0,0,NULL,'2013-01-01'), -(113,113,0,0,NULL,'2013-01-01'), -(114,114,0,0,NULL,'2013-01-01'), -(115,115,0,0,NULL,'2013-01-01'), -(116,116,0,0,NULL,'2013-01-01'), -(117,117,0,0,NULL,'2013-01-01'), -(118,118,0,0,NULL,'2013-01-01'), -(119,119,0,0,NULL,'2013-01-01'), -(120,120,0,0,NULL,'2013-01-01'), -(121,121,0,0,NULL,'2013-01-01'), -(122,122,0,0,NULL,'2013-01-01'), -(123,123,0,0,NULL,'2013-01-01'), -(124,124,0,0,NULL,'2013-01-01'), -(125,125,0,0,NULL,'2013-01-01'), -(126,126,0,0,NULL,'2013-01-01'), -(127,127,0,0,NULL,'2013-01-01'), -(128,128,0,0,NULL,'2013-01-01'), -(129,129,0,0,NULL,'2013-01-01'), -(130,130,0,0,NULL,'2013-01-01'), -(131,131,0,0,NULL,'2013-01-01'), -(132,132,0,0,NULL,'2013-01-01'), -(133,133,0,0,NULL,'2013-01-01'), -(134,134,0,0,NULL,'2013-01-01'); - - -DELETE FROM units; - -INSERT INTO units (name, base_unit, factor, type) VALUES -('Stck',NULL,0.00000,'dimension'), -('mg',NULL,0.00000,'dimension'), -('g','mg',1000.00000,'dimension'), -('kg','g',1000.00000,'dimension'), -('t','kg',1000.00000,'dimension'), -('ml',NULL,0.00000,'dimension'), -('L','ml',1000.00000,'dimension'), -('pauschal',NULL,0.00000,'service'), -('min',NULL,0.00000,'service'), -('Std','min',60.00000,'service'), -('Tag','Std',8.00000,'service'), -('Wo',NULL,0.00000,'service'), -('Mt','Wo',4.00000,'service'), -('Jahr','Mt',12.00000,'service'); - diff --git a/sql/Switzerland-deutsch-ohneMWST-2014-chart.sql b/sql/Switzerland-deutsch-ohneMWST-2014-chart.sql index ecbbfd468..50165e9f7 100644 --- a/sql/Switzerland-deutsch-ohneMWST-2014-chart.sql +++ b/sql/Switzerland-deutsch-ohneMWST-2014-chart.sql @@ -1,448 +1,262 @@ -- deutschsprachiger Kontenplan nach Schweizer Kontenrahmen KMU für Firmen in der Schweiz, die nicht mehrwertsteuerpflichtig sind -- Erstellt am 4.6.2014 --- Grundlage: Revision OR Stand 1.1.2013, insbesondere Art. 957a Abs. 2 --- Redaktion: Andreas Rudin, http://www.revamp-it.ch --- Copyright 2014 Andreas Rudin - --- This file is part of kivitendo. --- kivitendo is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- kivitendo is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- You should have received a copy of the GNU General Public License --- along with kivitendo. If not, see . - -DELETE FROM buchungsgruppen; - -INSERT INTO buchungsgruppen (id, 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 -(1,'Standard',16,72,90,72,90,72,90,72,90); - +-- Korrigiert: November 2015 +-- Grundlage: Revision OR Stand 1.1.2013, insbesondere Art. 957a Abs. 2 DELETE FROM chart; -INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik, itime, mtime, new_chart_id, valid_from) VALUES -(1,1,'AKTIVEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(2,10,'UMLAUFSVERMÖGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(3,100,'Flüssige Mittel','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(4,1000,'Kasse','A','A','AR_paid:AP_paid',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(5,1020,'Postfinance oder Bank1','A','A','AR_paid:AP_paid',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(6,1021,'Bank2','A','A','AR_paid:AP_paid',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(7,106,'Kurzfristig gehaltene Aktiven mit Börsenkurs','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(8,110,'Forderungen aus Lieferungen und Leistungen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(9,1100,'Forderungen aus Lieferungen und Leistungen','A','A','AR',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(10,114,'Übrige kurzfristige Forderungen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(11,1140,'Vorschüsse, kurzfristige Darlehen','A','A','AR',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(12,1170,'Vorsteuer auf Aufwand','A','A','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(13,1171,'Vorsteuer auf Investitionen','A','A','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(14,1176,'Verrechnungssteuer','A','A','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(15,120,'Vorräte und nicht fakturierte Dienstleistungen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(16,1200,'Handelswaren','A','A','IC',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(17,1210,'Rohstoffe','A','A','IC',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(18,1280,'Nicht fakturierte Dienstleistungen','A','A','IC',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(19,1290,'Angefangene Arbeiten','A','A','IC',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(20,130,'Aktive Rechnungsabgrenzungen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(21,1300,'Aktive Rechnungsabgrenzungen','A','A','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(22,14,'ANLAGEVERMÖGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(23,140,'Finanzanlagen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(24,148,'Beteiligungen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(25,150,'Mobile Sachanlagen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(26,1500,'Maschinen und Apparate','A','A','IC',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(27,1510,'Mobiliar und Einrichtungen','A','A','IC',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(28,1520,'Büromaschinen, Informatik','A','A','IC',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(29,1530,'Fahrzeuge','A','A','IC',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(30,1540,'Werkzeuge und Geräte','A','A','IC',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(31,160,'Immobile Sachanlagen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(32,170,'Immaterielle Werte','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(33,180,'Nicht einbezahltes Grund- Gesellschafter- oder Stiftungskapital','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(34,2,'PASSIVEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(35,20,'KURZFRISTIGES FREMDKAPITAL','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(36,200,'Verbindlichkeiten aus Lieferungen und Leistungen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(37,2000,'Verbindlichkeiten aus Lieferungen und Leistungen','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(38,2001,'Übrige Kreditoren','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(39,2030,'Anzahlungen von Kundinnen und Kunden','A','L','AR_paid:AP_paid',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(40,210,'Kurzfristige verzinsliche Verbindlichkeiten','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(41,2100,'Bankverbindlichkeiten','A','L','AR_paid:AP_paid',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(42,2140,'Übrige verzinsliche Verbindlichkeiten','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(43,220,'Übrige kurzfristige Verbindlichkeiten','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(44,2200,'Geschuldete MWST(2,5)','A','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(45,2201,'Geschuldete MWST(8,0)','A','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(46,2206,'Verrechnungssteuer','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(47,2210,'Geschuldete Steuern','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(48,2250,'Personalaufwand','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(49,2270,'Verbindlichkeiten Sozialversicherungen und Vorsorgeeinrichtungen','A','L','AP',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(50,230,'Passive Rechnungsabgrenzungen und kurzfristige Rückstellungen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(51,2300,'Passive Rechnungsabgrenzungen','A','L','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(52,2330,'Kurzfristige Rückstellungen','A','L','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(53,24,'LANGFRISTIGES FREMDKAPITAL','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(54,240,'Langfristige verzinsliche Verbindlichkeiten','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL),(55,2400,'Bankverbindlichkeiten','A','L','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(56,2450,'Langfristige verzinsliche Darlehen','A','L','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(57,250,'Übrige langfristige Verbindlichkeiten','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(58,2500,'Zinslose Darlehen','A','L','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(59,260,'Rückstellungen sowie vom Gesetz vorgesehene ähnliche Positionen','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(60,28,'EIGENKAPITAL','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(61,280,'Grund-, Gesellschafter- oder Stiftungskapital','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(62,2800,'Stammkapital','A','Q','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(63,290,'Reserven, Jahresgewinn oder Jahresverlust','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(64,2900,'Gesetzliche Kapitalreserve','A','Q','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(65,2950,'Gesetzliche Gewinnreserve','A','Q','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(66,2960,'Freiwillige Gewinnreserve','A','Q','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(67,2970,'Gewinn- oder Verlustvortrag','A','Q','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(68,2979,'Jahresgewinn oder -verlust','A','Q','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(69,2980,'Eigene Kapitalanteile','A','Q','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(70,3,'BETRIEBLICHER ERTRAG AUS LIEFERUNGEN UND LEISTUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(71,30,'PRODUKTIONSERLÖSE','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(72,3000,'Produktionserlöse','A','I','AR_amount:IC_sale',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(73,32,'HANDELSERLÖSE','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(74,3200,'Handelserlöse','A','I','AR_amount:IC_sale',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(75,34,'DIENSTLEISTUNGSERLÖSE','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(76,3400,'Dienstleistungserlöse','A','I','AR_amount:IC_income',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(77,36,'ÜBRIGE ERLÖSE AUS LIEFERUNGEN UND LEISTUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(78,3600,'Übrige Erlöse aus Lieferungen und Leistungen','A','I','IC_income',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(79,37,'EIGENLEISTUNGEN UND EIGENVERBRAUCH','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(80,3700,'Eigenleistungen','A','I','',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(81,38,'ERLÖSMINDERUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(82,3800,'Skonti','A','E','IC_sale:IC_cogs:IC_income:IC_expense',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(83,3801,'Rabatte, Preisnachlässe','A','E','IC_sale:IC_cogs:IC_income:IC_expense',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(84,3805,'Verluste aus Forderungen','A','E','IC_sale:IC_cogs:IC_income:IC_expense',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(85,3809,'MWST - nur Saldosteuersatz','A','E','IC_sale:IC_cogs:IC_income:IC_expense',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(86,39,'BESTANDESÄNDERUNGEN AN UNFERTIGEN UND FERTIGEN ERZEUGNISSEN SOWIE AN NICHT FAKTURIERTEN DIENSTLEISTUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(87,3900,'Bestandesänderungen','A','I','',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(88,4,'AUFWAND FÜR MATERIAL, HANDELSWAREN, DIENSTLEISTUNGEN UND ENERGIE','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(89,40,'MATERIALAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(90,4000,'Materialeinkauf','A','E','AP_amount:IC_cogs',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(91,42,'HANDELSWARENAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(92,4200,'Einkauf Handelswaren','A','E','AP_amount:IC_cogs',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(93,4208,'Bestandsänderungen Handelswaren','A','E','AP_amount:IC_cogs',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(94,44,'AUFWAND FÜR BEZOGENE DRITTLEISTUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(95,4400,'Aufwand für Drittleistungen','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(96,45,'ENERGIEAUFWAND ZUR LEISTUNGSERSTELLUNG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(97,4500,'Energieaufwand zur Leistungserstellung','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(98,46,'ÜBRIGER AUFWAND FÜR MATERIAL, HANDELSWAREN UND DIENSTLEISTUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(99,47,'DIREKTE EINKAUFSSPESEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(100,4700,'Einkaufsspesen','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6, 'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(101,48,'BESTANDESÄNDERUNGEN UND MATERIAL-/WARENVERLUSTE','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(102,4800,'Bestandesänderungen','A','E','',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(103,49,'EINKAUFSPREISMINDERUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(104,4900,'Skonti, Rabatte, Preisnachlässe','A','I','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(105,5,'PERSONALAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(106,500,'Löhne und Gehälter','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(107,5000,'Löhne und Gehälter','A','E','IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(108,5001,'Erfolgsbeteiligungen','A','E','IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(109,5005,'Leistungen von Sozialversicherungen','A','I','IC_income',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(110,57,'SOZIALVERSICHERUNGSAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(111,5700,'AHV, IV, EO, ALV','A','E','AP_amount:IC_income:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(112,5710,'FAK','A','E','AP_amount:IC_income:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(113,5720,'Berufliche Vorsorge','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(114,5730,'Unfallversicherung','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(115,5740,'Krankentaggeldversicherung','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(116,5790,'Quellensteuer','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(117,58,'ÜBRIGER PERSONALAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(118,5800,'Aufwand für Personaleinstellung','A','E','IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(119,5810,'Weiterbildungskosten','A','E','IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(120,5830,'Spesen','A','E','IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(121,5880,'Sonstiger Personalaufwand','A','E','IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(122,59,'LEISTUNGEN DRITTER','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(123,6,'ÜBRIGER BETRIEBLICHER AUFWAND, ABSCHREIBUNGEN UND WERTBERICHTIGUNGEN SOWIE FINANZERGEBNIS','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(124,60,'RAUMAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(125,6000,'Miete','A','E','IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(126,6040,'Reinigung','A','E','IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(127,6050,'Übriger Raumaufwand','A','E','IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(128,61,'UNTERHALT, REPARATUREN, ERSATZ, LEASING, MOBILE SACHANLAGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(129,6100,'Unterhalt','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(130,62,'FAHRZEUG- UND TRANSPORTAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(131,6200,'Fahrzeugaufwand','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(132,6201,'Transportaufwand','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(133,63,'SACHVERSICHERUNGEN, ABGABEN, GEBÜHREN, BEWILLIGUNGEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(134,6300,'Betriebsversicherungen','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(135,6360,'Abgaben, Gebühren und Bewilligungen','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(136,64,'ENERGIE- UND ENTSORGUNGSAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(137,6400,'Strom, Gas, Wasser','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(138,6460,'Entsorgungsaufwand','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(139,65,'VERWALTUNGS- UND INFORMATIKAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(140,6500,'Büromaterial, Drucksachen','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(141,6503,'Fachliteratur','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(142,6510,'Telefon, Fax, Porti Internet','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(143,6520,'Beiträge, Spenden','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(144,6530,'Buchführungs- und Beratungsaufwand','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(145,6540,'Verwaltungsrat, GV, Revision','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(146,6570,'Informatikaufwand','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(147,6590,'Übriger Verwaltungsaufwand','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(148,66,'WERBEAUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(149,6600,'Werbeaufwand','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(150,67,'SONSTIGER BETRIEBLICHER AUFWAND','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(151,6720,'Forschung und Entwicklung','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(152,6790,'Übriger Betriebsaufwand','A','E','AP_amount:IC_expense',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(153,68,'ABSCHREIBUNGEN UND WERTBERICHTIGUNGEN AUF POSITIONEN DES ANLAGEVERMÖGENS','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(154,6800,'Abschreibungen Finanzanlagen','A','E','',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(155,6810,'Abschreibungen Beteiligungen','A','E','',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(156,6820,'Abschreibungen mobile Sachanlagen','A','E','',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(157,6840,'Abschreibungen immaterielle Anlagen','A','E','',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(158,69,'FINANZAUFWAND UND FINANZERTRAG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(159,690,'Finanzaufwand','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(160,6900,'Finanzaufwand','A','E','',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(161,6940,'Bankspesen','A','E','',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(162,6942,'Kursverluste','A','E','',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(163,6943,'Rundungsaufwand','A','E','',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(164,695,'Finanzertrag','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(165,6950,'Finanzertrag','A','I','',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(166,6952,'Kursgewinne','A','I','',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(167,6953,'Rundungsertrag','A','I','',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(168,6970,'Mitgliederbeiträge','A','I','AR_amount:IC_income',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(169,6980,'Spenden','A','I','AR_amount:IC_income',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(170,7,'BETRIEBLICHER NEBENERFOLG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(171,70,'ERFOLG AUS NEBENBETRIEBEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(172,75,'ERFOLG AUS BETRIEBLICHEN LIEGENSCHAFTEN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(173,8,'BETRIEBSFREMDER, AUSSERORDENTLICHER, EINMALIGER UND PERIODENFREMDER AUFWAND UND ERTRAG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(174,80,'BETRIEBSFREMDER AUFWAND UND BETRIEBSFREMDER ERTRAG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(175,8000,'Betriebsfremder Aufwand','A','E','AP_amount:IC_cogs',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(176,8100,'Betriebsfremder Ertrag','A','I','AR_amount:IC_sale',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(177,85,'AUSSERORDENTLICHER, EINMALIGER AUFWAND UND ERTRAG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(178,8500,'Ausserordentlicher Aufwand','A','E','AP_amount:IC_cogs',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(179,8510,'Ausserordentlicher Ertrag','A','I','AR_amount:IC_sale',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(180,87,'PERIODENFREMDER AUFWAND UND ERTRAG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(181,8700,'Periodenfremder Aufwand','A','E','AP_amount:IC_cogs',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(182,8710,'Periodenfremder Ertrag','A','I','AR_amount:IC_sale',NULL,0,NULL,NULL,NULL,1,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(183,89,'DIREKTE STEUERN','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(184,8900,'Direkte Steuern','A','E','',NULL,0,NULL,NULL,NULL,6,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(185,9,'ABSCHLUSS','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(186,90,'ERFOLGSRECHNUNG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(187,91,'BILANZ','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(188,9100,'Eröffnungsbilanz','A','E','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(189,92,'GEWINNVERWENDUNG','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(190,95,'JAHRESERGEBNISSE','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL), -(191,99,'HILFSKONTEN NEBENBÜCHER','H','','',NULL,0,NULL,NULL,NULL,NULL,'f','2014-01-01 00:00:00.000000',NULL,NULL,NULL); +INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, taxkey_id, pos_ustva, pos_bwa, pos_bilanz, pos_eur, datevautomatik, valid_from) VALUES +('1', 'AKTIVEN','H','','','1',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('10', 'UMLAUFSVERMÖGEN','H','','','10',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('100', 'Flüssige Mittel','H','','','100',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1000', 'Kasse','A','A','AR_paid:AP_paid','1000',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1020', 'Postfinance oder Bank1','A','A','AR_paid:AP_paid','1020',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1021', 'Bank2','A','A','AR_paid:AP_paid','1021',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000' ), +('106', 'Kurzfristig gehaltene Aktiven mit Börsenkurs','H','','','106',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('110', 'Forderungen aus Lieferungen und Leistungen','H','','','110',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1100', 'Forderungen aus Lieferungen und Leistungen','A','A','AR','1100',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('114', 'Übrige kurzfristige Forderungen','H','','','114',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1140', 'Vorschüsse, kurzfristige Darlehen','A','A','AR','1140',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1170', 'Vorsteuer auf Aufwand','A','A','','1170',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1171', 'Vorsteuer auf Investitionen','A','A','','1171',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1176', 'Verrechnungssteuer','A','A','','1176',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('120', 'Vorräte und nicht fakturierte Dienstleistungen','H','','','120',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1200', 'Handelswaren','A','A','IC','1200',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1210', 'Rohstoffe','A','A','IC','1210',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1280', 'Nicht fakturierte Dienstleistungen','A','A','IC','1280',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1290', 'Angefangene Arbeiten','A','A','IC','1290',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('130', 'Aktive Rechnungsabgrenzungen','H','','','130',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1300', 'Aktive Rechnungsabgrenzungen','A','A','','1300',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('14', 'ANLAGEVERMÖGEN','H','','','14',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('140', 'Finanzanlagen','H','','','140',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('148', 'Beteiligungen','H','','','148',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('150', 'Mobile Sachanlagen','H','','','150',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1500', 'Maschinen und Apparate','A','A','IC','1500',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1510', 'Mobiliar und Einrichtungen','A','A','IC','1510',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1520', 'Büromaschinen, Informatik','A','A','IC','1520',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1530', 'Fahrzeuge','A','A','IC','1530',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('1540', 'Werkzeuge und Geräte','A','A','IC','1540',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('160', 'Immobile Sachanlagen','H','','','160',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('170', 'Immaterielle Werte','H','','','170',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('180', 'Nicht einbezahltes Grund- Gesellschafter- oder Stiftungskapital','H','','','180',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2', 'PASSIVEN','H','','','2',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('20', 'KURZFRISTIGES FREMDKAPITAL','H','','','20',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('200', 'Verbindlichkeiten aus Lieferungen und Leistungen','H','','','200',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2000', 'Verbindlichkeiten aus Lieferungen und Leistungen','A','L','AP','2000',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2001', 'Übrige Kreditoren','A','L','AP','2001',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2030', 'Anzahlungen von Kundinnen und Kunden','A','L','AR_paid:AP_paid','2030',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('210', 'Kurzfristige verzinsliche Verbindlichkeiten','H','','','210',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2100', 'Bankverbindlichkeiten','A','L','AR_paid:AP_paid','2100',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2140', 'Übrige verzinsliche Verbindlichkeiten','A','L','AP','2140',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('220', 'Übrige kurzfristige Verbindlichkeiten','H','','','220',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2200', 'Geschuldete MWST(2,5)','A','L','AR_tax:IC_taxpart:IC_taxservice:CT_tax','2200',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2201', 'Geschuldete MWST(8,0)','A','L','AR_tax:IC_taxpart:IC_taxservice:CT_tax','2201',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2206', 'Verrechnungssteuer','A','L','AP','2206',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2210', 'Geschuldete Steuern','A','L','AP','2210',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2250', 'Personalaufwand','A','L','AP','2250',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2270', 'Verbindlichkeiten Sozialversicherungen und Vorsorgeeinrichtungen','A','L','AP','2270',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('230', 'Passive Rechnungsabgrenzungen und kurzfristige Rückstellungen','H','','','230',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2300', 'Passive Rechnungsabgrenzungen','A','L','','2300',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2330', 'Kurzfristige Rückstellungen','A','L','','2330',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('24', 'LANGFRISTIGES FREMDKAPITAL','H','','','24',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('240', 'Langfristige verzinsliche Verbindlichkeiten','H','','','240',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2400','Bankverbindlichkeiten','A','L','','2400',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2450', 'Langfristige verzinsliche Darlehen','A','L','','2450',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('250', 'Übrige langfristige Verbindlichkeiten','H','','','250',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2500', 'Zinslose Darlehen','A','L','','2500',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('260', 'Rückstellungen sowie vom Gesetz vorgesehene ähnliche Positionen','H','','','260',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('28', 'EIGENKAPITAL','H','','','28',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('280', 'Grund-, Gesellschafter- oder Stiftungskapital','H','','','280',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2800', 'Stammkapital','A','Q','','2800',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('290', 'Reserven, Jahresgewinn oder Jahresverlust','H','','','290',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2900', 'Gesetzliche Kapitalreserve','A','Q','','2900',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2950', 'Gesetzliche Gewinnreserve','A','Q','','2950',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2960', 'Freiwillige Gewinnreserve','A','Q','','2960',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2970', 'Gewinn- oder Verlustvortrag','A','Q','','2970',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2979', 'Jahresgewinn oder -verlust','A','Q','','2979',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('2980', 'Eigene Kapitalanteile','A','Q','','2980',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('3', 'BETRIEBLICHER ERTRAG AUS LIEFERUNGEN UND LEISTUNGEN','H','','','3',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('30', 'PRODUKTIONSERLÖSE','H','','','30',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('3000', 'Produktionserlöse','A','I','AR_amount:IC_sale','3000',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('32', 'HANDELSERLÖSE','H','','','32',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('3200', 'Handelserlöse','A','I','AR_amount:IC_sale','3200',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('34', 'DIENSTLEISTUNGSERLÖSE','H','','','34',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('3400', 'Dienstleistungserlöse','A','I','AR_amount:IC_income','3400',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('36', 'ÜBRIGE ERLÖSE AUS LIEFERUNGEN UND LEISTUNGEN','H','','','36',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('3600', 'Übrige Erlöse aus Lieferungen und Leistungen','A','I','IC_income','3600',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('37', 'EIGENLEISTUNGEN UND EIGENVERBRAUCH','H','','','37',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('3700', 'Eigenleistungen','A','I','','3700',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('38', 'ERLÖSMINDERUNGEN','H','','','38',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('3800', 'Skonti','A','E','AR_paid','3800',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('3801', 'Rabatte, Preisnachlässe','A','E','AR_paid','3801',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('3805', 'Verluste aus Forderungen','A','E','AR_paid','3805',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('3809', 'MWST - nur Saldosteuersatz','A','E','AR_paid','3809',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('39', 'BESTANDESÄNDERUNGEN AN UNFERTIGEN UND FERTIGEN ERZEUGNISSEN SOWIE AN NICHT FAKTURIERTEN DIENSTLEISTUNGEN','H','','','39',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('3900', 'Bestandesänderungen','A','I','','3900',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('4', 'AUFWAND FÜR MATERIAL, HANDELSWAREN, DIENSTLEISTUNGEN UND ENERGIE','H','','','4',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('40', 'MATERIALAUFWAND','H','','','40',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('4000', 'Materialeinkauf','A','E','AP_amount:IC_cogs','4000',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('42', 'HANDELSWARENAUFWAND','H','','','42',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('4200', 'Einkauf Handelswaren','A','E','AP_amount:IC_cogs','4200',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('4208', 'Bestandsänderungen Handelswaren','A','E','AP_amount:IC_cogs','4208',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('44', 'AUFWAND FÜR BEZOGENE DRITTLEISTUNGEN','H','','','44',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('4400', 'Aufwand für Drittleistungen','A','E','AP_amount:IC_expense','4400',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('45', 'ENERGIEAUFWAND ZUR LEISTUNGSERSTELLUNG','H','','','45',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('4500', 'Energieaufwand zur Leistungserstellung','A','E','AP_amount:IC_expense','4500',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('46', 'ÜBRIGER AUFWAND FÜR MATERIAL, HANDELSWAREN UND DIENSTLEISTUNGEN','H','','','46',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('47', 'DIREKTE EINKAUFSSPESEN','H','','','47',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('4700', 'Einkaufsspesen','A','E','AP_amount:IC_expense','4700',0,NULL,NULL,NULL,6, FALSE,'2011-01-01 00:00:00.000000'), +('48', 'BESTANDESÄNDERUNGEN UND MATERIAL-/WARENVERLUSTE','H','','','48',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('4800', 'Bestandesänderungen','A','E','','4800',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('49', 'EINKAUFSPREISMINDERUNGEN','H','','','49',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('4900', 'Skonti, Rabatte, Preisnachlässe','A','I','AP_paid','4900',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5', 'PERSONALAUFWAND','H','','','5',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('500', 'Löhne und Gehälter','H','','','500',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('5000', 'Löhne und Gehälter','A','E','IC_expense','5000',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5001', 'Erfolgsbeteiligungen','A','E','IC_expense','5001',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5005', 'Leistungen von Sozialversicherungen','A','I','IC_income','5005',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('57', 'SOZIALVERSICHERUNGSAUFWAND','H','','','57',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('5700', 'AHV, IV, EO, ALV','A','E','AP_amount:IC_expense','5700',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5710', 'FAK','A','E','AP_amount:IC_expense','5710',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5720', 'Berufliche Vorsorge','A','E','AP_amount:IC_expense','5720',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5730', 'Unfallversicherung','A','E','AP_amount:IC_expense','5730',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5740', 'Krankentaggeldversicherung','A','E','AP_amount:IC_expense','5740',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5790', 'Quellensteuer','A','E','AP_amount:IC_expense','5790',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('58', 'ÜBRIGER PERSONALAUFWAND','H','','','58',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('5800', 'Aufwand für Personaleinstellung','A','E','IC_expense','5800',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5810', 'Weiterbildungskosten','A','E','IC_expense','5810',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5830', 'Spesen','A','E','IC_expense','5830',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('5880', 'Sonstiger Personalaufwand','A','E','IC_expense','5880',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('59', 'LEISTUNGEN DRITTER','H','','','59',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6', 'ÜBRIGER BETRIEBLICHER AUFWAND, ABSCHREIBUNGEN UND WERTBERICHTIGUNGEN SOWIE FINANZERGEBNIS','H','','','6',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('60', 'RAUMAUFWAND','H','','','60',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6000', 'Miete','A','E','IC_expense','6000',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6040', 'Reinigung','A','E','IC_expense','6040',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6050', 'Übriger Raumaufwand','A','E','IC_expense','6050',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('61', 'UNTERHALT, REPARATUREN, ERSATZ, LEASING, MOBILE SACHANLAGEN','H','','','61',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6100', 'Unterhalt','A','E','AP_amount:IC_expense','6100',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('62', 'FAHRZEUG- UND TRANSPORTAUFWAND','H','','','62',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6200', 'Fahrzeugaufwand','A','E','AP_amount:IC_expense','6200',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6201', 'Transportaufwand','A','E','AP_amount:IC_expense','6201',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('63', 'SACHVERSICHERUNGEN, ABGABEN, GEBÜHREN, BEWILLIGUNGEN','H','','','63',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6300', 'Betriebsversicherungen','A','E','AP_amount:IC_expense','6300',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6360', 'Abgaben, Gebühren und Bewilligungen','A','E','AP_amount:IC_expense','6360',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('64', 'ENERGIE- UND ENTSORGUNGSAUFWAND','H','','','64',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6400', 'Strom, Gas, Wasser','A','E','AP_amount:IC_expense','6400',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6460', 'Entsorgungsaufwand','A','E','AP_amount:IC_expense','6460',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('65', 'VERWALTUNGS- UND INFORMATIKAUFWAND','H','','','65',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6500', 'Büromaterial, Drucksachen','A','E','AP_amount:IC_expense','6500',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6503', 'Fachliteratur','A','E','AP_amount:IC_expense','6503',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6510', 'Telefon, Fax, Porti Internet','A','E','AP_amount:IC_expense','6510',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6520', 'Beiträge, Spenden','A','E','AP_amount:IC_expense','6520',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6530', 'Buchführungs- und Beratungsaufwand','A','E','AP_amount:IC_expense','6530',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6540', 'Verwaltungsrat, GV, Revision','A','E','AP_amount:IC_expense','6540',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6570', 'Informatikaufwand','A','E','AP_amount:IC_expense','6570',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6590', 'Übriger Verwaltungsaufwand','A','E','AP_amount:IC_expense','6590',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('66', 'WERBEAUFWAND','H','','','66',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6600', 'Werbeaufwand','A','E','AP_amount:IC_expense','6600',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('67', 'SONSTIGER BETRIEBLICHER AUFWAND','H','','','67',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6720', 'Forschung und Entwicklung','A','E','AP_amount:IC_expense','6720',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6790', 'Übriger Betriebsaufwand','A','E','AP_amount:IC_expense','6790',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('68', 'ABSCHREIBUNGEN UND WERTBERICHTIGUNGEN AUF POSITIONEN DES ANLAGEVERMÖGENS','H','','','68',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6800', 'Abschreibungen Finanzanlagen','A','E','','6800',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6810', 'Abschreibungen Beteiligungen','A','E','','6810',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6820', 'Abschreibungen mobile Sachanlagen','A','E','','6820',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6840', 'Abschreibungen immaterielle Anlagen','A','E','','6840',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('69', 'FINANZAUFWAND UND FINANZERTRAG','H','','','69',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('690', 'Finanzaufwand','H','','','690',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6900', 'Finanzaufwand','A','E','','6900',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6940', 'Bankspesen','A','E','','6940',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6942', 'Kursverluste','A','E','','6942',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('6943', 'Rundungsaufwand','A','E','','6943',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('695', 'Finanzertrag','H','','','695',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('6950', 'Finanzertrag','A','I','','6950',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('6952', 'Kursgewinne','A','I','','6952',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('6953', 'Rundungsertrag','A','I','','6953',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('6970', 'Mitgliederbeiträge','A','I','AR_amount:IC_income','6970',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('6980', 'Spenden','A','I','AR_amount:IC_income','6980',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('7', 'BETRIEBLICHER NEBENERFOLG','H','','','7',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('70', 'ERFOLG AUS NEBENBETRIEBEN','H','','','70',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('75', 'ERFOLG AUS BETRIEBLICHEN LIEGENSCHAFTEN','H','','','75',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('8', 'BETRIEBSFREMDER, AUSSERORDENTLICHER, EINMALIGER UND PERIODENFREMDER AUFWAND UND ERTRAG','H','','','8',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('80', 'BETRIEBSFREMDER AUFWAND UND BETRIEBSFREMDER ERTRAG','H','','','80',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('8000', 'Betriebsfremder Aufwand','A','E','AP_amount:IC_cogs:IC_expense','8000',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('8100', 'Betriebsfremder Ertrag','A','I','AR_amount:IC_sale:IC_income','8100',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('85', 'AUSSERORDENTLICHER, EINMALIGER AUFWAND UND ERTRAG','H','','','85',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('8500', 'Ausserordentlicher Aufwand','A','E','AP_amount:IC_cogs:IC_expense','8500',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('8510', 'Ausserordentlicher Ertrag','A','I','AR_amount:IC_sale:IC_income','8510',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('87', 'PERIODENFREMDER AUFWAND UND ERTRAG','H','','','87',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('8700', 'Periodenfremder Aufwand','A','E','AP_amount:IC_cogs:IC_expense','8700',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('8710', 'Periodenfremder Ertrag','A','I','AR_amount:IC_sale:IC_income','8710',0,NULL,NULL,NULL,1,FALSE,'2011-01-01 00:00:00.000000'), +('89', 'DIREKTE STEUERN','H','','','89',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('8900', 'Direkte Steuern','A','E','','8900',0,NULL,NULL,NULL,6,FALSE,'2011-01-01 00:00:00.000000'), +('9', 'ABSCHLUSS','H','','','9',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('90', 'ERFOLGSRECHNUNG','H','','','90',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('91', 'BILANZ','H','','','91',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('9100', 'Eröffnungsbilanz','A','E','','9100',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('92', 'GEWINNVERWENDUNG','H','','','92',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('95', 'JAHRESERGEBNISSE','H','','','95',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'), +('99', 'HILFSKONTEN NEBENBÜCHER','H','','','99',0,NULL,NULL,NULL,NULL,FALSE,'2011-01-01 00:00:00.000000'); -DELETE FROM defaults; +DELETE FROM buchungsgruppen; -INSERT INTO defaults (inventory_accno_id, income_accno_id, expense_accno_id, fxgain_accno_id, fxloss_accno_id, invnumber, sonumber, weightunit, businessnumber, version, curr, closedto, revtrans, ponumber, sqnumber, rfqnumber, customernumber, vendornumber, audittrail, articlenumber, servicenumber, coa, itime, mtime, rmanumber, cnnumber, accounting_method, inventory_system, profit_determination) VALUES -(16,72,90,166,162,0,0,'kg','','3.1.0 CH','CHF:EUR',NULL,'f',0,0,0,0,0,'f',0,0,'Switzerland-deutsch-ohneMWST','2014-01-01 00:00:00.000000',NULL,0,0,'accrual','periodic','balance'); +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 8%',(SELECT id FROM chart WHERE accno = '1200'), + (SELECT id FROM chart WHERE accno = '3200'), (SELECT id FROM chart WHERE accno = '4200'), + (SELECT id FROM chart WHERE accno = '3200'), (SELECT id FROM chart WHERE accno = '4200'), + (SELECT id FROM chart WHERE accno = '3200'), (SELECT id FROM chart WHERE accno = '4200'), + (SELECT id FROM chart WHERE accno = '3200'), (SELECT id FROM chart WHERE accno = '4200') +),( + 'Standard 2.5%',(SELECT id FROM chart WHERE accno = '1200'), + (SELECT id FROM chart WHERE accno = '3200'), (SELECT id FROM chart WHERE accno = '4200'), + (SELECT id FROM chart WHERE accno = '3200'), (SELECT id FROM chart WHERE accno = '4200'), + (SELECT id FROM chart WHERE accno = '3200'), (SELECT id FROM chart WHERE accno = '4200'), + (SELECT id FROM chart WHERE accno = '3200'), (SELECT id FROM chart WHERE accno = '4200') +); -DELETE FROM tax; +DELETE FROM tax_zones; -INSERT INTO tax (rate, taxkey, taxdescription, itime, mtime, id) VALUES -(0,0,'Keine Steuer','2014-01-01 00:00:00.000000',NULL,0), -(0,1,'mehrwertsteuerfrei','2014-01-01 00:00:00.000000',NULL,1); +INSERT INTO tax_zones (id, description) VALUES +(0, 'Schweiz'), -- siehe auch Pg-upgrade2/taxzone_id_in_oe_delivery_orders.sql )=: +(1, 'EU mit USt-ID Nummer'), +(2, 'EU ohne USt-ID Nummer'), +(3, 'Ausserhalb EU'); -INSERT INTO tax (chart_id, rate, taxnumber, taxkey, taxdescription, itime, mtime, id) VALUES -(45,0.08000,2201,2,'MWST 8% Verkauf','2014-01-01 00:00:00.000000',NULL,2), -(44,0.02500,2200,3,'MWST 2.5% Verkauf','2014-01-01 00:00:00.000000',NULL,3), -(12,0.08000,1170,4,'MWST 8% Aufwand','2014-01-01 00:00:00.000000',NULL,4), -(12,0.02500,1170,5,'MWST 2.5% Aufwand','2014-01-01 00:00:00.000000',NULL,5), -(13,0.08000,1171,6,'MWST 8% Investitionen','2014-01-01 00:00:00.000000',NULL,6), -(13,0.02500,1171,7,'MWST 2.5% Investitionen','2014-01-01 00:00:00.000000',NULL,7); +DELETE FROM tax; -DELETE FROM tax_zones; +INSERT INTO tax (taxkey, taxdescription, rate) VALUES +(0, 'Keine Steuer', 0), +(1, 'Mehrwertsteuerfrei', 0); -INSERT INTO tax_zones (id, description) VALUES -(0,'Schweiz'), -(1,'EU mit USt-ID Nummer'), -(2,'EU ohne USt-ID Nummer'), -(3,'Ausserhalb EU'); +INSERT INTO tax (taxkey, taxdescription, rate, taxnumber, chart_id) VALUES +(2, 'MWST 8% Ertrag', 0.08000, '2200', (SELECT id FROM chart WHERE accno='2200')), +(3, 'MWST 2.5% Ertrag', 0.02500, '2201', (SELECT id FROM chart WHERE accno='2201')), +(4, 'MWST 8% Aufwand', 0.08000, '1170', (SELECT id FROM chart WHERE accno='1170')), +(5, 'MWST 2.5% Aufwand', 0.02500, '1170', (SELECT id FROM chart WHERE accno='1170')), +(6, 'MWST 8% Investitionen', 0.08000, '1171', (SELECT id FROM chart WHERE accno='1171')), +(7, 'MWST 2.5% Investitionen', 0.02500, '1171', (SELECT id FROM chart WHERE accno='1171')); DELETE FROM taxkeys; -INSERT INTO taxkeys (id, chart_id, tax_id, taxkey_id, pos_ustva, startdate) VALUES -(0,0,0,0,NULL,'2014-01-01'), -(1,1,0,0,NULL,'2014-01-01'), -(2,2,0,0,NULL,'2014-01-01'), -(3,3,0,0,NULL,'2014-01-01'), -(4,4,0,0,NULL,'2014-01-01'), -(5,5,0,0,NULL,'2014-01-01'), -(6,6,0,0,NULL,'2014-01-01'), -(7,7,0,0,NULL,'2014-01-01'), -(8,8,0,0,NULL,'2014-01-01'), -(9,9,0,0,NULL,'2014-01-01'), -(10,10,0,0,NULL,'2014-01-01'), -(11,11,0,0,NULL,'2014-01-01'), -(12,12,0,0,NULL,'2014-01-01'), -(13,13,0,0,NULL,'2014-01-01'), -(14,14,0,0,NULL,'2014-01-01'), -(15,15,0,0,NULL,'2014-01-01'), -(16,16,0,0,NULL,'2014-01-01'), -(17,17,0,0,NULL,'2014-01-01'), -(18,18,0,0,NULL,'2014-01-01'), -(19,19,0,0,NULL,'2014-01-01'), -(20,20,0,0,NULL,'2014-01-01'), -(21,21,0,0,NULL,'2014-01-01'), -(22,22,0,0,NULL,'2014-01-01'), -(23,23,0,0,NULL,'2014-01-01'), -(24,24,0,0,NULL,'2014-01-01'), -(25,25,0,0,NULL,'2014-01-01'), -(26,26,0,0,NULL,'2014-01-01'), -(27,27,0,0,NULL,'2014-01-01'), -(28,28,0,0,NULL,'2014-01-01'), -(29,29,0,0,NULL,'2014-01-01'), -(30,30,0,0,NULL,'2014-01-01'), -(31,31,0,0,NULL,'2014-01-01'), -(32,32,0,0,NULL,'2014-01-01'), -(33,33,0,0,NULL,'2014-01-01'), -(34,34,0,0,NULL,'2014-01-01'), -(35,35,0,0,NULL,'2014-01-01'), -(36,36,0,0,NULL,'2014-01-01'), -(37,37,0,0,NULL,'2014-01-01'), -(38,38,0,0,NULL,'2014-01-01'), -(39,39,0,0,NULL,'2014-01-01'), -(40,40,0,0,NULL,'2014-01-01'), -(41,41,0,0,NULL,'2014-01-01'), -(42,42,0,0,NULL,'2014-01-01'), -(43,43,0,0,NULL,'2014-01-01'), -(44,44,0,0,NULL,'2014-01-01'), -(45,45,0,0,NULL,'2014-01-01'), -(46,46,0,0,NULL,'2014-01-01'), -(47,47,0,0,NULL,'2014-01-01'), -(48,48,0,0,NULL,'2014-01-01'), -(49,49,0,0,NULL,'2014-01-01'), -(50,50,0,0,NULL,'2014-01-01'), -(51,51,0,0,NULL,'2014-01-01'), -(52,52,0,0,NULL,'2014-01-01'), -(53,53,0,0,NULL,'2014-01-01'), -(54,54,0,0,NULL,'2014-01-01'), -(55,55,0,0,NULL,'2014-01-01'), -(56,56,0,0,NULL,'2014-01-01'), -(57,57,0,0,NULL,'2014-01-01'), -(58,58,0,0,NULL,'2014-01-01'), -(59,59,0,0,NULL,'2014-01-01'), -(60,60,0,0,NULL,'2014-01-01'), -(61,61,0,0,NULL,'2014-01-01'), -(62,62,0,0,NULL,'2014-01-01'), -(63,63,0,0,NULL,'2014-01-01'), -(64,64,0,0,NULL,'2014-01-01'), -(65,65,0,0,NULL,'2014-01-01'), -(66,66,0,0,NULL,'2014-01-01'), -(67,67,0,0,NULL,'2014-01-01'), -(68,68,0,0,NULL,'2014-01-01'), -(69,69,0,0,NULL,'2014-01-01'), -(70,70,0,0,NULL,'2014-01-01'), -(71,71,0,0,NULL,'2014-01-01'), -(72,72,0,0,NULL,'2014-01-01'), -(73,73,0,0,NULL,'2014-01-01'), -(74,74,0,0,NULL,'2014-01-01'), -(75,75,0,0,NULL,'2014-01-01'), -(76,76,0,0,NULL,'2014-01-01'), -(77,77,0,0,NULL,'2014-01-01'), -(78,78,0,0,NULL,'2014-01-01'), -(79,79,0,0,NULL,'2014-01-01'), -(80,80,0,0,NULL,'2014-01-01'), -(81,81,0,0,NULL,'2014-01-01'), -(82,82,0,0,NULL,'2014-01-01'), -(83,83,0,0,NULL,'2014-01-01'), -(84,84,0,0,NULL,'2014-01-01'), -(85,85,0,0,NULL,'2014-01-01'), -(86,86,0,0,NULL,'2014-01-01'), -(87,87,0,0,NULL,'2014-01-01'), -(88,88,0,0,NULL,'2014-01-01'), -(89,89,0,0,NULL,'2014-01-01'), -(90,90,0,0,NULL,'2014-01-01'), -(91,91,0,0,NULL,'2014-01-01'), -(92,92,0,0,NULL,'2014-01-01'), -(93,93,0,0,NULL,'2014-01-01'), -(94,94,0,0,NULL,'2014-01-01'), -(95,95,0,0,NULL,'2014-01-01'), -(96,96,0,0,NULL,'2014-01-01'), -(97,97,0,0,NULL,'2014-01-01'), -(98,98,0,0,NULL,'2014-01-01'), -(99,99,0,0,NULL,'2014-01-01'), -(100,100,0,0,NULL,'2014-01-01'), -(101,101,0,0,NULL,'2014-01-01'), -(102,102,0,0,NULL,'2014-01-01'), -(103,103,0,0,NULL,'2014-01-01'), -(104,104,0,0,NULL,'2014-01-01'), -(105,105,0,0,NULL,'2014-01-01'), -(106,106,0,0,NULL,'2014-01-01'), -(107,107,0,0,NULL,'2014-01-01'), -(108,108,0,0,NULL,'2014-01-01'), -(109,109,0,0,NULL,'2014-01-01'), -(110,110,0,0,NULL,'2014-01-01'), -(111,111,0,0,NULL,'2014-01-01'), -(112,112,0,0,NULL,'2014-01-01'), -(113,113,0,0,NULL,'2014-01-01'), -(114,114,0,0,NULL,'2014-01-01'), -(115,115,0,0,NULL,'2014-01-01'), -(116,116,0,0,NULL,'2014-01-01'), -(117,117,0,0,NULL,'2014-01-01'), -(118,118,0,0,NULL,'2014-01-01'), -(119,119,0,0,NULL,'2014-01-01'), -(120,120,0,0,NULL,'2014-01-01'), -(121,121,0,0,NULL,'2014-01-01'), -(122,122,0,0,NULL,'2014-01-01'), -(123,123,0,0,NULL,'2014-01-01'), -(124,124,0,0,NULL,'2014-01-01'), -(125,125,0,0,NULL,'2014-01-01'), -(126,126,0,0,NULL,'2014-01-01'), -(127,127,0,0,NULL,'2014-01-01'), -(128,128,0,0,NULL,'2014-01-01'), -(129,129,0,0,NULL,'2014-01-01'), -(130,130,0,0,NULL,'2014-01-01'), -(131,131,0,0,NULL,'2014-01-01'), -(132,132,0,0,NULL,'2014-01-01'), -(133,133,0,0,NULL,'2014-01-01'), -(134,134,0,0,NULL,'2014-01-01'), -(135,135,0,0,NULL,'2014-01-01'), -(136,136,0,0,NULL,'2014-01-01'), -(137,137,0,0,NULL,'2014-01-01'), -(138,138,0,0,NULL,'2014-01-01'), -(139,139,0,0,NULL,'2014-01-01'), -(140,140,0,0,NULL,'2014-01-01'), -(141,141,0,0,NULL,'2014-01-01'), -(142,142,0,0,NULL,'2014-01-01'), -(143,143,0,0,NULL,'2014-01-01'), -(144,144,0,0,NULL,'2014-01-01'), -(145,145,0,0,NULL,'2014-01-01'), -(146,146,0,0,NULL,'2014-01-01'), -(147,147,0,0,NULL,'2014-01-01'), -(148,148,0,0,NULL,'2014-01-01'), -(149,149,0,0,NULL,'2014-01-01'), -(150,150,0,0,NULL,'2014-01-01'), -(151,151,0,0,NULL,'2014-01-01'), -(152,152,0,0,NULL,'2014-01-01'), -(153,153,0,0,NULL,'2014-01-01'), -(154,154,0,0,NULL,'2014-01-01'), -(155,155,0,0,NULL,'2014-01-01'), -(156,156,0,0,NULL,'2014-01-01'), -(157,157,0,0,NULL,'2014-01-01'), -(158,158,0,0,NULL,'2014-01-01'), -(159,159,0,0,NULL,'2014-01-01'), -(160,160,0,0,NULL,'2014-01-01'), -(161,161,0,0,NULL,'2014-01-01'), -(162,162,0,0,NULL,'2014-01-01'), -(163,163,0,0,NULL,'2014-01-01'), -(164,164,0,0,NULL,'2014-01-01'), -(165,165,0,0,NULL,'2014-01-01'), -(166,166,0,0,NULL,'2014-01-01'), -(167,167,0,0,NULL,'2014-01-01'), -(168,168,0,0,NULL,'2014-01-01'), -(169,169,0,0,NULL,'2014-01-01'), -(170,170,0,0,NULL,'2014-01-01'), -(171,171,0,0,NULL,'2014-01-01'), -(172,172,0,0,NULL,'2014-01-01'), -(173,173,0,0,NULL,'2014-01-01'), -(174,174,0,0,NULL,'2014-01-01'), -(175,175,0,0,NULL,'2014-01-01'), -(176,176,0,0,NULL,'2014-01-01'), -(177,177,0,0,NULL,'2014-01-01'), -(178,178,0,0,NULL,'2014-01-01'), -(179,179,0,0,NULL,'2014-01-01'), -(180,180,0,0,NULL,'2014-01-01'), -(181,181,0,0,NULL,'2014-01-01'), -(182,182,0,0,NULL,'2014-01-01'), -(183,183,0,0,NULL,'2014-01-01'), -(184,184,0,0,NULL,'2014-01-01'), -(185,185,0,0,NULL,'2014-01-01'), -(186,186,0,0,NULL,'2014-01-01'), -(187,187,0,0,NULL,'2014-01-01'), -(188,188,0,0,NULL,'2014-01-01'), -(189,189,0,0,NULL,'2014-01-01'), -(190,190,0,0,NULL,'2014-01-01'), -(191,191,0,0,NULL,'2014-01-01'); +INSERT INTO taxkeys (taxkey_id, tax_id, chart_id, startdate) SELECT 0, (SELECT tax.id FROM tax WHERE taxkey=0), chart.id, '2011-01-01' FROM chart WHERE taxkey_id=0; +INSERT INTO taxkeys (taxkey_id, tax_id, chart_id, startdate) SELECT 1, (SELECT tax.id FROM tax WHERE taxkey=1), chart.id, '2011-01-01' FROM chart WHERE taxkey_id=1; +INSERT INTO taxkeys (taxkey_id, tax_id, chart_id, startdate) SELECT 2, (SELECT tax.id FROM tax WHERE taxkey=2), chart.id, '2011-01-01' FROM chart WHERE taxkey_id=2; +INSERT INTO taxkeys (taxkey_id, tax_id, chart_id, startdate) SELECT 3, (SELECT tax.id FROM tax WHERE taxkey=3), chart.id, '2011-01-01' FROM chart WHERE taxkey_id=3; +INSERT INTO taxkeys (taxkey_id, tax_id, chart_id, startdate) SELECT 4, (SELECT tax.id FROM tax WHERE taxkey=4), chart.id, '2011-01-01' FROM chart WHERE taxkey_id=4; +INSERT INTO taxkeys (taxkey_id, tax_id, chart_id, startdate) SELECT 5, (SELECT tax.id FROM tax WHERE taxkey=5), chart.id, '2011-01-01' FROM chart WHERE taxkey_id=5; +INSERT INTO taxkeys (taxkey_id, tax_id, chart_id, startdate) SELECT 6, (SELECT tax.id FROM tax WHERE taxkey=6), chart.id, '2011-01-01' FROM chart WHERE taxkey_id=6; +INSERT INTO taxkeys (taxkey_id, tax_id, chart_id, startdate) SELECT 7, (SELECT tax.id FROM tax WHERE taxkey=7), chart.id, '2011-01-01' FROM chart WHERE taxkey_id=7; + DELETE FROM units; @@ -462,3 +276,37 @@ INSERT INTO units (name, base_unit, factor, type) VALUES ('Mt','Wo',4.00000,'service'), ('Jahr','Mt',12.00000,'service'); + +DELETE FROM defaults; + +INSERT INTO defaults ( + inventory_accno_id, + income_accno_id, expense_accno_id, + fxgain_accno_id, fxloss_accno_id, + invnumber, sonumber, + weightunit, + businessnumber, + version, + closedto, + revtrans, + ponumber, sqnumber, rfqnumber, + customernumber, vendornumber, + audittrail, + articlenumber, servicenumber, + rmanumber, cnnumber +) VALUES ( + (SELECT id FROM CHART WHERE accno='1200'), + (SELECT id FROM CHART WHERE accno='3200'), (SELECT id FROM CHART WHERE accno='4200'), + (SELECT id FROM CHART WHERE accno='6952'), (SELECT id FROM CHART WHERE accno='6942'), + 0, 0, + 'kg', + '', + '3.1.0 CH', + NULL, + FALSE, + 0, 0, 0, + 0, 0, + FALSE, + 0, 0, + 0, 0 +); diff --git a/t/000setup_database.t b/t/000setup_database.t index 3d5ca6c7a..affd47794 100755 --- a/t/000setup_database.t +++ b/t/000setup_database.t @@ -14,7 +14,6 @@ use SL::InstanceConfiguration; use SL::LXDebug; use SL::Layout::None; use SL::LxOfficeConf; -use XML::LibXML; our ($db_cfg, $dbh); @@ -145,6 +144,30 @@ sub apply_upgrades { my @unapplied_scripts = $dbupdater->unapplied_upgrade_scripts($dbh); apply_dbupgrade($dbupdater, $_) for @unapplied_scripts; + + # some dpupgrades are hardcoded for Germany and will be recovered by the same nasty code + if ((not defined $params{auth}) && ($::lx_office_conf{system}->{default_manager} eq "swiss")) { + # buchungsgruppen_sortkey.sql depends release_2_4_1 + dbh_do($dbh, qq|UPDATE buchungsgruppen SET sortkey=1 WHERE description='Standard 8%'|); + dbh_do($dbh, qq|UPDATE buchungsgruppen SET sortkey=2 WHERE description='Standard 2.5%'|); + # steuerfilterung.pl depends release_3_0_0 + dbh_do($dbh, qq|ALTER TABLE tax ADD chart_categories TEXT|); + dbh_do($dbh, qq|UPDATE tax SET chart_categories = 'I' WHERE (taxnumber='2200') OR (taxnumber='2201')|); + dbh_do($dbh, qq|UPDATE tax SET chart_categories = 'E' WHERE (taxnumber='1170') OR (taxnumber='1171')|); + dbh_do($dbh, qq|UPDATE tax SET chart_categories = 'ALQCIE' WHERE chart_categories IS NULL|); + dbh_do($dbh, qq|ALTER TABLE tax ALTER COLUMN chart_categories SET NOT NULL|); + # taxzone_id_in_oe_delivery_orders.sql depends release_3_1_0 + dbh_do($dbh, qq|UPDATE oe SET taxzone_id = (SELECT id FROM tax_zones WHERE description = 'Schweiz') WHERE (taxzone_id = 0) OR (taxzone_id IS NULL)|); + dbh_do($dbh, qq|UPDATE delivery_orders SET taxzone_id = (SELECT id FROM tax_zones WHERE description = 'Schweiz') WHERE (taxzone_id = 0) OR (taxzone_id IS NULL)|); + dbh_do($dbh, qq|UPDATE ar SET taxzone_id = (SELECT id FROM tax_zones WHERE description = 'Schweiz') WHERE (taxzone_id = 0) OR (taxzone_id IS NULL)|); + dbh_do($dbh, qq|UPDATE ap SET taxzone_id = (SELECT id FROM tax_zones WHERE description = 'Schweiz') WHERE (taxzone_id = 0) OR (taxzone_id IS NULL)|); + # tax_skonto_automatic.sql depends release_3_2_0 + dbh_do($dbh, qq|UPDATE tax SET skonto_purchase_chart_id = (SELECT id FROM chart WHERE accno = '4900')|); + dbh_do($dbh, qq|UPDATE tax SET skonto_sales_chart_id = (SELECT id FROM chart WHERE accno = '3800')|); + # not available + dbh_do($dbh, qq|UPDATE defaults SET rndgain_accno_id = (SELECT id FROM CHART WHERE accno='6953')|); + dbh_do($dbh, qq|UPDATE defaults SET rndloss_accno_id = (SELECT id FROM CHART WHERE accno='6943')|); + } } sub create_client_user_and_employee { diff --git a/t/background_job/create_periodic_invoices.t b/t/background_job/create_periodic_invoices.t index 9f55a0c94..cfb0ac6f2 100644 --- a/t/background_job/create_periodic_invoices.t +++ b/t/background_job/create_periodic_invoices.t @@ -14,6 +14,7 @@ sub today_local { package main; +use SL::LxOfficeConf; use Test::More tests => 80; use lib 't'; @@ -37,12 +38,21 @@ Support::TestSetup::login(); our ($ar_chart, $buchungsgruppe, $currency_id, $customer, $employee, $order, $part, $tax_zone, $unit, @invoices); sub init_common_state { - $ar_chart = SL::DB::Manager::Chart->find_by(accno => '1400') || croak "No AR chart"; - $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%') || croak "No accounting group"; - $currency_id = SL::DB::Default->get->currency_id; - $employee = SL::DB::Manager::Employee->current || croak "No employee"; - $tax_zone = SL::DB::Manager::TaxZone->find_by( description => 'Inland') || croak "No taxzone"; - $unit = SL::DB::Manager::Unit->find_by(name => 'psch') || croak "No unit"; + if ($::lx_office_conf{system}->{default_manager} eq "swiss") { + $ar_chart = SL::DB::Manager::Chart->find_by(accno => '3200') || croak "No AR chart"; + $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 8%') || croak "No accounting group"; + $currency_id = SL::DB::Default->get->currency_id; + $employee = SL::DB::Manager::Employee->current || croak "No employee"; + $tax_zone = SL::DB::Manager::TaxZone->find_by( description => 'Schweiz') || croak "No taxzone"; + $unit = SL::DB::Manager::Unit->find_by(name => 'pauschal') || croak "No unit"; + } else { + $ar_chart = SL::DB::Manager::Chart->find_by(accno => '1400') || croak "No AR chart"; + $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%') || croak "No accounting group"; + $currency_id = SL::DB::Default->get->currency_id; + $employee = SL::DB::Manager::Employee->current || croak "No employee"; + $tax_zone = SL::DB::Manager::TaxZone->find_by( description => 'Inland') || croak "No taxzone"; + $unit = SL::DB::Manager::Unit->find_by(name => 'psch') || croak "No unit"; + } } sub clear_up { diff --git a/t/controllers/financial_controlling/sales_order_with_periodic_invoices_config.t b/t/controllers/financial_controlling/sales_order_with_periodic_invoices_config.t index 1dab1e8f0..83fd05b57 100644 --- a/t/controllers/financial_controlling/sales_order_with_periodic_invoices_config.t +++ b/t/controllers/financial_controlling/sales_order_with_periodic_invoices_config.t @@ -38,12 +38,21 @@ Support::TestSetup::login(); our ($ar_chart, $buchungsgruppe, $ctrl, $currency_id, $customer, $employee, $order, $part, $tax_zone, $unit, @invoices); sub init_common_state { - $ar_chart = SL::DB::Manager::Chart->find_by(accno => '1400') || croak "No AR chart"; - $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%') || croak "No accounting group"; - $currency_id = SL::DB::Default->get->currency_id; - $employee = SL::DB::Manager::Employee->current || croak "No employee"; - $tax_zone = SL::DB::Manager::TaxZone->find_by( description => 'Inland') || croak "No taxzone"; - $unit = SL::DB::Manager::Unit->find_by(name => 'psch') || croak "No unit"; + if ($::lx_office_conf{system}->{default_manager} eq "swiss") { + $ar_chart = SL::DB::Manager::Chart->find_by(accno => '3200') || croak "No AR chart"; + $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 8%') || croak "No accounting group"; + $currency_id = SL::DB::Default->get->currency_id; + $employee = SL::DB::Manager::Employee->current || croak "No employee"; + $tax_zone = SL::DB::Manager::TaxZone->find_by( description => 'Schweiz') || croak "No taxzone"; + $unit = SL::DB::Manager::Unit->find_by(name => 'pauschal') || croak "No unit"; + } else { + $ar_chart = SL::DB::Manager::Chart->find_by(accno => '1400') || croak "No AR chart"; + $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%') || croak "No accounting group"; + $currency_id = SL::DB::Default->get->currency_id; + $employee = SL::DB::Manager::Employee->current || croak "No employee"; + $tax_zone = SL::DB::Manager::TaxZone->find_by( description => 'Inland') || croak "No taxzone"; + $unit = SL::DB::Manager::Unit->find_by(name => 'psch') || croak "No unit"; + } } sub create_sales_order { diff --git a/t/controllers/financial_overview/sales_orders.t b/t/controllers/financial_overview/sales_orders.t index 8994faddf..34e1182b8 100644 --- a/t/controllers/financial_overview/sales_orders.t +++ b/t/controllers/financial_overview/sales_orders.t @@ -42,12 +42,21 @@ sub clear_up { }; sub init_common_state { - $ar_chart = SL::DB::Manager::Chart->find_by(accno => '1400') || croak "No AR chart"; - $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%') || croak "No accounting group"; - $currency_id = SL::DB::Default->get->currency_id; - $employee = SL::DB::Manager::Employee->current || croak "No employee"; - $tax_zone = SL::DB::Manager::TaxZone->find_by( description => 'Inland') || croak "No taxzone"; - $unit = SL::DB::Manager::Unit->find_by(name => 'psch') || croak "No unit"; + if ($::lx_office_conf{system}->{default_manager} eq "swiss") { + $ar_chart = SL::DB::Manager::Chart->find_by(accno => '3200') || croak "No AR chart"; + $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 8%') || croak "No accounting group"; + $currency_id = SL::DB::Default->get->currency_id; + $employee = SL::DB::Manager::Employee->current || croak "No employee"; + $tax_zone = SL::DB::Manager::TaxZone->find_by( description => 'Schweiz') || croak "No taxzone"; + $unit = SL::DB::Manager::Unit->find_by(name => 'pauschal') || croak "No unit"; + } else { + $ar_chart = SL::DB::Manager::Chart->find_by(accno => '1400') || croak "No AR chart"; + $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%') || croak "No accounting group"; + $currency_id = SL::DB::Default->get->currency_id; + $employee = SL::DB::Manager::Employee->current || croak "No employee"; + $tax_zone = SL::DB::Manager::TaxZone->find_by( description => 'Inland') || croak "No taxzone"; + $unit = SL::DB::Manager::Unit->find_by(name => 'psch') || croak "No unit"; + } } sub create_sales_order { diff --git a/t/db_helper/acts_as_list.t b/t/db_helper/acts_as_list.t index a91724cce..482966ede 100644 --- a/t/db_helper/acts_as_list.t +++ b/t/db_helper/acts_as_list.t @@ -30,7 +30,11 @@ my ($customer, $taxzone, $status, $type, $r_spec, @items); sub init { - $taxzone = SL::DB::Manager::TaxZone->find_by( description => 'Inland') || croak "No taxzone"; + if ($::lx_office_conf{system}->{default_manager} eq "swiss") { + $taxzone = SL::DB::Manager::TaxZone->find_by( description => 'Schweiz') || croak "No taxzone"; + } else { + $taxzone = SL::DB::Manager::TaxZone->find_by( description => 'Inland') || croak "No taxzone"; + } $customer = SL::DB::Customer->new(name => 'Test Customer', currency_id => $::instance_conf->get_currency_id, taxzone_id => $taxzone->id)->save; $status = SL::DB::Manager::RequirementSpecStatus->find_by(name => '', description => '') || SL::DB::RequirementSpecStatus->new(name => '', description => '', position => 0)->save; diff --git a/t/db_helper/convert_invoice.t b/t/db_helper/convert_invoice.t index bfc538b29..dc2135261 100644 --- a/t/db_helper/convert_invoice.t +++ b/t/db_helper/convert_invoice.t @@ -41,13 +41,23 @@ sub reset_state { clear_up(); - $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%', %{ $params{buchungsgruppe} }) || croak "No accounting group 19\%"; - $buchungsgruppe7 = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 7%', %{ $params{buchungsgruppe} }) || croak "No accounting group 7\%"; - $taxzone = SL::DB::Manager::TaxZone->find_by( description => 'Inland') || croak "No taxzone"; - $tax = SL::DB::Manager::Tax->find_by(taxkey => 3, rate => 0.19, %{ $params{tax} }) || croak "No tax for 19\%"; - $tax7 = SL::DB::Manager::Tax->find_by(taxkey => 2, rate => 0.07) || croak "No tax for 7\%"; - $unit = SL::DB::Manager::Unit->find_by(name => 'kg', %{ $params{unit} }) || croak "No unit"; - $currency_id = $::instance_conf->get_currency_id; + if ($::lx_office_conf{system}->{default_manager} eq "swiss") { + $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 8%', %{ $params{buchungsgruppe} }) || croak "No accounting group 8\%"; + $buchungsgruppe7 = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 2.5%', %{ $params{buchungsgruppe} })|| croak "No accounting group 2.5\%"; + $taxzone = SL::DB::Manager::TaxZone->find_by( description => 'Schweiz') || croak "No taxzone"; + $tax = SL::DB::Manager::Tax->find_by(taxkey => 2, rate => 0.08, %{ $params{tax} }) || croak "No tax for 8\%"; + $tax7 = SL::DB::Manager::Tax->find_by(taxkey => 3, rate => 0.025) || croak "No tax for 2.5\%"; + $unit = SL::DB::Manager::Unit->find_by(name => 'kg', %{ $params{unit} }) || croak "No unit"; + $currency_id = $::instance_conf->get_currency_id; + } else { + $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%', %{ $params{buchungsgruppe} }) || croak "No accounting group 19\%"; + $buchungsgruppe7 = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 7%', %{ $params{buchungsgruppe} }) || croak "No accounting group 7\%"; + $taxzone = SL::DB::Manager::TaxZone->find_by( description => 'Inland') || croak "No taxzone"; + $tax = SL::DB::Manager::Tax->find_by(taxkey => 3, rate => 0.19, %{ $params{tax} }) || croak "No tax for 19\%"; + $tax7 = SL::DB::Manager::Tax->find_by(taxkey => 2, rate => 0.07) || croak "No tax for 7\%"; + $unit = SL::DB::Manager::Unit->find_by(name => 'kg', %{ $params{unit} }) || croak "No unit"; + $currency_id = $::instance_conf->get_currency_id; + } $customer = SL::DB::Customer->new( name => '520484567dfaedc9e60fc', @@ -275,7 +285,11 @@ $invoice->load; ok($invoice->currency_id eq '1', 'currency_id'); ok($invoice->cusordnumber eq 'b84da', 'cusordnumber check'); ok(SL::DB::Department->new(id => $invoice->{department_id})->load->description eq "Maisenhaus-Versand", 'department description'); -is($invoice->amount, '1354.17000', 'amount check'); +if ($::lx_office_conf{system}->{default_manager} eq "swiss") { + is($invoice->amount, '1229.00000', 'amount check'); +} else { + is($invoice->amount, '1354.17000', 'amount check'); +} is($invoice->marge_percent, '50.88580', 'marge percent check'); is($invoice->marge_total, '579.06000', 'marge total check'); is($invoice->netamount, '1137.96000', 'netamount check'); diff --git a/t/db_helper/payment.t b/t/db_helper/payment.t index 718f537db..3e4d0a34e 100644 --- a/t/db_helper/payment.t +++ b/t/db_helper/payment.t @@ -22,7 +22,10 @@ use SL::DB::TaxZone; use SL::DB::BankAccount; use SL::DB::PaymentTerm; -my ($customer, $vendor, $currency_id, @parts, $buchungsgruppe, $buchungsgruppe7, $unit, $employee, $tax, $tax7, $taxzone, $payment_terms, $bank_account); +my $default_manager; +my ($customer, $vendor, $currency_id, @parts, $buchungsgruppe, $buchungsgruppe7, $unit, $employee, $tax, $tax7, $taxzone, + $bank_chart, $expense_chart, $tax_chart, $expense_chart7, $tax_chart7, $arap_chart, + $payment_terms, $bank_account); my $ALWAYS_RESET = 1; @@ -50,14 +53,36 @@ sub reset_state { clear_up(); - - $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%', %{ $params{buchungsgruppe} }) || croak "No accounting group"; - $buchungsgruppe7 = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 7%') || croak "No accounting group for 7\%"; - $unit = SL::DB::Manager::Unit->find_by(name => 'kg', %{ $params{unit} }) || croak "No unit"; - $employee = SL::DB::Manager::Employee->current || croak "No employee"; - $tax = SL::DB::Manager::Tax->find_by(taxkey => 3, rate => 0.19, %{ $params{tax} }) || croak "No tax"; - $tax7 = SL::DB::Manager::Tax->find_by(taxkey => 2, rate => 0.07) || croak "No tax for 7\%"; - $taxzone = SL::DB::Manager::TaxZone->find_by( description => 'Inland') || croak "No taxzone"; + $default_manager = $::lx_office_conf{system}->{default_manager}; + if ($default_manager eq "swiss") { + $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 8%', %{ $params{buchungsgruppe} }) || croak "No accounting group for 8\%"; + $buchungsgruppe7 = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 2.5%') || croak "No accounting group for 2.5\%"; + $unit = SL::DB::Manager::Unit->find_by(name => 'kg', %{ $params{unit} }) || croak "No unit"; + $employee = SL::DB::Manager::Employee->current || croak "No employee"; + $tax = SL::DB::Manager::Tax->find_by(taxkey => 2, rate => 0.08, %{ $params{tax} }) || croak "No tax for 8\%"; + $tax7 = SL::DB::Manager::Tax->find_by(taxkey => 3, rate => 0.025) || croak "No tax for 2.5\%"; + $taxzone = SL::DB::Manager::TaxZone->find_by( description => 'Schweiz') || croak "No taxzone"; + $bank_chart = SL::DB::Manager::Chart->find_by( description => 'Kasse' ) || croak "No bank-account"; + $expense_chart = SL::DB::Manager::Chart->find_by(accno => '4200') || croak "No expense-account for 8\%"; + $tax_chart = SL::DB::Manager::Chart->find_by(accno => '1170') || croak "No tax-account for 8\%"; + $expense_chart7 = SL::DB::Manager::Chart->find_by(accno => '4201') || croak "No expense-account for 2.5\%"; + $tax_chart7 = SL::DB::Manager::Chart->find_by(accno => '1170') || croak "No tax-account for 2.5\%"; + $arap_chart = SL::DB::Manager::Chart->find_by(accno => '2000') || croak "No arap-account"; + } else { + $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%', %{ $params{buchungsgruppe} }) || croak "No accounting group"; + $buchungsgruppe7 = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 7%') || croak "No accounting group for 7\%"; + $unit = SL::DB::Manager::Unit->find_by(name => 'kg', %{ $params{unit} }) || croak "No unit"; + $employee = SL::DB::Manager::Employee->current || croak "No employee"; + $tax = SL::DB::Manager::Tax->find_by(taxkey => 3, rate => 0.19, %{ $params{tax} }) || croak "No tax"; + $tax7 = SL::DB::Manager::Tax->find_by(taxkey => 2, rate => 0.07) || croak "No tax for 7\%"; + $taxzone = SL::DB::Manager::TaxZone->find_by( description => 'Inland') || croak "No taxzone"; + $bank_chart = SL::DB::Manager::Chart->find_by( description => 'Bank' ) || croak "No bankaccount"; + $expense_chart = SL::DB::Manager::Chart->find_by(accno => '3400') || croak "No expense-account for 16\%"; + $tax_chart = SL::DB::Manager::Chart->find_by(accno => '1576') || croak "No tax-account for 19\%"; + $expense_chart7 = SL::DB::Manager::Chart->find_by(accno => '3300') || croak "No expense-account for 7\%"; + $tax_chart7 = SL::DB::Manager::Chart->find_by(accno => '1571') || croak "No tax-account for 7\%"; + $arap_chart = SL::DB::Manager::Chart->find_by(accno => '1600') || croak "No arap-account"; + } $currency_id = $::instance_conf->get_currency_id; @@ -74,8 +99,8 @@ sub reset_state { iban => '123', bic => '123', bank => '123', - chart_id => SL::DB::Manager::Chart->find_by( description => 'Bank' )->id, - name => SL::DB::Manager::Chart->find_by( description => 'Bank' )->description, + chart_id => $bank_chart->id, + name => $bank_chart->description, )->save; $payment_terms = SL::DB::PaymentTerm->new( @@ -173,14 +198,13 @@ sub new_purchase_invoice { invoice => 0, type => 'invoice', taxincluded => 0, - amount => '226', + amount => $default_manager eq "swiss" ? '210.5' : '226', netamount => '200', paid => '0', # %params, )->save; my $today = DateTime->today_local->to_kivitendo; - my $expense_chart = SL::DB::Manager::Chart->find_by(accno => '3400'); my $expense_chart_booking= SL::DB::AccTransaction->new( trans_id => $purchase_invoice->id, chart_id => $expense_chart->id, @@ -188,50 +212,46 @@ sub new_purchase_invoice { amount => '-100', transdate => $today, source => '', - taxkey => 9, - tax_id => SL::DB::Manager::Tax->find_by(taxkey => 9)->id); + taxkey => $default_manager eq "swiss" ? 4 : 9, + tax_id => SL::DB::Manager::Tax->find_by(taxkey => $default_manager eq "swiss" ? 4 : 9)->id); $expense_chart_booking->save; - my $tax_chart = SL::DB::Manager::Chart->find_by(accno => '1576'); my $tax_chart_booking= SL::DB::AccTransaction->new( trans_id => $purchase_invoice->id, chart_id => $tax_chart->id, chart_link => $tax_chart->link, - amount => '-19', + amount => $default_manager eq "swiss" ? '-8' : '-19', transdate => $today, source => '', taxkey => 0, - tax_id => SL::DB::Manager::Tax->find_by(taxkey => 9)->id); + tax_id => SL::DB::Manager::Tax->find_by(taxkey => $default_manager eq "swiss" ? 4 : 9)->id); $tax_chart_booking->save; - $expense_chart = SL::DB::Manager::Chart->find_by(accno => '3300'); $expense_chart_booking= SL::DB::AccTransaction->new( trans_id => $purchase_invoice->id, - chart_id => $expense_chart->id, - chart_link => $expense_chart->link, + chart_id => $expense_chart7->id, + chart_link => $expense_chart7->link, amount => '-100', transdate => $today, source => '', - taxkey => 8, - tax_id => SL::DB::Manager::Tax->find_by(taxkey => 8)->id); + taxkey => $default_manager eq "swiss" ? 5 : 8, + tax_id => SL::DB::Manager::Tax->find_by(taxkey => $default_manager eq "swiss" ? 5 : 8)->id); $expense_chart_booking->save; - $tax_chart = SL::DB::Manager::Chart->find_by(accno => '1571'); $tax_chart_booking= SL::DB::AccTransaction->new( trans_id => $purchase_invoice->id, - chart_id => $tax_chart->id, - chart_link => $tax_chart->link, - amount => '-7', + chart_id => $tax_chart7->id, + chart_link => $tax_chart7->link, + amount => $default_manager eq "swiss" ? '-2.5' : '-7', transdate => $today, source => '', taxkey => 0, - tax_id => SL::DB::Manager::Tax->find_by(taxkey => 8)->id); + tax_id => SL::DB::Manager::Tax->find_by(taxkey => $default_manager eq "swiss" ? 5 : 8)->id); $tax_chart_booking->save; - my $arap_chart = SL::DB::Manager::Chart->find_by(accno => '1600'); my $arap_booking= SL::DB::AccTransaction->new(trans_id => $purchase_invoice->id, chart_id => $arap_chart->id, chart_link => $arap_chart->link, - amount => '226', + amount => $default_manager eq "swiss" ? '210.5' : '226', transdate => $today, source => '', taxkey => 0, @@ -300,7 +320,7 @@ sub test_default_invoice_one_item_19_without_skonto() { transdate => DateTime->today_local->to_kivitendo ); - $params{amount} = '6.96'; + $params{amount} = $default_manager eq "swiss" ? '6.32' : '6.96'; $params{payment_type} = 'without_skonto'; $invoice->pay_invoice( %params ); @@ -308,14 +328,20 @@ sub test_default_invoice_one_item_19_without_skonto() { my ($number_of_payments, $paid_amount) = number_of_payments($invoice->transactions); my $total = total_amount($invoice->transactions); - my $title = 'default invoice, one item, 19% tax, without_skonto'; - - is($invoice->netamount, 5.85, "${title}: netamount"); - is($invoice->amount, 6.96, "${title}: amount"); - is($paid_amount, -6.96, "${title}: paid amount"); - is($number_of_payments, 1, "${title}: 1 AR_paid booking"); - is($invoice->paid, 6.96, "${title}: paid"); - is($total, 0, "${title}: even balance"); + my $title = $default_manager eq "swiss" ? 'default invoice, one item, 8% tax, without_skonto' : 'default invoice, one item, 19% tax, without_skonto'; + + is($invoice->netamount, 5.85, "${title}: netamount"); + if ($default_manager eq "swiss") { + is($invoice->amount, 6.32, "${title}: amount"); + is($paid_amount, -6.32, "${title}: paid amount"); + is($invoice->paid, 6.32, "${title}: paid"); + } else { + is($invoice->amount, 6.96, "${title}: amount"); + is($paid_amount, -6.96, "${title}: paid amount"); + is($invoice->paid, 6.96, "${title}: paid"); + } + is($number_of_payments, 1, "${title}: 1 AR_paid booking"); + is($total, 0, "${title}: even balance"); } @@ -338,7 +364,7 @@ sub test_default_invoice_one_item_19_without_skonto_overpaid() { transdate => DateTime->today_local->to_kivitendo ); - $params{amount} = '16.96'; + $params{amount} = $default_manager eq "swiss" ? '16.32' : '16.96'; $params{payment_type} = 'without_skonto'; $invoice->pay_invoice( %params ); @@ -348,14 +374,20 @@ sub test_default_invoice_one_item_19_without_skonto_overpaid() { my ($number_of_payments, $paid_amount) = number_of_payments($invoice->transactions); my $total = total_amount($invoice->transactions); - my $title = 'default invoice, one item, 19% tax, without_skonto'; - - is($invoice->netamount, 5.85, "${title}: netamount"); - is($invoice->amount, 6.96, "${title}: amount"); - is($paid_amount, -6.96, "${title}: paid amount"); - is($number_of_payments, 2, "${title}: 1 AR_paid booking"); - is($invoice->paid, 6.96, "${title}: paid"); - is($total, 0, "${title}: even balance"); + my $title = $default_manager eq "swiss" ? 'default invoice, one item, 8% tax, without_skonto_overpaid' : 'default invoice, one item, 19% tax, without_skonto_overpaid'; + + is($invoice->netamount, 5.85, "${title}: netamount"); + if ($default_manager eq "swiss") { + is($invoice->amount, 6.32, "${title}: amount"); + is($paid_amount, -6.32, "${title}: paid amount"); + is($invoice->paid, 6.32, "${title}: paid"); + } else { + is($invoice->amount, 6.96, "${title}: amount"); + is($paid_amount, -6.96, "${title}: paid amount"); + is($invoice->paid, 6.96, "${title}: paid"); + } + is($number_of_payments, 2, "${title}: 1 AR_paid booking"); + is($total, 0, "${title}: even balance"); } @@ -386,14 +418,20 @@ sub test_default_invoice_two_items_19_7_tax_with_skonto() { my ($number_of_payments, $paid_amount) = number_of_payments($invoice->transactions); my $total = total_amount($invoice->transactions); - my $title = 'default invoice, two items, 19/7% tax with_skonto_pt'; - - is($invoice->netamount, 5.85 + 11.66, "${title}: netamount"); - is($invoice->amount, 6.96 + 12.48, "${title}: amount"); - is($paid_amount, -19.44, "${title}: paid amount"); - is($invoice->paid, 19.44, "${title}: paid"); - is($number_of_payments, 3, "${title}: 3 AR_paid bookings"); - is($total, 0, "${title}: even balance"); + my $title = $default_manager eq "swiss" ? 'default invoice, two items, 8/2.5% tax with_skonto_pt' : 'default invoice, two items, 19/7% tax with_skonto_pt'; + + is($invoice->netamount, 5.85 + 11.66, "${title}: netamount"); + if ($default_manager eq "swiss") { + is($invoice->amount, 6.32 + 11.95, "${title}: amount"); + is($paid_amount, -18.27, "${title}: paid amount"); + is($invoice->paid, 18.27, "${title}: paid"); + } else { + is($invoice->amount, 6.96 + 12.48, "${title}: amount"); + is($paid_amount, -19.44, "${title}: paid amount"); + is($invoice->paid, 19.44, "${title}: paid"); + } + is($number_of_payments, 3, "${title}: 3 AR_paid bookings"); + is($total, 0, "${title}: even balance"); } sub test_default_invoice_two_items_19_7_tax_with_skonto_tax_included() { @@ -421,15 +459,19 @@ sub test_default_invoice_two_items_19_7_tax_with_skonto_tax_included() { my ($number_of_payments, $paid_amount) = number_of_payments($invoice->transactions); my $total = total_amount($invoice->transactions); - my $title = 'default invoice, two items, 19/7% tax with_skonto_pt'; + my $title = $default_manager eq "swiss" ? 'default invoice, two items, 8/2.5% tax with_skonto_pt' : 'default invoice, two items, 19/7% tax with_skonto_pt'; - is($invoice->netamount, 15.82, "${title}: netamount"); + if ($default_manager eq "swiss") { + is($invoice->netamount, 16.80, "${title}: netamount"); + } else { + is($invoice->netamount, 15.82, "${title}: netamount"); + } is($invoice->amount, 17.51, "${title}: amount"); is($paid_amount, -17.51, "${title}: paid amount"); is($invoice->paid, 17.51, "${title}: paid"); is($number_of_payments, 3, "${title}: 3 AR_paid bookings"); { local $TODO = "currently this test fails because the code writing the invoice is buggy, the calculation of skonto is correct"; - is($total, 0, "${title}: even balance"); + is($total, 0, "${title}: even balance"); } } @@ -451,7 +493,7 @@ sub test_default_invoice_two_items_19_7_without_skonto() { transdate => DateTime->today_local->to_kivitendo ); - $params{amount} = '19.44'; # pass full amount + $params{amount} = $default_manager eq "swiss" ? '18.27' : '19.44'; # pass full amount $params{payment_type} = 'without_skonto'; $invoice->pay_invoice( %params ); @@ -459,14 +501,20 @@ sub test_default_invoice_two_items_19_7_without_skonto() { my ($number_of_payments, $paid_amount) = number_of_payments($invoice->transactions); my $total = total_amount($invoice->transactions); - my $title = 'default invoice, two items, 19/7% tax without skonto'; - - is($invoice->netamount, 5.85 + 11.66, "${title}: netamount"); - is($invoice->amount, 6.96 + 12.48, "${title}: amount"); - is($paid_amount, -19.44, "${title}: paid amount"); - is($invoice->paid, 19.44, "${title}: paid"); - is($number_of_payments, 1, "${title}: 1 AR_paid bookings"); - is($total, 0, "${title}: even balance"); + my $title = $default_manager eq "swiss" ? 'default invoice, two items, 8/2.5% tax without skonto' : 'default invoice, two items, 19/7% tax without skonto'; + + is($invoice->netamount, 5.85 + 11.66, "${title}: netamount"); + if ($default_manager eq "swiss") { + is($invoice->amount, 6.32 + 11.95, "${title}: amount"); + is($paid_amount, -18.27, "${title}: paid amount"); + is($invoice->paid, 18.27, "${title}: paid"); + } else { + is($invoice->amount, 6.96 + 12.48, "${title}: amount"); + is($paid_amount, -19.44, "${title}: paid amount"); + is($invoice->paid, 19.44, "${title}: paid"); + } + is($number_of_payments, 1, "${title}: 1 AR_paid bookings"); + is($total, 0, "${title}: even balance"); } # test 4 @@ -482,7 +530,7 @@ sub test_default_invoice_two_items_19_7_without_skonto_incomplete_payment() { ); $invoice->post; - $invoice->pay_invoice( amount => '9.44', + $invoice->pay_invoice( amount => $default_manager eq "swiss" ? '8.27' : '9.44', payment_type => 'without_skonto', chart_id => $bank_account->chart_id, transdate => DateTime->today_local->to_kivitendo, @@ -491,14 +539,20 @@ sub test_default_invoice_two_items_19_7_without_skonto_incomplete_payment() { my ($number_of_payments, $paid_amount) = number_of_payments($invoice->transactions); my $total = total_amount($invoice->transactions); - my $title = 'default invoice, two items, 19/7% tax without skonto incomplete payment'; - - is($invoice->netamount, 5.85 + 11.66, "${title}: netamount"); - is($invoice->amount, 6.96 + 12.48, "${title}: amount"); - is($paid_amount, -9.44, "${title}: paid amount"); - is($invoice->paid, 9.44, "${title}: paid"); - is($number_of_payments, 1, "${title}: 1 AR_paid bookings"); - is($total, 0, "${title}: even balance"); + my $title = $default_manager eq "swiss" ? 'default invoice, two items, 8/2.5% tax without skonto incomplete payment' : 'default invoice, two items, 19/7% tax without skonto incomplete payment'; + + is($invoice->netamount, 5.85 + 11.66, "${title}: netamount"); + if ($default_manager eq "swiss") { + is($invoice->amount, 6.32 + 11.95, "${title}: amount"); + is($paid_amount, -8.27, "${title}: paid amount"); + is($invoice->paid, 8.27, "${title}: paid"); + } else { + is($invoice->amount, 6.96 + 12.48, "${title}: amount"); + is($paid_amount, -9.44, "${title}: paid amount"); + is($invoice->paid, 9.44, "${title}: paid"); + } + is($number_of_payments, 1, "${title}: 1 AR_paid bookings"); + is($total, 0, "${title}: even balance"); } # test 5 @@ -514,7 +568,7 @@ sub test_default_invoice_two_items_19_7_tax_without_skonto_multiple_payments() { ); $invoice->post; - $invoice->pay_invoice( amount => '9.44', + $invoice->pay_invoice( amount => $default_manager eq "swiss" ? '8.27' : '9.44', payment_type => 'without_skonto', chart_id => $bank_account->chart_id, transdate => DateTime->today_local->to_kivitendo @@ -527,14 +581,19 @@ sub test_default_invoice_two_items_19_7_tax_without_skonto_multiple_payments() { my ($number_of_payments, $paid_amount) = number_of_payments($invoice->transactions); my $total = total_amount($invoice->transactions); - my $title = 'default invoice, two items, 19/7% tax not included'; - - is($invoice->netamount, 5.85 + 11.66, "${title}: netamount"); - is($invoice->amount, 6.96 + 12.48, "${title}: amount"); - is($paid_amount, -19.44, "${title}: paid amount"); - is($invoice->paid, 19.44, "${title}: paid"); - is($number_of_payments, 2, "${title}: 2 AR_paid bookings"); - is($total, 0, "${title}: even balance"); + my $title = $default_manager eq "swiss" ? 'default invoice, two items, 8/2.5% tax not included' : 'default invoice, two items, 19/7% tax not included'; + is($invoice->netamount, 5.85 + 11.66, "${title}: netamount"); + if ($default_manager eq "swiss") { + is($invoice->amount, 6.32 + 11.95, "${title}: amount"); + is($paid_amount, -18.27, "${title}: paid amount"); + is($invoice->paid, 18.27, "${title}: paid"); + } else { + is($invoice->amount, 6.96 + 12.48, "${title}: amount"); + is($paid_amount, -19.44, "${title}: paid amount"); + is($invoice->paid, 19.44, "${title}: paid"); + } + is($number_of_payments, 2, "${title}: 2 AR_paid bookings"); + is($total, 0, "${title}: even balance"); } @@ -551,12 +610,12 @@ sub test_default_invoice_two_items_19_7_tax_without_skonto_multiple_payments_fin ); $invoice->post; - $invoice->pay_invoice( amount => '9.44', + $invoice->pay_invoice( amount => $default_manager eq "swiss" ? '8.27' : '9.44', payment_type => 'without_skonto', chart_id => $bank_account->chart_id, transdate => DateTime->today_local->to_kivitendo ); - $invoice->pay_invoice( amount => '8.73', + $invoice->pay_invoice( amount => $default_manager eq "swiss" ? '7.56' : '8.73', payment_type => 'without_skonto', chart_id => $bank_account->chart_id, transdate => DateTime->today_local->to_kivitendo @@ -570,14 +629,20 @@ sub test_default_invoice_two_items_19_7_tax_without_skonto_multiple_payments_fin my ($number_of_payments, $paid_amount) = number_of_payments($invoice->transactions); my $total = total_amount($invoice->transactions); - my $title = 'default invoice, two items, 19/7% tax not included'; - - is($invoice->netamount, 5.85 + 11.66, "${title}: netamount"); - is($invoice->amount, 6.96 + 12.48, "${title}: amount"); - is($paid_amount, -19.44, "${title}: paid amount"); - is($invoice->paid, 19.44, "${title}: paid"); - is($number_of_payments, 4, "${title}: 4 AR_paid bookings"); - is($total, 0, "${title}: even balance"); + my $title = $default_manager eq "swiss" ? 'default invoice, two items, 8/2.5% tax not included' : 'default invoice, two items, 19/7% tax not included'; + + is($invoice->netamount, 5.85 + 11.66, "${title}: netamount"); + if ($default_manager eq "swiss") { + is($invoice->amount, 6.32 + 11.95, "${title}: amount"); + is($paid_amount, -18.27, "${title}: paid amount"); + is($invoice->paid, 18.27, "${title}: paid"); + } else { + is($invoice->amount, 6.96 + 12.48, "${title}: amount"); + is($paid_amount, -19.44, "${title}: paid amount"); + is($invoice->paid, 19.44, "${title}: paid"); + } + is($number_of_payments, 4, "${title}: 4 AR_paid bookings"); + is($total, 0, "${title}: even balance"); } @@ -598,7 +663,7 @@ sub test_default_invoice_two_items_19_7_tax_without_skonto_multiple_payments_fi ); $invoice->post; - $invoice->pay_invoice( amount => '19.42', + $invoice->pay_invoice( amount => $default_manager eq "swiss" ? '18.25' : '19.42', payment_type => 'without_skonto', chart_id => $bank_account->chart_id, transdate => DateTime->today_local->to_kivitendo @@ -612,14 +677,20 @@ sub test_default_invoice_two_items_19_7_tax_without_skonto_multiple_payments_fi my ($number_of_payments, $paid_amount) = number_of_payments($invoice->transactions); my $total = total_amount($invoice->transactions); - my $title = 'default invoice, two items, 19/7% tax not included'; - - is($invoice->netamount, 5.85 + 11.66, "${title}: netamount"); - is($invoice->amount, 6.96 + 12.48, "${title}: amount"); - is($paid_amount, -19.44, "${title}: paid amount"); - is($invoice->paid, 19.44, "${title}: paid"); - is($number_of_payments, 3, "${title}: 2 AR_paid bookings"); - is($total, 0, "${title}: even balance"); + my $title = $default_manager eq "swiss" ? 'default invoice, two items, 8/2.5% tax not included' : 'default invoice, two items, 19/7% tax not included'; + + is($invoice->netamount, 5.85 + 11.66, "${title}: netamount"); + if ($default_manager eq "swiss") { + is($invoice->amount, 6.32 + 11.95, "${title}: amount"); + is($paid_amount, -18.27, "${title}: paid amount"); + is($invoice->paid, 18.27, "${title}: paid"); + } else { + is($invoice->amount, 6.96 + 12.48, "${title}: amount"); + is($paid_amount, -19.44, "${title}: paid amount"); + is($invoice->paid, 19.44, "${title}: paid"); + } + is($number_of_payments, 3, "${title}: 2 AR_paid bookings"); + is($total, 0, "${title}: even balance"); } @@ -636,7 +707,7 @@ sub test_default_invoice_two_items_19_7_tax_without_skonto_multiple_payments_fi ); $invoice->post; - $invoice->pay_invoice( amount => '19.42', + $invoice->pay_invoice( amount => $default_manager eq "swiss" ? '18.25' : '19.42', payment_type => 'without_skonto', chart_id => $bank_account->chart_id, transdate => DateTime->today_local->to_kivitendo @@ -650,14 +721,20 @@ sub test_default_invoice_two_items_19_7_tax_without_skonto_multiple_payments_fi my ($number_of_payments, $paid_amount) = number_of_payments($invoice->transactions); my $total = total_amount($invoice->transactions); - my $title = 'default invoice, two items, 19/7% tax not included'; - - is($invoice->netamount, 5.85 + 11.66, "${title}: netamount"); - is($invoice->amount, 6.96 + 12.48, "${title}: amount"); - is($paid_amount, -19.44, "${title}: paid amount"); - is($invoice->paid, 19.44, "${title}: paid"); - is($number_of_payments, 3, "${title}: 3 AR_paid bookings"); - is($total, 0, "${title}: even balance"); + my $title = $default_manager eq "swiss" ? 'default invoice, two items, 8/2.5% tax not included' : 'default invoice, two items, 19/7% tax not included'; + + is($invoice->netamount, 5.85 + 11.66, "${title}: netamount"); + if ($default_manager eq "swiss") { + is($invoice->amount, 6.32 + 11.95, "${title}: amount"); + is($paid_amount, -18.27, "${title}: paid amount"); + is($invoice->paid, 18.27, "${title}: paid"); + } else { + is($invoice->amount, 6.96 + 12.48, "${title}: amount"); + is($paid_amount, -19.44, "${title}: paid amount"); + is($invoice->paid, 19.44, "${title}: paid"); + } + is($number_of_payments, 3, "${title}: 3 AR_paid bookings"); + is($total, 0, "${title}: even balance"); } @@ -692,13 +769,19 @@ sub test_default_invoice_one_item_19_multiple_payment_final_difference_as_skonto my ($number_of_payments, $paid_amount) = number_of_payments($invoice->transactions); my $total = total_amount($invoice->transactions); - my $title = 'default invoice, one item, 19% tax, without_skonto'; - - is($invoice->netamount, 5.85, "${title}: netamount"); - is($invoice->amount, 6.96, "${title}: amount"); - is($paid_amount, -6.96, "${title}: paid amount"); + my $title = $default_manager eq "swiss" ? 'default invoice, one item, 8% tax, without_skonto' : 'default invoice, one item, 19% tax, without_skonto'; + + is($invoice->netamount, 5.85, "${title}: netamount"); + if ($default_manager eq "swiss") { + is($invoice->amount, 6.32, "${title}: amount"); + is($paid_amount, -6.32, "${title}: paid amount"); + is($invoice->paid, 6.32, "${title}: paid"); + } else { + is($invoice->amount, 6.96, "${title}: amount"); + is($paid_amount, -6.96, "${title}: paid amount"); + is($invoice->paid, 6.96, "${title}: paid"); + } is($number_of_payments, 3, "${title}: 3 AR_paid booking"); - is($invoice->paid, 6.96, "${title}: paid"); is($total, 0, "${title}: even balance"); } @@ -719,7 +802,7 @@ sub test_default_invoice_one_item_19_multiple_payment_final_difference_as_skonto transdate => DateTime->today_local->to_kivitendo ); - $params{amount} = '6.95'; + $params{amount} = $default_manager eq "swiss" ? '6.31' : '6.95'; $params{payment_type} = 'without_skonto'; $invoice->pay_invoice( %params ); @@ -730,13 +813,19 @@ sub test_default_invoice_one_item_19_multiple_payment_final_difference_as_skonto my ($number_of_payments, $paid_amount) = number_of_payments($invoice->transactions); my $total = total_amount($invoice->transactions); - my $title = 'default invoice, one item, 19% tax, without_skonto'; + my $title = $default_manager eq "swiss" ? 'default invoice, one item, 8% tax, without_skonto' : 'default invoice, one item, 19% tax, without_skonto'; is($invoice->netamount, 5.85, "${title}: netamount"); - is($invoice->amount, 6.96, "${title}: amount"); - is($paid_amount, -6.96, "${title}: paid amount"); + if ($default_manager eq "swiss") { + is($invoice->amount, 6.32, "${title}: amount"); + is($paid_amount, -6.32, "${title}: paid amount"); + is($invoice->paid, 6.32, "${title}: paid"); + } else { + is($invoice->amount, 6.96, "${title}: amount"); + is($paid_amount, -6.96, "${title}: paid amount"); + is($invoice->paid, 6.96, "${title}: paid"); + } is($number_of_payments, 2, "${title}: 3 AR_paid booking"); - is($invoice->paid, 6.96, "${title}: paid"); is($total, 0, "${title}: even balance"); } @@ -751,7 +840,7 @@ sub test_default_purchase_invoice_two_charts_19_7_without_skonto() { transdate => DateTime->today_local->to_kivitendo ); - $params{amount} = '226'; # pass full amount + $params{amount} = $default_manager eq "swiss" ? '210.5' : '226'; # pass full amount $params{payment_type} = 'without_skonto'; $purchase_invoice->pay_invoice( %params ); @@ -759,9 +848,13 @@ sub test_default_purchase_invoice_two_charts_19_7_without_skonto() { my ($number_of_payments, $paid_amount) = number_of_payments($purchase_invoice->transactions); my $total = total_amount($purchase_invoice->transactions); - my $title = 'default invoice, two items, 19/7% tax without skonto'; + my $title = $default_manager eq "swiss" ? 'default invoice, two items, 8/2.5% tax without skonto' : 'default invoice, two items, 19/7% tax without skonto'; - is($paid_amount, 226, "${title}: paid amount"); + if ($default_manager eq "swiss") { + is($paid_amount, 210.5, "${title}: paid amount"); + } else { + is($paid_amount, 226, "${title}: paid amount"); + } is($number_of_payments, 1, "${title}: 1 AP_paid bookings"); is($total, 0, "${title}: even balance"); @@ -776,7 +869,7 @@ sub test_default_purchase_invoice_two_charts_19_7_with_skonto() { transdate => DateTime->today_local->to_kivitendo ); - # $params{amount} = '226'; # pass full amount + $params{amount} = $purchase_invoice->amount_less_skonto; $params{payment_type} = 'with_skonto_pt'; $purchase_invoice->pay_invoice( %params ); @@ -784,9 +877,13 @@ sub test_default_purchase_invoice_two_charts_19_7_with_skonto() { my ($number_of_payments, $paid_amount) = number_of_payments($purchase_invoice->transactions); my $total = total_amount($purchase_invoice->transactions); - my $title = 'default invoice, two items, 19/7% tax without skonto'; + my $title = $default_manager eq "swiss" ? 'default invoice, two items, 8/2.5% tax with skonto' : 'default invoice, two items, 19/7% tax with skonto'; - is($paid_amount, 226, "${title}: paid amount"); + if ($default_manager eq "swiss") { + is($paid_amount, 210.5, "${title}: paid amount"); + } else { + is($paid_amount, 226, "${title}: paid amount"); + } is($number_of_payments, 3, "${title}: 1 AP_paid bookings"); is($total, 0, "${title}: even balance"); @@ -805,13 +902,16 @@ sub test_default_purchase_invoice_two_charts_19_7_tax_partial_unrounded_payment_ my ($number_of_payments, $paid_amount) = number_of_payments($purchase_invoice->transactions); my $total = total_amount($purchase_invoice->transactions); - my $title = 'default purchase_invoice, two charts, 19/7% tax multiple payments with final difference as skonto'; + my $title = $default_manager eq "swiss" ? 'default purchase_invoice, two charts, 8/2.5% tax multiple payments with final difference as skonto' : 'default purchase_invoice, two charts, 19/7% tax multiple payments with final difference as skonto'; - is($paid_amount, 150.67, "${title}: paid amount"); + if ($default_manager eq "swiss") { + is($paid_amount, 140.33, "${title}: paid amount"); + } else { + is($paid_amount, 150.67, "${title}: paid amount"); + } is($number_of_payments, 1, "${title}: 1 AP_paid bookings"); is($total, 0, "${title}: even balance"); -}; - +} sub test_default_purchase_invoice_two_charts_19_7_tax_without_skonto_multiple_payments_final_difference_as_skonto() { reset_state() if $ALWAYS_RESET; @@ -840,9 +940,13 @@ sub test_default_purchase_invoice_two_charts_19_7_tax_without_skonto_multiple_pa my ($number_of_payments, $paid_amount) = number_of_payments($purchase_invoice->transactions); my $total = total_amount($purchase_invoice->transactions); - my $title = 'default purchase_invoice, two charts, 19/7% tax multiple payments with final difference as skonto'; + my $title = $default_manager eq "swiss" ? 'default purchase_invoice, two charts, 8/2.5% tax multiple payments with final difference as skonto' : 'default purchase_invoice, two charts, 19/7% tax multiple payments with final difference as skonto'; - is($paid_amount, 226, "${title}: paid amount"); + if ($default_manager eq "swiss") { + is($paid_amount, 210.5, "${title}: paid amount"); + } else { + is($paid_amount, 226, "${title}: paid amount"); + } is($number_of_payments, 4, "${title}: 1 AP_paid bookings"); is($total, 0, "${title}: even balance"); @@ -862,7 +966,7 @@ sub test_default_invoice_two_items_19_7_tax_with_skonto_50_50() { $invoice->post; # default values - my %params = ( chart_id => $bank_account->chart_id, + my %params = ( chart_id => $bank_account->chart_id, transdate => DateTime->today_local->to_kivitendo ); @@ -874,12 +978,18 @@ sub test_default_invoice_two_items_19_7_tax_with_skonto_50_50() { my ($number_of_payments, $paid_amount) = number_of_payments($invoice->transactions); my $total = total_amount($invoice->transactions); - my $title = 'default invoice, two items, 19/7% tax with_skonto_pt 50/50'; + my $title = $default_manager eq "swiss" ? 'default invoice, two items, 8/2.5% tax with_skonto_pt 50/50' : 'default invoice, two items, 19/7% tax with_skonto_pt 50/50'; is($invoice->netamount, 100, "${title}: netamount"); - is($invoice->amount, 113, "${title}: amount"); - is($paid_amount, -113, "${title}: paid amount"); - is($invoice->paid, 113, "${title}: paid"); + if ($default_manager eq "swiss") { + is($invoice->amount, 105.25, "${title}: amount"); + is($paid_amount, -105.25, "${title}: paid amount"); + is($invoice->paid, 105.25, "${title}: paid"); + } else { + is($invoice->amount, 113, "${title}: amount"); + is($paid_amount, -113, "${title}: paid amount"); + is($invoice->paid, 113, "${title}: paid"); + } is($number_of_payments, 3, "${title}: 3 AR_paid bookings"); is($total, 0, "${title}: even balance"); } @@ -900,7 +1010,7 @@ sub test_default_invoice_four_items_19_7_tax_with_skonto_4x_25() { $invoice->post; # default values - my %params = ( chart_id => $bank_account->chart_id, + my %params = ( chart_id => $bank_account->chart_id, transdate => DateTime->today_local->to_kivitendo ); @@ -912,14 +1022,20 @@ sub test_default_invoice_four_items_19_7_tax_with_skonto_4x_25() { my ($number_of_payments, $paid_amount) = number_of_payments($invoice->transactions); my $total = total_amount($invoice->transactions); - my $title = 'default invoice, four items, 19/7% tax with_skonto_pt 4x25'; - - is($invoice->netamount , 100 , "${title}: netamount"); - is($invoice->amount , 113 , "${title}: amount"); - is($paid_amount , -113 , "${title}: paid amount"); - is($invoice->paid , 113 , "${title}: paid"); - is($number_of_payments , 3 , "${title}: 3 AR_paid bookings"); - is($total , 0 , "${title}: even balance"); + my $title = $default_manager eq "swiss" ? 'default invoice, four items, 8/2.5% tax with_skonto_pt 4x25' : 'default invoice, four items, 19/7% tax with_skonto_pt 4x25'; + + is($invoice->netamount, 100 , "${title}: netamount"); + if ($default_manager eq "swiss") { + is($invoice->amount, 105.25, "${title}: amount"); + is($paid_amount, -105.25, "${title}: paid amount"); + is($invoice->paid, 105.25, "${title}: paid"); + } else { + is($invoice->amount, 113, "${title}: amount"); + is($paid_amount, -113, "${title}: paid amount"); + is($invoice->paid, 113, "${title}: paid"); + } + is($number_of_payments, 3 , "${title}: 3 AR_paid bookings"); + is($total, 0 , "${title}: even balance"); } sub test_default_invoice_four_items_19_7_tax_with_skonto_4x_25_tax_included() { @@ -949,15 +1065,19 @@ sub test_default_invoice_four_items_19_7_tax_with_skonto_4x_25_tax_included() { my ($number_of_payments, $paid_amount) = number_of_payments($invoice->transactions); my $total = total_amount($invoice->transactions); - my $title = 'default invoice, four items, 19/7% tax with_skonto_pt 4x25'; + my $title = $default_manager eq "swiss" ? 'default invoice, four items, 8/2.5% tax with_skonto_pt 4x25' : 'default invoice, four items, 19/7% tax with_skonto_pt 4x25'; - is($invoice->netamount, 88.75, "${title}: netamount"); + if ($default_manager eq "swiss") { + is($invoice->netamount, 95.08, "${title}: netamount"); + } else { + is($invoice->netamount, 88.75, "${title}: netamount"); + } is($invoice->amount, 100, "${title}: amount"); is($paid_amount, -100, "${title}: paid amount"); is($invoice->paid, 100, "${title}: paid"); is($number_of_payments, 3, "${title}: 3 AR_paid bookings"); { local $TODO = "currently this test fails because the code writing the invoice is buggy, the calculation of skonto is correct"; - is($total, 0, "${title}: even balance"); + is($total, 0, "${title}: even balance"); } } @@ -988,14 +1108,20 @@ sub test_default_invoice_four_items_19_7_tax_with_skonto_4x_25_multiple() { my ($number_of_payments, $paid_amount) = number_of_payments($invoice->transactions); my $total = total_amount($invoice->transactions); - my $title = 'default invoice, four items, 19/7% tax with_skonto_pt 4x25'; + my $title = $default_manager eq "swiss" ? 'default invoice, four items, 8/2.5% tax with_skonto_pt 4x25' : 'default invoice, four items, 19/7% tax with_skonto_pt 4x25'; - is($invoice->netamount, 100, "${title}: netamount"); - is($invoice->amount, 113, "${title}: amount"); - is($paid_amount, -113, "${title}: paid amount"); - is($invoice->paid, 113, "${title}: paid"); - is($number_of_payments, 3, "${title}: 3 AR_paid bookings"); - is($total, 0, "${title}: even balance: this will fail due to rounding error in invoice post, not the skonto"); + is($invoice->netamount, 100, "${title}: netamount"); + if ($default_manager eq "swiss") { + is($invoice->amount, 105.25, "${title}: amount"); + is($paid_amount, -105.25, "${title}: paid amount"); + is($invoice->paid, 105.25, "${title}: paid"); + } else { + is($invoice->amount, 113, "${title}: amount"); + is($paid_amount, -113, "${title}: paid amount"); + is($invoice->paid, 113, "${title}: paid"); + } + is($number_of_payments, 3, "${title}: 3 AR_paid bookings"); + is($total, 0, "${title}: even balance: this will fail due to rounding error in invoice post, not the skonto"); } Support::TestSetup::login(); diff --git a/t/db_helper/price_tax_calculator.t b/t/db_helper/price_tax_calculator.t index 98462641d..49545b3c9 100644 --- a/t/db_helper/price_tax_calculator.t +++ b/t/db_helper/price_tax_calculator.t @@ -22,6 +22,7 @@ use SL::DB::Part; use SL::DB::Unit; use SL::DB::TaxZone; +my $default_manager; my ($customer, $currency_id, @parts, $buchungsgruppe, $buchungsgruppe7, $unit, $employee, $tax, $tax7, $taxzone); sub clear_up { @@ -39,13 +40,24 @@ sub reset_state { clear_up(); - $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%', %{ $params{buchungsgruppe} }) || croak "No accounting group"; - $buchungsgruppe7 = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 7%') || croak "No accounting group for 7\%"; - $unit = SL::DB::Manager::Unit->find_by(name => 'kg', %{ $params{unit} }) || croak "No unit"; - $employee = SL::DB::Manager::Employee->current || croak "No employee"; - $tax = SL::DB::Manager::Tax->find_by(taxkey => 3, rate => 0.19, %{ $params{tax} }) || croak "No tax"; - $tax7 = SL::DB::Manager::Tax->find_by(taxkey => 2, rate => 0.07) || croak "No tax for 7\%"; - $taxzone = SL::DB::Manager::TaxZone->find_by( description => 'Inland') || croak "No taxzone"; + $default_manager = $::lx_office_conf{system}->{default_manager}; + if ($default_manager eq "swiss") { + $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 8%', %{ $params{buchungsgruppe} }) || croak "No accounting group for 8\%"; + $buchungsgruppe7 = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 2.5%', %{ $params{buchungsgruppe} })|| croak "No accounting group for 2.5\%"; + $unit = SL::DB::Manager::Unit->find_by(name => 'kg', %{ $params{unit} }) || croak "No unit"; + $employee = SL::DB::Manager::Employee->current || croak "No employee"; + $tax = SL::DB::Manager::Tax->find_by(taxkey => 2, rate => 0.08, %{ $params{tax} }) || croak "No tax for 8\%"; + $tax7 = SL::DB::Manager::Tax->find_by(taxkey => 3, rate => 0.025) || croak "No tax for 2.5\%"; + $taxzone = SL::DB::Manager::TaxZone->find_by( description => 'Schweiz') || croak "No taxzone"; + } else { + $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%', %{ $params{buchungsgruppe} }) || croak "No accounting group"; + $buchungsgruppe7 = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 7%') || croak "No accounting group for 7\%"; + $unit = SL::DB::Manager::Unit->find_by(name => 'kg', %{ $params{unit} }) || croak "No unit"; + $employee = SL::DB::Manager::Employee->current || croak "No employee"; + $tax = SL::DB::Manager::Tax->find_by(taxkey => 3, rate => 0.19, %{ $params{tax} }) || croak "No tax"; + $tax7 = SL::DB::Manager::Tax->find_by(taxkey => 2, rate => 0.07) || croak "No tax for 7\%"; + $taxzone = SL::DB::Manager::TaxZone->find_by( description => 'Inland') || croak "No taxzone"; + } $currency_id = $::instance_conf->get_currency_id; @@ -122,14 +134,14 @@ sub test_default_invoice_one_item_19_tax_not_included() { my $taxkey = $item->part->get_taxkey(date => DateTime->today_local, is_sales => 1, taxzone => $invoice->taxzone_id); # sellprice 2.34 * qty 2.5 = 5.85 - # 19%(5.85) = 1.1115; rounded = 1.11 - # total rounded = 6.96 + # 19%(5.85) = 1.1115; rounded = 1.11 # 8%(5.85) = 0.468; rounded = 0.47 + # total rounded = 6.96 # total rounded = 6.32 # lastcost 1.93 * qty 2.5 = 4.825; rounded 4.83 # line marge_total = 1.02 # line marge_percent = 17.4358974358974 - my $title = 'default invoice, one item, 19% tax not included'; + my $title = $default_manager eq "swiss" ? 'default invoice, one item, 8% tax not included' : 'default invoice, one item, 19% tax not included'; my %data = $invoice->calculate_prices_and_taxes; is($item->marge_total, 1.02, "${title}: item marge_total"); @@ -137,7 +149,11 @@ sub test_default_invoice_one_item_19_tax_not_included() { is($item->marge_price_factor, 1, "${title}: item marge_price_factor"); is($invoice->netamount, 5.85, "${title}: netamount"); - is($invoice->amount, 6.96, "${title}: amount"); + if ($default_manager eq "swiss") { + is($invoice->amount, 6.32, "${title}: amount"); + } else { + is($invoice->amount, 6.96, "${title}: amount"); + } is($invoice->marge_total, 1.02, "${title}: marge_total"); is($invoice->marge_percent, 17.4358974358974, "${title}: marge_percent"); @@ -147,7 +163,7 @@ sub test_default_invoice_one_item_19_tax_not_included() { $buchungsgruppe->income_accno_id($taxzone) => { amount => 5.85, tax_id => $tax->id, - taxkey => 3, + taxkey => $default_manager eq "swiss" ? 2 : 3, }, }, amounts_cogs => {}, @@ -156,13 +172,13 @@ sub test_default_invoice_one_item_19_tax_not_included() { ], exchangerate => 1, taxes => { - $tax->chart_id => 1.11, + $tax->chart_id => $default_manager eq "swiss" ? 0.47 : 1.11, }, items => [ { linetotal => 5.85, linetotal_cost => 4.83, sellprice => 2.34, - tax_amount => 1.1115, + tax_amount => $default_manager eq "swiss" ? 0.468 : 1.1115, taxkey_id => $taxkey->id, }, ], @@ -184,8 +200,8 @@ sub test_default_invoice_two_items_19_7_tax_not_included() { # item 1: # sellprice 2.34 * qty 2.5 = 5.85 - # 19%(5.85) = 1.1115; rounded = 1.11 - # total rounded = 6.96 + # 19%(5.85) = 1.1115; rounded = 1.11 # 8%(5.85) = 0.468; rounded = 0.47 + # total rounded = 6.96 # total rounded = 6.32 # lastcost 1.93 * qty 2.5 = 4.825; rounded 4.83 # line marge_total = 1.02 @@ -193,14 +209,14 @@ sub test_default_invoice_two_items_19_7_tax_not_included() { # item 2: # sellprice 9.714 * qty 1.2 = 11.6568 rounded 11.66 - # 7%(11.6568) = 0.815976; rounded = 0.82 - # total rounded = 12.48 + # 7%(11.6568) = 0.815976; rounded = 0.82 # 2.5%(11.6568) = 0.29142; rounded = 0.29 + # total rounded = 12.48 # total rounded = 11.95 # lastcost 5.473 * qty 1.2 = 6.5676; rounded 6.57 # line marge_total = 5.09 # line marge_percent = 43.6535162950257 - my $title = 'default invoice, two item, 19/7% tax not included'; + my $title = $default_manager eq "swiss" ? 'default invoice, two item, 8/2.5% tax not included' : 'default invoice, two item, 19/7% tax not included'; my %data = $invoice->calculate_prices_and_taxes; is($item1->marge_total, 1.02, "${title}: item1 marge_total"); @@ -212,7 +228,11 @@ sub test_default_invoice_two_items_19_7_tax_not_included() { is($item2->marge_price_factor, 1, "${title}: item2 marge_price_factor"); is($invoice->netamount, 5.85 + 11.66, "${title}: netamount"); - is($invoice->amount, 6.96 + 12.48, "${title}: amount"); + if ($default_manager eq "swiss") { + is($invoice->amount, 6.32 + 11.95, "${title}: amount"); + } else { + is($invoice->amount, 6.96 + 12.48, "${title}: amount"); + } is($invoice->marge_total, 1.02 + 5.09, "${title}: marge_total"); is($invoice->marge_percent, 34.8943460879497, "${title}: marge_percent"); @@ -222,12 +242,12 @@ sub test_default_invoice_two_items_19_7_tax_not_included() { $buchungsgruppe->income_accno_id($taxzone) => { amount => 5.85, tax_id => $tax->id, - taxkey => 3, + taxkey => $default_manager eq "swiss" ? 2 : 3, }, $buchungsgruppe7->income_accno_id($taxzone) => { amount => 11.66, tax_id => $tax7->id, - taxkey => 2, + taxkey => $default_manager eq "swiss" ? 3 : 2, }, }, amounts_cogs => {}, @@ -236,20 +256,20 @@ sub test_default_invoice_two_items_19_7_tax_not_included() { ], exchangerate => 1, taxes => { - $tax->chart_id => 1.11, - $tax7->chart_id => 0.82, + $tax->chart_id => $default_manager eq "swiss" ? 0.47 : 1.11, + $tax7->chart_id => $default_manager eq "swiss" ? 0.29 : 0.82, }, items => [ { linetotal => 5.85, linetotal_cost => 4.83, sellprice => 2.34, - tax_amount => 1.1115, + tax_amount => $default_manager eq "swiss" ? 0.468 : 1.1115, taxkey_id => $taxkey1->id, }, { linetotal => 11.66, linetotal_cost => 6.57, sellprice => 9.714, - tax_amount => 0.8162, + tax_amount => $default_manager eq "swiss" ? 0.2915 : 0.8162, taxkey_id => $taxkey2->id, }, ], @@ -280,8 +300,8 @@ sub test_default_invoice_three_items_sellprice_rounding_discount() { # discount = sellprice 5.55 * discount (0.05) = 0.2775; rounded 0.28 # sellprice = sellprice 5.55 - discount 0.28 = 5.27; rounded 5.27 # linetotal = sellprice 5.27 * qty 1 = 5.27; rounded 5.27 - # 19%(5.27) = 1.0013; rounded = 1.00 - # total rounded = 6.27 + # 19%(5.27) = 1.0013; rounded = 1.00 # 8%(5.27) = 0.4216; rounded = 0.42 + # total rounded = 6.27 # total rounded = 5.69 # lastcost 1.93 * qty 1 = 1.93; rounded 1.93 # line marge_total = 3.34 @@ -291,8 +311,8 @@ sub test_default_invoice_three_items_sellprice_rounding_discount() { # discount = sellprice 5.50 * discount 0.05 = 0.275; rounded 0.28 # sellprice = sellprice 5.50 - discount 0.28 = 5.22; rounded 5.22 # linetotal = sellprice 5.22 * qty 1 = 5.22; rounded 5.22 - # 19%(5.22) = 0.9918; rounded = 0.99 - # total rounded = 6.21 + # 19%(5.22) = 0.9918; rounded = 0.99 # 8%(5.22) = 0.4176; rounded = 0.42 + # total rounded = 6.21 # total rounded = 5.64 # lastcost 1.93 * qty 1 = 1.93; rounded 1.93 # line marge_total = 5.22 - 1.93 = 3.29 @@ -302,8 +322,8 @@ sub test_default_invoice_three_items_sellprice_rounding_discount() { # discount = sellprice 5.00 * discount 0.25 = 0.25; rounded 0.25 # sellprice = sellprice 5.00 - discount 0.25 = 4.75; rounded 4.75 # linetotal = sellprice 4.75 * qty 1 = 4.75; rounded 4.75 - # 19%(4.75) = 0.9025; rounded = 0.90 - # total rounded = 5.65 + # 19%(4.75) = 0.9025; rounded = 0.90 # 8%(4.75) = 0.38; rounded = 0.38 + # total rounded = 5.65 # total rounded = 5.13 # lastcost 1.93 * qty 1 = 1.93; rounded 1.93 # line marge_total = 2.82 @@ -317,7 +337,7 @@ sub test_default_invoice_three_items_sellprice_rounding_discount() { is($item1->marge_price_factor, 1, "${title}: item1 marge_price_factor"); is($item2->marge_total, 3.29, "${title}: item2 marge_total"); - is($item2->marge_percent, 63.0268199233716, "${title}: item2 marge_percent"); + is($item2->marge_percent, 63.0268199233716, "${title}: item2 marge_percent"); is($item2->marge_price_factor, 1, "${title}: item2 marge_price_factor"); is($item3->marge_total, 2.82, "${title}: item3 marge_total"); @@ -326,10 +346,14 @@ sub test_default_invoice_three_items_sellprice_rounding_discount() { is($invoice->netamount, 5.27 + 5.22 + 4.75, "${title}: netamount"); - # 6.27 + 6.21 + 5.65 = 18.13 - # 1.19*(5.27 + 5.22 + 4.75) = 18.1356; rounded 18.14 + # 6.27 + 6.21 + 5.65 = 18.13 # 5.69 + 5.64 + 5.13 = 16.46 + # 1.19*(5.27 + 5.22 + 4.75) = 18.1356; rounded 18.14 # 0.08*(15.24) = 1.2192; rounded 1.22 #is($invoice->amount, 6.27 + 6.21 + 5.65, "${title}: amount"); - is($invoice->amount, 18.14, "${title}: amount"); + if ($default_manager eq "swiss") { + is($invoice->amount, 16.46, "${title}: amount"); + } else { + is($invoice->amount, 18.14, "${title}: amount"); + } is($invoice->marge_total, 3.34 + 3.29 + 2.82, "${title}: marge_total"); is($invoice->marge_percent, 62.007874015748, "${title}: marge_percent"); @@ -340,7 +364,7 @@ sub test_default_invoice_three_items_sellprice_rounding_discount() { $buchungsgruppe->income_accno_id($taxzone) => { amount => 15.24, tax_id => $tax->id, - taxkey => 3, + taxkey => $default_manager eq "swiss" ? 2 : 3, }, }, amounts_cogs => {}, @@ -349,25 +373,25 @@ sub test_default_invoice_three_items_sellprice_rounding_discount() { ], exchangerate => 1, taxes => { - $tax->chart_id => 2.9, + $tax->chart_id => $default_manager eq "swiss" ? 1.22 : 2.9, }, items => [ { linetotal => 5.27, linetotal_cost => 1.93, sellprice => 5.27, - tax_amount => 1.0013, + tax_amount => $default_manager eq "swiss" ? 0.4216 : 1.0013, taxkey_id => $taxkeys{$item1->parts_id}->id, }, { linetotal => 5.22, linetotal_cost => 1.93, sellprice => 5.22, - tax_amount => 0.9918, + tax_amount => $default_manager eq "swiss" ? 0.4176 : 0.9918, taxkey_id => $taxkeys{$item2->parts_id}->id, }, { linetotal => 4.75, linetotal_cost => 1.93, sellprice => 4.75, - tax_amount => 0.9025, + tax_amount => $default_manager eq "swiss" ? 0.38 : 0.9025, taxkey_id => $taxkeys{$item3->parts_id}->id, } ], diff --git a/t/db_helper/record_links.t b/t/db_helper/record_links.t index 5df89a405..f3ee0e9b8 100644 --- a/t/db_helper/record_links.t +++ b/t/db_helper/record_links.t @@ -41,9 +41,15 @@ sub reset_state { clear_up(); - $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%', %{ $params{buchungsgruppe} }) || croak "No accounting group"; - $employee = SL::DB::Manager::Employee->current || croak "No employee"; - $taxzone = SL::DB::Manager::TaxZone->find_by( description => 'Inland') || croak "No taxzone"; + if ($::lx_office_conf{system}->{default_manager} eq "swiss") { + $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 8%', %{ $params{buchungsgruppe} }) || croak "No accounting group"; + $employee = SL::DB::Manager::Employee->current || croak "No employee"; + $taxzone = SL::DB::Manager::TaxZone->find_by( description => 'Schweiz') || croak "No taxzone"; + } else { + $buchungsgruppe = SL::DB::Manager::Buchungsgruppe->find_by(description => 'Standard 19%', %{ $params{buchungsgruppe} }) || croak "No accounting group"; + $employee = SL::DB::Manager::Employee->current || croak "No employee"; + $taxzone = SL::DB::Manager::TaxZone->find_by( description => 'Inland') || croak "No taxzone"; + } $currency_id = $::instance_conf->get_currency_id; diff --git a/t/form/arap.t b/t/form/arap.t index 2c4a5ac30..3929a56c9 100644 --- a/t/form/arap.t +++ b/t/form/arap.t @@ -12,9 +12,9 @@ no warnings qw(qw); # calculate_arap is used for post_invoice in AR and AP # calculate_tax is used in calculate_arap as well as update in ar/ap/gl and post_transaction in gl +my $default_manager; my ($ar_tax_19, $ar_tax_7,$ar_tax_0); my $config = {}; -$config->{numberformat} = '1.000,00'; sub reset_state { my %params = @_; @@ -28,9 +28,18 @@ sub reset_state { }; }; - $ar_tax_19 = SL::DB::Manager::Tax->find_by(taxkey => 3, rate => 0.19, %{ $params{ar_tax_19} }) || croak "No 19% tax"; - $ar_tax_7 = SL::DB::Manager::Tax->find_by(taxkey => 2, rate => 0.07, %{ $params{ar_tax_7} }) || croak "No 7% tax"; - $ar_tax_0 = SL::DB::Manager::Tax->find_by(taxkey => 0, rate => 0.00, %{ $params{ar_tax_0} }) || croak "No 0% tax"; + $default_manager = $::lx_office_conf{system}->{default_manager}; + if ($default_manager eq "swiss") { + $ar_tax_19 = SL::DB::Manager::Tax->find_by(taxkey => 2, rate => 0.08, %{ $params{ar_tax_19} }) || croak "No 8% tax"; + $ar_tax_7 = SL::DB::Manager::Tax->find_by(taxkey => 3, rate => 0.025, %{ $params{ar_tax_7} }) || croak "No 2.5% tax"; + $config->{numberformat} = "1'000.00"; + + } else { + $ar_tax_19 = SL::DB::Manager::Tax->find_by(taxkey => 3, rate => 0.19, %{ $params{ar_tax_19} }) || croak "No 19% tax"; + $ar_tax_7 = SL::DB::Manager::Tax->find_by(taxkey => 2, rate => 0.07, %{ $params{ar_tax_7} }) || croak "No 7% tax"; + $config->{numberformat} = '1.000,00'; + } + $ar_tax_0 = SL::DB::Manager::Tax->find_by(taxkey => 0, rate => 0.00, %{ $params{ar_tax_0} }) || croak "No 0% tax"; }; @@ -51,11 +60,11 @@ sub arap_test { foreach my $a ( 1 .. scalar @{$testcase->{lines}} ) { my ($taxrate, $form_amount, $netamount, $taxamount, $totalamount) = @{ @{ $testcase->{lines} }[$a-1] }; my $tax; - if ( $taxrate == 19 ) { + if ( $taxrate eq ($default_manager eq "swiss" ? '8' : '19' )) { $tax = $ar_tax_19; - } elsif ( $taxrate == 7 ) { + } elsif ( $taxrate eq ($default_manager eq "swiss" ? '2,5' : '7' )) { $tax = $ar_tax_7; - } elsif ( $taxrate == 0 ) { + } elsif ( $taxrate eq '0' ) { $tax = $ar_tax_0; } else { croak "illegal taxrate $taxrate"; @@ -89,36 +98,79 @@ sub calculate_tax_test { is($calculated_net, $net, "calculated net for taxincluded = $taxincluded for net $amount and rate $rate is = $net"); }; +my @testline1; +my @testline2; +my @testline3; +my @testline4; +my @testline5; +my @testline6; +my @testline7; +my @testline8; +my @testline9; +my @testline10; +my @testline11; +my @testline12; +my @testline13; +my @testline14; +my @testline15; +my @testline16; +my @testline17; + +sub init_testlines { + # define the various lines that can be used for the testcases + # always use positive values for buy/sell, like in the interface + # tax input net tax total type + $default_manager = $::lx_office_conf{system}->{default_manager}; + if ($default_manager eq "swiss") { + @testline1 = qw(8 51,30 47,50 3,80 51,30 sell); + @testline2 = qw(8 10,80 10,00 0,80 10,80 sell); + @testline3 = qw(2,5 13,79 13,45 0,34 10,80 sell); + @testline4 = qw(8 133,08 133,08 10,65 143,73 sell); + @testline5 = qw(0 100,00 83,00 0,00 83,00 sell); # exchangerate of 0,83 + @testline6 = qw(8 51,30 47,50 3,80 51,30 buy); + @testline7 = qw(8 309,86 309,86 24,79 334,65 buy); + @testline8 = qw(2,5 124,54 121,50 3,04 124,54 buy); + @testline9 = qw(2,5 121,49 121,49 3,04 124,53 buy); + @testline10 = qw(2,5 121,50 121,50 3,05 124,55 buy); + @testline11 = qw(8 -2,77 -2,77 -0,22 -2,99 buy); + @testline12 = qw(2,5 12,88 12,88 0,32 13,20 buy); + @testline13 = qw(8 41,93 41,93 3,35 45,28 buy); + @testline14 = qw(8 84,65 84,65 6,77 98,42 buy); + @testline15 = qw(8 8,39 8,39 0,66 9,05 buy); + @testline16 = qw(8 91,42 84,65 6,77 98,42 buy); + @testline17 = qw(8 9,06 8,39 0,67 9,06 buy); + } else { + @testline1 = qw(19 56,53 47,50 9,03 56,53 sell); + @testline2 = qw(19 11,90 10,00 1,90 11,90 sell); + @testline3 = qw( 7 14,39 13,45 0,94 11,90 sell); + @testline4 = qw(19 133,08 133,08 25,29 158,37 sell); + @testline5 = qw( 0 100,00 83,00 0,00 83,00 sell); # exchangerate of 0,83 + @testline6 = qw(19 56,53 47,50 9,03 56,53 buy); + @testline7 = qw(19 309,86 309,86 58,87 368,73 buy); + @testline8 = qw( 7 130,00 121,50 8,50 130,00 buy); + @testline9 = qw( 7 121,49 121,49 8,50 129,99 buy); + @testline10 = qw( 7 121,50 121,50 8,51 130,01 buy); + @testline11 = qw(19 -2,77 -2,77 -0,53 -3,30 buy); + @testline12 = qw( 7 12,88 12,88 0,90 13,78 buy); + @testline13 = qw(19 41,93 41,93 7,97 49,90 buy); + @testline14 = qw(19 84,65 84,65 16,08 107,73 buy); + @testline15 = qw(19 8,39 8,39 1,59 9,98 buy); + @testline16 = qw(19 100,73 84,65 16,08 107,73 buy); + @testline17 = qw(19 9,99 8,39 1,60 9,99 buy); + } +} + Support::TestSetup::login(); -# define the various lines that can be used for the testcases -# always use positive values for buy/sell, like in the interface -# tax input net tax total type -my @testline1 = qw(19 56,53 47,50 9,03 56,53 sell); -my @testline2 = qw(19 11,90 10,00 1,90 11,90 sell); -my @testline3 = qw( 7 14,39 13,45 0,94 11,90 sell); -my @testline4 = qw(19 133,08 133,08 25,29 158,37 sell); -my @testline5 = qw( 0 100,00 83,00 0,00 83,00 sell); # exchangerate of 0,83 -my @testline6 = qw(19 56,53 47,50 9,03 56,53 buy); -my @testline7 = qw(19 309,86 309,86 58,87 368,73 buy); -my @testline8 = qw( 7 130,00 121,50 8,50 130,00 buy); -my @testline9 = qw( 7 121,49 121,49 8,50 129,99 buy); -my @testline10 = qw( 7 121,50 121,50 8,51 130,01 buy); -my @testline11 = qw(19 -2,77 -2,77 -0,53 -3,30 buy); -my @testline12 = qw( 7 12,88 12,88 0,90 13,78 buy); -my @testline13 = qw(19 41,93 41,93 7,97 49,90 buy); -my @testline14 = qw(19 84,65 84,65 16,08 107,73 buy); -my @testline15 = qw(19 8,39 8,39 1,59 9,98 buy); -my @testline16 = qw(19 100,73 84,65 16,08 107,73 buy); -my @testline17 = qw(19 9,99 8,39 1,60 9,99 buy); +init_testlines; # create testcases, made up of one or more lines, with expected values my $testcase1 = { lines => [ \@testline1 ], # lines to be used in testcase - total_amount => '56,53', # expected result + total_amount => $default_manager eq "swiss" ? '51,30' : '56,53', # expected result total_netamount => '47,50', # expected result - total_taxamount => '9,03', # expected result + total_taxamount => $default_manager eq "swiss" ? '3,80' : '9,03', # expected result # invoice parameters: taxincluded => 1, exchangerate => 1, @@ -128,9 +180,9 @@ my $testcase1 = { my $testcase2 = { lines => [ \@testline1, \@testline2, \@testline3 ], - total_amount => '82,82', + total_amount => $default_manager eq "swiss" ? '75,89' : '82,82', total_netamount => '70,95', - total_taxamount => '11,87', + total_taxamount => $default_manager eq "swiss" ? '4,94' : '11,87', taxincluded => 1, exchangerate => 1, currency => 'EUR', @@ -139,9 +191,9 @@ my $testcase2 = { my $testcase3 = { lines => [ \@testline4 ], - total_amount => '158,37', + total_amount => $default_manager eq "swiss" ? '143,73' : '158,37', total_netamount => '133,08', - total_taxamount => '25,29', + total_taxamount => $default_manager eq "swiss" ? '10,65' : '25,29', taxincluded => 0, exchangerate => 1, currency => 'EUR', @@ -161,9 +213,9 @@ my $testcase4 = { my $testcase6 = { lines => [ \@testline6 ], - total_amount => '56,53', + total_amount => $default_manager eq "swiss" ? '51,30' : '56,53', total_netamount => '47,50', - total_taxamount => '9,03', + total_taxamount => $default_manager eq "swiss" ? '3,80' : '9,03', taxincluded => 1, exchangerate => 1, currency => 'EUR', @@ -173,8 +225,8 @@ my $testcase6 = { my $testcase7 = { lines => [ \@testline7 ], total_netamount => '309,86', - total_taxamount => '58,87', - total_amount => '368,73', + total_taxamount => $default_manager eq "swiss" ? '24,79' : '58,87', + total_amount => $default_manager eq "swiss" ? '334,65' : '368,73', taxincluded => 0, exchangerate => 1, currency => 'EUR', @@ -184,8 +236,8 @@ my $testcase7 = { my $testcase8 = { lines => [ \@testline8 ], total_netamount => '121,50', - total_taxamount => '8,50', - total_amount => '130,00', + total_taxamount => $default_manager eq "swiss" ? '3,04' : '8,50', + total_amount => $default_manager eq "swiss" ? '124,54' : '130,00', taxincluded => 1, exchangerate => 1, currency => 'EUR', @@ -195,8 +247,8 @@ my $testcase8 = { my $testcase9 = { lines => [ \@testline9 ], total_netamount => '121,49', - total_taxamount => '8,50', - total_amount => '129,99', + total_taxamount => $default_manager eq "swiss" ? '3,04' : '8,50', + total_amount => $default_manager eq "swiss" ? '124,53' : '129,99', taxincluded => 0, exchangerate => 1, currency => 'EUR', @@ -206,8 +258,8 @@ my $testcase9 = { my $testcase10 = { lines => [ \@testline10 ], total_netamount => '121,50', - total_taxamount => '8,51', - total_amount => '130,01', + total_taxamount => $default_manager eq "swiss" ? '3,04' : '8,51', + total_amount => $default_manager eq "swiss" ? '124,54' : '130,01', taxincluded => 0, exchangerate => 1, currency => 'EUR', @@ -218,8 +270,8 @@ my $testcase11 = { # mixed invoices, -2,77€ net with 19% as credit note, 12,88€ net with 7% lines => [ \@testline11 , \@testline12 ], total_netamount => '10,11', - total_taxamount => '0,37', - total_amount => '10,48', + total_taxamount => $default_manager eq "swiss" ? '0,10' : '0,37', + total_amount => $default_manager eq "swiss" ? '10,21' : '10,48', taxincluded => 0, exchangerate => 1, currency => 'EUR', @@ -230,8 +282,8 @@ my $testcase12 = { # ap transaction, example from bug 2435 lines => [ \@testline13 ], total_netamount => '41,93', - total_taxamount => '7,97', - total_amount => '49,90', + total_taxamount => $default_manager eq "swiss" ? '3,35' : '7,97', + total_amount => $default_manager eq "swiss" ? '45,28' : '49,90', taxincluded => 0, exchangerate => 1, currency => 'EUR', @@ -242,8 +294,8 @@ my $testcase13 = { # ap transaction, example from bug 2094, tax not included lines => [ \@testline14 , \@testline15 ], total_netamount => '93,04', - total_taxamount => '17,67', - total_amount => '110,71', + total_taxamount => $default_manager eq "swiss" ? '7,44' : '17,67', + total_amount => $default_manager eq "swiss" ? '100,48' : '110,71', taxincluded => 0, exchangerate => 1, currency => 'EUR', @@ -254,8 +306,8 @@ my $testcase14 = { # ap transaction, example from bug 2094, tax included lines => [ \@testline16 , \@testline17 ], total_netamount => '93,04', - total_taxamount => '17,68', - total_amount => '110,72', + total_taxamount => $default_manager eq "swiss" ? '7,44' : '17,68', + total_amount => $default_manager eq "swiss" ? '100,48' : '110,72', taxincluded => 1, exchangerate => 1, currency => 'EUR', diff --git a/t/form/format_amount.t b/t/form/format_amount.t index 229c88cd5..fa18d5059 100644 --- a/t/form/format_amount.t +++ b/t/form/format_amount.t @@ -16,7 +16,6 @@ is($::form->format_amount($config, 1000.1234, 2), '1.000,12', 'format 1000.1234 is($::form->format_amount($config, 1000000000.1234, 2), '1.000.000.000,12', 'format 1000000000.1234 (numberformat: 1.000,00)'); is($::form->format_amount($config, -1000000000.1234, 2), '-1.000.000.000,12', 'format -1000000000.1234 (numberformat: 1.000,00)'); - $config->{numberformat} = '1,000.00'; is($::form->format_amount($config, '1e1', 2), '10.00', 'format 1e1 (numberformat: 1,000.00)'); @@ -25,6 +24,14 @@ is($::form->format_amount($config, 1000.1234, 2), '1,000.12', 'format 1000.1234 is($::form->format_amount($config, 1000000000.1234, 2), '1,000,000,000.12', 'format 1000000000.1234 (numberformat: 1,000.00)'); is($::form->format_amount($config, -1000000000.1234, 2), '-1,000,000,000.12', 'format -1000000000.1234 (numberformat: 1,000.00)'); +$config->{numberformat} = "1'000.00"; + +is($::form->format_amount($config, '1e1', 2), "10.00", "format 1e1 (numberformat: 1'000.00)"); +is($::form->format_amount($config, 1000, 2), "1'000.00", "format 1000 (numberformat: 1'000.00)"); +is($::form->format_amount($config, 1000.1234, 2), "1'000.12", "format 1000.1234 (numberformat: 1'000.00)"); +is($::form->format_amount($config, 1000000000.1234, 2), "1'000'000'000.12", "format 1000000000.1234 (numberformat: 1'000.00)"); +is($::form->format_amount($config, -1000000000.1234, 2), "-1'000'000'000.12", "format -1000000000.1234 (numberformat: 1'000.00)"); + # negative places is($::form->format_amount($config, 1.00045, -2), '1.00045', 'negative places'); diff --git a/t/form/parse_amount.t b/t/form/parse_amount.t index 4e29eb25f..d6a327d5e 100644 --- a/t/form/parse_amount.t +++ b/t/form/parse_amount.t @@ -53,6 +53,17 @@ is($::form->parse_amount($config, '01,234.5'), 1234.5, '01,234.5 (numberf is($::form->parse_amount($config, '01234.5'), 1234.5, '01234.5 (numberformat: 1000.00)'); is($::form->parse_amount($config, '09,871,234.5'), 9871234.5, '09,871,234,5 (numberformat: 1000.00)'); +$config->{numberformat} = "1'000.00"; + +is($::form->parse_amount($config, '12345'), 12345, "12345 (numberformat: 1'000.00)"); +is($::form->parse_amount($config, '1,234.5'), 1234.5, "1,234.5 (numberformat: 1'000.00)"); +is($::form->parse_amount($config, '9,871,234.5'), 9871234.5, "9,871,234,5 (numberformat: 1'000.00)"); +is($::form->parse_amount($config, '1234.5'), 1234.5, "1234.5 (numberformat: 1'000.00)"); +is($::form->parse_amount($config, '012345'), 12345, "012345 (numberformat: 1'000.00)"); +is($::form->parse_amount($config, '01,234.5'), 1234.5, "01,234.5 (numberformat: 1'000.00)"); +is($::form->parse_amount($config, '01234.5'), 1234.5, "01234.5 (numberformat: 1'000.00)"); +is($::form->parse_amount($config, '09,871,234.5'), 9871234.5, "09,871,234,5 (numberformat: 1'000.00)"); + # Negative numbers $config->{numberformat} = '1.000,00'; @@ -98,6 +109,17 @@ is($::form->parse_amount($config, '-01,234.5'), -1234.5, '-01,234.5 (numb is($::form->parse_amount($config, '-01234.5'), -1234.5, '-01234.5 (numberformat: 1000.00)'); is($::form->parse_amount($config, '-09,871,234.5'), -9871234.5, '-09,871,234,5 (numberformat: 1000.00)'); +$config->{numberformat} = "1'000.00"; + +is($::form->parse_amount($config, '-12345'), -12345, "-12345 (numberformat: 1'000.00)"); +is($::form->parse_amount($config, '-1,234.5'), -1234.5, "-1,234.5 (numberformat: 1'000.00)"); +is($::form->parse_amount($config, '-9,871,234.5'), -9871234.5, "-9,871,234,5 (numberformat: 1'000.00)"); +is($::form->parse_amount($config, '-1234.5'), -1234.5, "-1234.5 (numberformat: 1'000.00)"); +is($::form->parse_amount($config, '-012345'), -12345, "-012345 (numberformat: 1'000.00)"); +is($::form->parse_amount($config, '-01,234.5'), -1234.5, "-01,234.5 (numberformat: 1'000.00)"); +is($::form->parse_amount($config, '-01234.5'), -1234.5, "-01234.5 (numberformat: 1'000.00)"); +is($::form->parse_amount($config, '-09,871,234.5'), -9871234.5, "-09,871,234,5 (numberformat: 1'000.00)"); + # Calculations $config->{numberformat} = '1.000,00'; @@ -113,6 +135,13 @@ is($::form->parse_amount($config, '047/002+003.05*(04+000005)'), 50.95, '04 is($::form->parse_amount($config, '47 / 2+ 3.5*( 4 + 5)'), 55, '47 / 2+ 3.5*( 4 + 5) (numberformat: 1,000.00)'); is($::form->parse_amount($config, '047/ 002+ 003.05 * (04 +000005)'), 50.95, '047/ 002+ 003.05 * (04 +000005) (numberformat: 1,000.00)'); +$config->{numberformat} = "1'000.00"; + +is($::form->parse_amount($config, '47/2+3.5*(4+5)'), 55, "47/2+3.5*(4+5) (numberformat: 1'000.00)"); +is($::form->parse_amount($config, '047/002+003.05*(04+000005)'), 50.95, "047/002+003.05*(04+000005) (numberformat: 1'000.00)"); +is($::form->parse_amount($config, '47 / 2+ 3.5*( 4 + 5)'), 55, "47 / 2+ 3.5*( 4 + 5) (numberformat: 1'000.00)"); +is($::form->parse_amount($config, '047/ 002+ 003.05 * (04 +000005)'), 50.95, "047/ 002+ 003.05 * (04 +000005) (numberformat: 1'000.00)"); + # Weird edge cases $config->{numberformat} = '1.000,00'; -- 2.20.1