X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/cc685942e4d6a9d20ba534433986e2c3209da615..a7572e46e40d484ff7043db2b47b531bc6a85926:/SL/DB/Invoice.pm diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index d6ec6c853..38ec9c0f7 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -184,9 +184,16 @@ sub new_from { $args{payment_id} = ( $terms ? $terms->id : $source->payment_id); - if ($source->type =~ /_order$/) { + if ($source->type =~ /_delivery_order$/) { + $args{deliverydate} = $source->reqdate; + if (my $order = SL::DB::Manager::Order->find_by(ordnumber => $source->ordnumber)) { + $args{orddate} = $order->transdate; + } + + } elsif ($source->type =~ /_order$/) { $args{deliverydate} = $source->reqdate; $args{orddate} = $source->transdate; + } else { $args{quodate} = $source->transdate; } @@ -355,6 +362,7 @@ sub add_ar_amount_row { chart_id => $params{chart}->id, chart_link => $params{chart}->link, transdate => $self->transdate, + gldate => $self->gldate, taxkey => $tax->taxkey, tax_id => $tax->id, project_id => $params{project_id}, @@ -369,6 +377,7 @@ sub add_ar_amount_row { chart_id => $tax->chart_id, chart_link => $tax->chart->link, transdate => $self->transdate, + gldate => $self->gldate, taxkey => $tax->taxkey, tax_id => $tax->id, );