- if ($form->{description}) {
- push @options, $locale->text('Description') . " : $form->{description}";
- }
- if ($form->{customer}) {
- push @options, $locale->text('Customer') . " : $form->{customername}";
- }
- if ($form->{customernumber}) {
- push @options, $locale->text('Customer Number') . " : $form->{customernumber}";
- }
-# TODO: es wird nur id übergeben
- if ($form->{department}) {
- my ($department) = split /--/, $form->{department};
- push @options, $locale->text('Department') . " : $department";
- }
- if ($form->{invnumber}) {
- push @options, $locale->text('Invoice Number') . " : $form->{invnumber}";
- }
- if ($form->{invdate}) {
- push @options, $locale->text('Invoice Date') . " : $form->{invdate}";
- }
- if ($form->{partnumber}) {
- push @options, $locale->text('Part Number') . " : $form->{partnumber}";
- }
- if ($form->{partsgroup_id}) {
- my $partsgroup = SL::DB::PartsGroup->new(id => $form->{partsgroup_id})->load;
- push @options, $locale->text('Group') . " : $partsgroup->{partsgroup}";
- }
- if ($form->{country}) {
- push @options, $locale->text('Country') . " : $form->{country}";
- }
- if ($form->{employee_id}) {
- my $employee = SL::DB::Employee->new(id => $form->{employee_id})->load;
- push @options, $locale->text('Employee') . ' : ' . $employee->name;
- }
- if ($form->{salesman_id}) {
- my $salesman = SL::DB::Employee->new(id => $form->{salesman_id})->load;
- push @options, $locale->text('Salesman') . ' : ' . $salesman->name;
- }
- if ($form->{business_id}) {
- my $business = SL::DB::Business->new(id => $form->{business_id})->load;
- push @options, $locale->text('Customer type') . ' : ' . $business->description;
- }
- if ($form->{ordnumber}) {
- push @options, $locale->text('Order Number') . " : $form->{ordnumber}";
- }
- if ($form->{notes}) {
- push @options, $locale->text('Notes') . " : $form->{notes}";
- }
- if ($form->{transaction_description}) {
- push @options, $locale->text('Transaction description') . " : $form->{transaction_description}";
- }
- if ($form->{transdatefrom}) {
- push @options, $locale->text('From') . " " . $locale->date(\%myconfig, $form->{transdatefrom}, 1);
- }
- if ($form->{transdateto}) {
- push @options, $locale->text('Bis') . " " . $locale->date(\%myconfig, $form->{transdateto}, 1);
- }
+ push @options, $locale->text('Description') . " : $form->{description}" if $form->{description};
+ push @options, $locale->text('Customer') . " : $form->{customername}" if $form->{customer};
+ push @options, $locale->text('Customer Number') . " : $form->{customernumber}" if $form->{customernumber};
+ # TODO: es wird nur id übergeben
+ push @options, $locale->text('Department') . " : " . (split /--/, $form->{department})[0] if $form->{department};
+ push @options, $locale->text('Invoice Number') . " : $form->{invnumber}" if $form->{invnumber};
+ push @options, $locale->text('Invoice Date') . " : $form->{invdate}" if $form->{invdate};
+ push @options, $locale->text('Part Number') . " : $form->{partnumber}" if $form->{partnumber};
+ push @options, $locale->text('Group') . " : " . SL::DB::PartsGroup->new(id => $form->{partsgroup_id})->load->partsgroup if $form->{partsgroup_id};
+ push @options, $locale->text('Country') . " : $form->{country}" if $form->{country};
+ push @options, $locale->text('Employee') . ' : ' . SL::DB::Employee->new(id => $form->{employee_id})->load->name if $form->{employee_id};
+ push @options, $locale->text('Salesman') . ' : ' . SL::DB::Employee->new(id => $form->{salesman_id})->load->name if $form->{salesman_id};
+ push @options, $locale->text('Customer type') . ' : ' . SL::DB::Business->new(id => $form->{business_id})->load->description if $form->{business_id};
+ push @options, $locale->text('Order Number') . " : $form->{ordnumber}" if $form->{ordnumber};
+ push @options, $locale->text('Notes') . " : $form->{notes}" if $form->{notes};
+ push @options, $locale->text('Transaction description') . " : $form->{transaction_description}" if $form->{transaction_description};
+ push @options, $locale->text('From') . " " . $locale->date(\%myconfig, $form->{transdatefrom}, 1) if $form->{transdatefrom};
+ push @options, $locale->text('Bis') . " " . $locale->date(\%myconfig, $form->{transdateto}, 1) if $form->{transdateto};