From 5b0ec556775824edf8fbf5f226dae1059a3ba1a5 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 25 Jun 2008 16:01:47 +0000 Subject: [PATCH] =?utf8?q?Form::format=5Famount=5Funits()=20darf=20auch=20?= =?utf8?q?ohne=20die=20Parameter=20amount=20und=20part=5Funit=20aufgerufen?= =?utf8?q?=20werden.=20Kein=20amount=20wird=20einfach=20als=200=20gewertet?= =?utf8?q?,=20und=20wenn=20part=5Funit=20fehlt,=20so=20wird=20schlicht=20e?= =?utf8?q?in=20leerer=20String=20zur=C3=BCckgegeben.=20Macht=20Ausgaben=20?= =?utf8?q?wie=20den=20Lagerinhalt=20inkl.=20leerer=20Lagerpl=C3=A4tze=20au?= =?utf8?q?s=20wh.pl=20einfacher.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Form.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index 59e01de07..d8077528f 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -919,16 +919,19 @@ sub format_amount_units { my $self = shift; my %params = @_; - Common::check_params(\%params, qw(amount part_unit)); - my $myconfig = \%main::myconfig; - my $amount = $params{amount}; + my $amount = $params{amount} * 1; my $places = $params{places}; my $part_unit_name = $params{part_unit}; my $amount_unit_name = $params{amount_unit}; my $conv_units = $params{conv_units}; my $max_places = $params{max_places}; + if (!$part_unit_name) { + $main::lxdebug->leave_sub(); + return ''; + } + AM->retrieve_all_units(); my $all_units = $main::all_units; -- 2.20.1