From f48af81769e3a7da01d09ff63e61dbd09fe5ad2e Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 14 Oct 2013 15:09:56 +0200 Subject: [PATCH] Wiederkehrende Rechnung: Option "erste Rechnung erzeugen am" Bisher nur die Masken; noch nicht im Backgroundjob implementiert --- SL/DB/MetaSetup/PeriodicInvoicesConfig.pm | 1 + SL/OE.pm | 2 +- bin/mozilla/oe.pl | 3 ++- locale/de/all | 2 ++ sql/Pg-upgrade2/periodic_invoices_first_billing_date.sql | 5 +++++ templates/webpages/oe/edit_periodic_invoices_config.html | 8 ++++++++ 6 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 sql/Pg-upgrade2/periodic_invoices_first_billing_date.sql diff --git a/SL/DB/MetaSetup/PeriodicInvoicesConfig.pm b/SL/DB/MetaSetup/PeriodicInvoicesConfig.pm index e914a6449..eae8481d4 100644 --- a/SL/DB/MetaSetup/PeriodicInvoicesConfig.pm +++ b/SL/DB/MetaSetup/PeriodicInvoicesConfig.pm @@ -14,6 +14,7 @@ __PACKAGE__->meta->columns( copies => { type => 'integer' }, end_date => { type => 'date' }, extend_automatically_by => { type => 'integer' }, + first_billing_date => { type => 'date' }, id => { type => 'integer', not_null => 1, sequence => 'id' }, oe_id => { type => 'integer', not_null => 1 }, periodicity => { type => 'varchar', length => 10, not_null => 1 }, diff --git a/SL/OE.pm b/SL/OE.pm index 13e735a38..266945ce3 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -662,7 +662,7 @@ sub load_periodic_invoice_config { my $config_obj = SL::DB::Manager::PeriodicInvoicesConfig->find_by(oe_id => $form->{id}); if ($config_obj) { - my $config = { map { $_ => $config_obj->$_ } qw(active terminated periodicity start_date_as_date end_date_as_date extend_automatically_by ar_chart_id + my $config = { map { $_ => $config_obj->$_ } qw(active terminated periodicity start_date_as_date end_date_as_date first_billing_date_as_date extend_automatically_by ar_chart_id print printer_id copies) }; $form->{periodic_invoices_config} = YAML::Dump($config); } diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 285f5aaa4..e59e95c8f 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -1930,7 +1930,7 @@ sub edit_periodic_invoices_config { if ('HASH' ne ref $config) { $config = { periodicity => 'y', - start_date_as_date => $::form->{transdate}, + start_date_as_date => $::form->{transdate} || $::form->current_date, extend_automatically_by => 12, active => 1, }; @@ -1965,6 +1965,7 @@ sub save_periodic_invoices_config { periodicity => (any { $_ eq $::form->{periodicity} } qw(m q b y)) ? $::form->{periodicity} : 'm', start_date_as_date => $::form->{start_date_as_date}, end_date_as_date => $::form->{end_date_as_date}, + first_billing_date_as_date => $::form->{first_billing_date_as_date}, print => $::form->{print} ? 1 : 0, printer_id => $::form->{print} ? $::form->{printer_id} * 1 : undef, copies => $::form->{copies} * 1 ? $::form->{copies} : 1, diff --git a/locale/de/all b/locale/de/all index 911f0279f..62892ef54 100755 --- a/locale/de/all +++ b/locale/de/all @@ -543,6 +543,7 @@ $self->{texts} = { 'Create bank transfer via SEPA XML' => 'Überweisung via SEPA XML erzeugen', 'Create customers and vendors. Edit all vendors. Edit all customers' => 'Kunden und Lieferanten erfassen. Alle Lieferanten bearbeiten. Alle Kunden bearbeiten', 'Create customers and vendors. Edit all vendors. Edit only customers where salesman equals employee (login)' => 'Kunden und Lieferanten erfassen. Alle Lieferanten bearbeiten. Nur Kunden bearbeiten bei denen der Verkäufer gleich Bearbeiter (login) ist', + 'Create first invoice on' => 'Erste Rechnung erzeugen am', 'Create invoice?' => 'Rechnung erstellen?', 'Create new' => 'Neu erfassen', 'Create new background job' => 'Neuen Hintergrund-Job anlegen', @@ -1092,6 +1093,7 @@ $self->{texts} = { 'If amounts differ more than "Maximal amount difference" (see settings), this item is marked as invalid.' => 'Weichen die Beträge mehr als die "maximale Betragsabweichung" (siehe Einstellungen) ab, so wird diese Position als ungültig markiert.', 'If checked the taxkey will not be exported in the DATEV Export, but only IF chart taxkeys differ from general ledger taxkeys' => 'Falls angehakt wird der DATEV-Steuerschlüssel bei Buchungen auf dieses Konto nicht beim DATEV-Export mitexportiert, allerdings nur wenn zusätzlich der Konto-Steuerschlüssel vom Buchungs (Hauptbuch) Steuerschlüssel abweicht', 'If configured this bin will be preselected for all new parts. Also this bin will be used as the master default bin, if default transfer out with master bin is activated.' => 'Falls konfiguriert, wird dieses Lager mit Lagerplatz für neu angelegte Waren vorausgewählt.', + 'If missing then the start date will be used.' => 'Falls es fehlt, so wird die erste Rechnung für das Startdatum erzeugt.', 'If the article type is set to \'mixed\' then a column called \'type\' must be present.' => 'Falls der Artikeltyp auf \'gemischt\' gestellt wird, muss eine Spalte namens \'type\' vorhanden sein.', 'If the automatic creation of invoices for fees and interest is switched on for a dunning level then the following accounts will be used for the invoice.' => 'Wenn das automatische Erstellen einer Rechnung über Mahngebühren und Zinsen für ein Mahnlevel aktiviert ist, so werden die folgenden Konten für die Rechnung benutzt.', 'If the database user listed above does not have the right to create a database then enter the name and password of the superuser below:' => 'Falls der oben genannte Datenbankbenutzer nicht die Berechtigung zum Anlegen neuer Datenbanken hat, so können Sie hier den Namen und das Passwort des Datenbankadministratoraccounts angeben:', diff --git a/sql/Pg-upgrade2/periodic_invoices_first_billing_date.sql b/sql/Pg-upgrade2/periodic_invoices_first_billing_date.sql new file mode 100644 index 000000000..8487982f4 --- /dev/null +++ b/sql/Pg-upgrade2/periodic_invoices_first_billing_date.sql @@ -0,0 +1,5 @@ +-- @tag: periodic_invoices_first_billing_date +-- @description: Wiederkehrende Rechnungen: Feld für erstes Rechnungsdatum +-- @depends: periodic_invoices +-- @charset: utf-8 +ALTER TABLE periodic_invoices_configs ADD COLUMN first_billing_date DATE; diff --git a/templates/webpages/oe/edit_periodic_invoices_config.html b/templates/webpages/oe/edit_periodic_invoices_config.html index 3c2042fb3..2e6b5a406 100644 --- a/templates/webpages/oe/edit_periodic_invoices_config.html +++ b/templates/webpages/oe/edit_periodic_invoices_config.html @@ -47,6 +47,13 @@ + + [%- LxERP.t8('Create first invoice on') %](2) + + [% L.date_tag("first_billing_date_as_date", first_billing_date_as_date) %] + + + [% LxERP.t8('Extend automatically by n months') %] @@ -85,6 +92,7 @@

(1): [%- LxERP.t8('The end date is the last day for which invoices will possibly be created.') %]

+

(2): [% LxERP.t8("If missing then the start date will be used.") %]

[% L.hidden_tag('action', 'save_periodic_invoices_config') %] -- 2.20.1