From: Moritz Bunkus Date: Mon, 21 Sep 2015 13:50:47 +0000 (+0200) Subject: Wiederkehrende Rechnungen: Lastschrifteinzugsflag in Konfiguration setzen können X-Git-Tag: release-3.4.1~728 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=3649d1c496c1ab6a9959b51bc9a7ba406d1507c9;p=kivitendo-erp.git Wiederkehrende Rechnungen: Lastschrifteinzugsflag in Konfiguration setzen können --- diff --git a/SL/BackgroundJob/CreatePeriodicInvoices.pm b/SL/BackgroundJob/CreatePeriodicInvoices.pm index 9f116becb..2df2a30ac 100644 --- a/SL/BackgroundJob/CreatePeriodicInvoices.pm +++ b/SL/BackgroundJob/CreatePeriodicInvoices.pm @@ -200,6 +200,7 @@ sub _create_periodic_invoice { $invoice->assign_attributes(deliverydate => $period_start_date, intnotes => $intnotes, employee => $order->employee, # new_from sets employee to import user + direct_debit => $config->direct_debit, ); _replace_vars(object => $invoice, vars => $time_period_vars, attribute => $_, attribute_format => ($_ eq 'notes' ? 'html' : 'text')) for qw(notes intnotes transaction_description); diff --git a/SL/DB/MetaSetup/PeriodicInvoicesConfig.pm b/SL/DB/MetaSetup/PeriodicInvoicesConfig.pm index 1aeb42fd7..dfc43f435 100644 --- a/SL/DB/MetaSetup/PeriodicInvoicesConfig.pm +++ b/SL/DB/MetaSetup/PeriodicInvoicesConfig.pm @@ -12,6 +12,7 @@ __PACKAGE__->meta->columns( active => { type => 'boolean', default => 'true' }, ar_chart_id => { type => 'integer', not_null => 1 }, copies => { type => 'integer' }, + direct_debit => { type => 'boolean', default => 'false', not_null => 1 }, end_date => { type => 'date' }, extend_automatically_by => { type => 'integer' }, first_billing_date => { type => 'date' }, diff --git a/SL/OE.pm b/SL/OE.pm index 0c6d6fc9d..9692e48cd 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -762,7 +762,7 @@ sub load_periodic_invoice_config { if ($config_obj) { my $config = { map { $_ => $config_obj->$_ } qw(active terminated periodicity order_value_periodicity start_date_as_date end_date_as_date first_billing_date_as_date extend_automatically_by ar_chart_id - print printer_id copies) }; + print printer_id copies direct_debit) }; $form->{periodic_invoices_config} = YAML::Dump($config); } } diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 1d3fe7f90..97494cfb8 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -2063,6 +2063,7 @@ sub save_periodic_invoices_config { my $config = { active => $::form->{active} ? 1 : 0, terminated => $::form->{terminated} ? 1 : 0, + direct_debit => $::form->{direct_debit} ? 1 : 0, periodicity => (any { $_ eq $::form->{periodicity} } @SL::DB::PeriodicInvoicesConfig::PERIODICITIES) ? $::form->{periodicity} : 'm', order_value_periodicity => (any { $_ eq $::form->{order_value_periodicity} } ('p', @SL::DB::PeriodicInvoicesConfig::ORDER_VALUE_PERIODICITIES)) ? $::form->{order_value_periodicity} : 'p', start_date_as_date => $::form->{start_date_as_date}, diff --git a/sql/Pg-upgrade2/periodic_invoices_direct_debit_flag.sql b/sql/Pg-upgrade2/periodic_invoices_direct_debit_flag.sql new file mode 100644 index 000000000..a05ff0ac3 --- /dev/null +++ b/sql/Pg-upgrade2/periodic_invoices_direct_debit_flag.sql @@ -0,0 +1,6 @@ +-- @tag: periodic_invoices_direct_debit_flag +-- @description: Flag Lastschrifteinzug bei wiederkehrenden Rechnungen +-- @depends: release_3_3_0 +ALTER TABLE periodic_invoices_configs ADD COLUMN direct_debit BOOLEAN DEFAULT FALSE; +UPDATE periodic_invoices_configs SET direct_debit = FALSE; +ALTER TABLE periodic_invoices_configs ALTER COLUMN direct_debit SET NOT NULL; diff --git a/templates/webpages/oe/edit_periodic_invoices_config.html b/templates/webpages/oe/edit_periodic_invoices_config.html index 656dc4326..8ee4952af 100644 --- a/templates/webpages/oe/edit_periodic_invoices_config.html +++ b/templates/webpages/oe/edit_periodic_invoices_config.html @@ -72,6 +72,11 @@ + + [%- LxERP.t8('direct debit') %] + [% L.checkbox_tag("direct_debit", checked=direct_debit) %] + + [%- LxERP.t8('Print automatically') %]