From ed7a0c4a20b1b6b55540c28fbb9bf2010a47be76 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 27 May 2014 17:42:24 +0200 Subject: [PATCH] Mal wieder ein paar lexicals in post if. --- SL/Controller/CsvImport/Order.pm | 3 ++- SL/IS.pm | 2 +- SL/OE.pm | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/SL/Controller/CsvImport/Order.pm b/SL/Controller/CsvImport/Order.pm index fe7301936..1a8f4d145 100644 --- a/SL/Controller/CsvImport/Order.pm +++ b/SL/Controller/CsvImport/Order.pm @@ -346,7 +346,8 @@ sub handle_salesman { my ($self, $entry) = @_; my $object = $entry->{object}; - my $vc_obj = SL::DB::Customer->new(id => $object->customer_id)->load if $object->customer_id; + my $vc_obj; + $vc_obj = SL::DB::Customer->new(id => $object->customer_id)->load if $object->customer_id; $vc_obj = SL::DB::Vendor->new(id => $object->vendor_id)->load if (!$vc_obj && $object->vendor_id); # salesman from customer/vendor or login if not given diff --git a/SL/IS.pm b/SL/IS.pm index 5a6484505..64afc530a 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -397,7 +397,7 @@ sub invoice_details { push(@{ $form->{TEMPLATE_ARRAYS}->{taxnumber} }, $form->{"${item}_taxnumber"}); my $tax_obj = SL::DB::Manager::Tax->find_by(taxnumber => $form->{"${item}_taxnumber"}); - my $description = $tax_obj->translated_attribute('taxdescription', $form->{language_id}, 0) if $tax_obj; + my $description = $tax_obj ? $tax_obj->translated_attribute('taxdescription', $form->{language_id}, 0) : ''; push(@{ $form->{TEMPLATE_ARRAYS}->{taxdescription} }, $description . q{ } . 100 * $form->{"${item}_rate"} . q{%}); } diff --git a/SL/OE.pm b/SL/OE.pm index 524af26ef..326e89c70 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -1352,7 +1352,7 @@ sub order_details { push(@{ $form->{TEMPLATE_ARRAYS}->{taxnumber} }, $form->{"${item}_taxnumber"}); my $tax_obj = SL::DB::Manager::Tax->find_by(taxnumber => $form->{"${item}_taxnumber"}); - my $description = $tax_obj->translated_attribute('taxdescription', $form->{language_id}, 0) if $tax_obj; + my $description = $tax_obj ? $tax_obj->translated_attribute('taxdescription', $form->{language_id}, 0) : ''; push(@{ $form->{TEMPLATE_ARRAYS}->{taxdescription} }, $description . q{ } . 100 * $form->{"${item}_rate"} . q{%}); } -- 2.20.1