From 341e134eda2743d384ff2b25758f5219dc89b8e4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Mon, 8 Nov 2021 13:40:19 +0100 Subject: [PATCH] Anzahlungs-Rg.: Standardkonto-Auswahl f. Verrechnungskonto --- SL/DB/MetaSetup/Default.pm | 1 + locale/de/all | 1 + locale/en/all | 1 + ...ults_advance_payment_clearing_chart_id.sql | 32 +++++++++++++++++++ .../client_config/_default_accounts.html | 5 +++ 5 files changed, 40 insertions(+) create mode 100644 sql/Pg-upgrade2/defaults_advance_payment_clearing_chart_id.sql diff --git a/SL/DB/MetaSetup/Default.pm b/SL/DB/MetaSetup/Default.pm index ff3733a7d..c8d55dbca 100644 --- a/SL/DB/MetaSetup/Default.pm +++ b/SL/DB/MetaSetup/Default.pm @@ -15,6 +15,7 @@ __PACKAGE__->meta->columns( address_street1 => { type => 'text' }, address_street2 => { type => 'text' }, address_zipcode => { type => 'text' }, + advance_payment_clearing_chart_id => { type => 'integer' }, allow_new_purchase_delivery_order => { type => 'boolean', default => 'true', not_null => 1 }, allow_new_purchase_invoice => { type => 'boolean', default => 'true', not_null => 1 }, allow_sales_invoice_from_sales_order => { type => 'boolean', default => 'true', not_null => 1 }, diff --git a/locale/de/all b/locale/de/all index 4a7801343..7bd894777 100755 --- a/locale/de/all +++ b/locale/de/all @@ -669,6 +669,7 @@ $self->{texts} = { 'Cleared Balance' => 'abgeschlossen', 'Cleared/uncleared only' => 'Status abgeglichen', 'Clearing Tax Received (No 71)' => 'Verrechnung des Erstattungsbetrages erwünscht (Zeile 71)', + 'Clearing account for advance payments' => 'Verrechnungskonto für Anzahlungen', 'Client' => 'Mandant', 'Client #1' => 'Mandant #1', 'Client Configuration' => 'Mandantenkonfiguration', diff --git a/locale/en/all b/locale/en/all index b1e5413f4..38597d4ec 100644 --- a/locale/en/all +++ b/locale/en/all @@ -669,6 +669,7 @@ $self->{texts} = { 'Cleared Balance' => '', 'Cleared/uncleared only' => '', 'Clearing Tax Received (No 71)' => '', + 'Clearing account for advance payments' => '', 'Client' => '', 'Client #1' => '', 'Client Configuration' => '', diff --git a/sql/Pg-upgrade2/defaults_advance_payment_clearing_chart_id.sql b/sql/Pg-upgrade2/defaults_advance_payment_clearing_chart_id.sql new file mode 100644 index 000000000..53da9089d --- /dev/null +++ b/sql/Pg-upgrade2/defaults_advance_payment_clearing_chart_id.sql @@ -0,0 +1,32 @@ +-- @tag: defaults_advance_payment_clearing_chart_id +-- @description: Voreingestelltes Konto für Verrechnung von Anzahlungen +-- @depends: new_chart_1593_1495 + +ALTER TABLE defaults ADD COLUMN advance_payment_clearing_chart_id INTEGER; + +DO $$ +BEGIN + + IF ( SELECT coa FROM defaults ) = 'Germany-DATEV-SKR03EU' THEN + DECLARE + clearing_accno text := '1593'; + + BEGIN + IF ( SELECT COUNT(accno) FROM chart WHERE accno LIKE clearing_accno ) = 1 THEN + UPDATE defaults SET advance_payment_clearing_chart_id = (SELECT id FROM chart WHERE accno LIKE clearing_accno); + END IF; + END; + END IF; + + IF ( SELECT coa FROM defaults ) = 'Germany-DATEV-SKR04EU' THEN + DECLARE + clearing_accno text := '1495'; + + BEGIN + IF ( SELECT COUNT(accno) FROM chart WHERE accno LIKE clearing_accno ) = 1 THEN + UPDATE defaults SET advance_payment_clearing_chart_id = (SELECT id FROM chart WHERE accno LIKE clearing_accno); + END IF; + END; + END IF; + +END $$; diff --git a/templates/webpages/client_config/_default_accounts.html b/templates/webpages/client_config/_default_accounts.html index 35a8a3a70..05f4e9e1c 100644 --- a/templates/webpages/client_config/_default_accounts.html +++ b/templates/webpages/client_config/_default_accounts.html @@ -55,6 +55,11 @@ [% P.chart.picker('defaults.ar_chart_id', SELF.defaults.ar_chart_id, type='AR', choose=1, style=style) %] + + [% LxERP.t8("Clearing account for advance payments") %] + [% P.chart.picker('defaults.advance_payment_clearing_chart_id', SELF.defaults.advance_payment_clearing_chart_id, choose=1, style=style) %] + + [% LxERP.t8("Account for workflow from purchase order to ap transaction") %] [% P.chart.picker('defaults.workflow_po_ap_chart_id', SELF.defaults.workflow_po_ap_chart_id, type='AP_amount', choose=1, style=style) %] -- 2.20.1