From 95a9251d72c62f22cc2818ec145dbacb509dec83 Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Sat, 2 Jan 2016 12:59:21 +0100 Subject: [PATCH] =?utf8?q?FlattenToForm=20-=20auch=20customer=5Fid=20oder?= =?utf8?q?=20vendor=5Fid=20=C3=BCbergeben?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Dies wird vom neuen OrderController beim Umwandeln in einen Lieferschein gebraucht, wo nach einem flatten_to_form auf $order delivery_order aufgerufen wird, wo anhand customer_id oder vendor_id der Kunden geladen wird. --- SL/DB/Helper/FlattenToForm.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SL/DB/Helper/FlattenToForm.pm b/SL/DB/Helper/FlattenToForm.pm index 3cb7b5f49..4d7f54c86 100644 --- a/SL/DB/Helper/FlattenToForm.pm +++ b/SL/DB/Helper/FlattenToForm.pm @@ -18,6 +18,12 @@ sub flatten_to_form { orddate quodate reqdate gldate duedate deliverydate datepaid transdate delivery_term_id)); $form->{currency} = $form->{curr} = $self->currency_id ? $self->currency->name || '' : ''; + if ( $vc eq 'customer' ) { + $form->{customer_id} = $self->customer_id; + } else { + $form->{vendor_id} = $self->vendor_id; + }; + if (_has($self, 'transdate')) { my $transdate_idx = ref($self) eq 'SL::DB::Order' ? ($self->quotation ? 'quodate' : 'orddate') : ref($self) eq 'SL::DB::Invoice' ? 'invdate' -- 2.20.1