From: Bernd Bleßmann Date: Fri, 9 Nov 2018 14:20:08 +0000 (+0100) Subject: Part-Presenter: Typ u. Klassifizierung: Abfangen, wenn kein Argument übergeben X-Git-Tag: release-3.5.4~226 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=0ca195cd0ce041bbabc562e0cc7ad6590a7eebe3;p=kivitendo-erp.git Part-Presenter: Typ u. Klassifizierung: Abfangen, wenn kein Argument übergeben behebt #332 "Bug: Bericht Lagerbestand gibt Fehler beim einschliessen leerer Lagerplätze" --- diff --git a/SL/Presenter/Part.pm b/SL/Presenter/Part.pm index 8131eff14..4f2105caa 100644 --- a/SL/Presenter/Part.pm +++ b/SL/Presenter/Part.pm @@ -61,6 +61,8 @@ sub picker { goto &part_picker } # sub type_abbreviation { my ($part_type) = @_; + + return '' if !$part_type; return $::locale->text('Assembly (typeabbreviation)') if $part_type eq 'assembly'; return $::locale->text('Part (typeabbreviation)') if $part_type eq 'part'; return $::locale->text('Assortment (typeabbreviation)') if $part_type eq 'assortment'; @@ -87,6 +89,9 @@ sub type_abbreviation { # sub classification_abbreviation { my ($id) = @_; + + return '' if !$id; + SL::DB::Manager::PartClassification->cache_all(); my $obj = SL::DB::PartClassification->load_cached($id); $obj && $obj->abbreviation ? t8($obj->abbreviation) : ''; @@ -103,6 +108,9 @@ sub typeclass_abbreviation { # sub separate_abbreviation { my ($id) = @_; + + return '' if !$id; + SL::DB::Manager::PartClassification->cache_all(); my $obj = SL::DB::PartClassification->load_cached($id); $obj && $obj->abbreviation && $obj->report_separate ? t8($obj->abbreviation) : '';