From 35429440e41f131dfc153e67c8ae3c2680353736 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 20 Nov 2019 14:47:53 +0100 Subject: [PATCH] S:D:Invoice->new_from: Auftragsdatum aus Auftrag bei Erzeugen aus Lieferschein --- SL/DB/Invoice.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index d6ec6c853..0e27f8adf 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; } -- 2.20.1