From 5e9cefa2067da6326e3cb9ab6834c51f21bfca2c Mon Sep 17 00:00:00 2001 From: "Martin Helmling martin.helmling@octosoft.eu" Date: Fri, 24 Jun 2016 12:54:19 +0200 Subject: [PATCH] Vendor/Customer Name in FlattenToForm setzen MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In For.pm wird bei der Druckvorbereitung Customer-/Vendorname gesetzt. Damit z.B. bei Massendruck oder neuen Controllern diese Variable auch zur Verfügung stehen werden sie , falls die Objekte vorhanden in die Form geladen --- SL/DB/Helper/FlattenToForm.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SL/DB/Helper/FlattenToForm.pm b/SL/DB/Helper/FlattenToForm.pm index a0daf4491..7a3922c99 100644 --- a/SL/DB/Helper/FlattenToForm.pm +++ b/SL/DB/Helper/FlattenToForm.pm @@ -20,8 +20,10 @@ sub flatten_to_form { if ( $vc eq 'customer' ) { $form->{customer_id} = $self->customer_id; + $form->{customer} = $self->customer->name if $self->customer; } else { - $form->{vendor_id} = $self->vendor_id; + $form->{vendor_id} = $self->vendor_id; + $form->{vendor} = $self->vendor->name if $self->vendor; }; if (_has($self, 'transdate')) { @@ -31,7 +33,7 @@ sub flatten_to_form { $form->{$transdate_idx} = $self->transdate->to_lxoffice; } - $form->{vc} = $vc if ref($self) =~ m{^SL::DB::(?:.*Invoice|Order)}; + $form->{vc} = $vc if ref($self) =~ m{^SL::DB::(?:.*Invoice|.*Order)}; my @vc_fields = (qw(account_number bank bank_code bic business city contact country creditlimit department_1 department_2 discount email fax gln homepage iban language name -- 2.20.1