Vendor/Customer Name in FlattenToForm setzen
authorMartin Helmling martin.helmling@octosoft.eu <martin.helmling@octosoft.eu>
Fri, 24 Jun 2016 10:54:19 +0000 (12:54 +0200)
committerMartin Helmling martin.helmling@octosoft.eu <martin.helmling@octosoft.eu>
Fri, 24 Jun 2016 10:54:19 +0000 (12:54 +0200)
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

index a0daf44..7a3922c 100644 (file)
@@ -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