$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);
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' },
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);
}
}
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},
--- /dev/null
+-- @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;
</td>
</tr>
+ <tr>
+ <th align="right">[%- LxERP.t8('direct debit') %]</th>
+ <td valign="top">[% L.checkbox_tag("direct_debit", checked=direct_debit) %]</td>
+ </tr>
+
<tr>
<th align="right">[%- LxERP.t8('Print automatically') %]</th>
<td valign="top">