$invoice = SL::DB::Invoice->new_from($order);
+ my $tax_point = ($invoice->tax_point // $time_period_vars->{period_end_date}->[0])->clone;
+
+ while ($tax_point < $period_start_date) {
+ $tax_point->add(months => $config->get_billing_period_length);
+ }
+
my $intnotes = $invoice->intnotes ? $invoice->intnotes . "\n\n" : '';
$intnotes .= "Automatisch am " . $invdate->to_lxoffice . " erzeugte Rechnung";
$invoice->assign_attributes(deliverydate => $period_start_date,
+ tax_point => $tax_point,
intnotes => $intnotes,
employee => $order->employee, # new_from sets employee to import user
direct_debit => $config->direct_debit,
_copy($self, $form, '', '', 0, qw(id type taxzone_id ordnumber quonumber invnumber donumber cusordnumber taxincluded shippingpoint shipvia notes intnotes cp_id
employee_id salesman_id closed department_id language_id payment_id delivery_customer_id delivery_vendor_id shipto_id proforma
globalproject_id delivered transaction_description container_type accepted_by_customer invoice storno storno_id dunning_config_id
- orddate quodate reqdate gldate duedate deliverydate datepaid transdate delivery_term_id));
+ orddate quodate reqdate gldate duedate deliverydate datepaid transdate tax_point delivery_term_id));
$form->{currency} = $form->{curr} = $self->currency_id ? $self->currency->name || '' : '';
if ( $vc eq 'customer' ) {
my (@columns, @item_columns, $item_parent_id_column, $item_parent_column);
if (ref($source) eq 'SL::DB::Order') {
- @columns = qw(quonumber delivery_customer_id delivery_vendor_id);
+ @columns = qw(quonumber delivery_customer_id delivery_vendor_id tax_point);
@item_columns = qw(subtotal);
$item_parent_id_column = 'trans_id';