From: Philip Reetz Date: Thu, 7 Dec 2006 16:53:28 +0000 (+0000) Subject: Fehler in format_amount. Wenn die uebergebene Variable leer ist, wurde ein Punkt X-Git-Tag: release-2.4.0^2~104 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=55f4154b938745ccf6c51802aa0ddf62f2ddf5cc;p=kivitendo-erp.git Fehler in format_amount. Wenn die uebergebene Variable leer ist, wurde ein Punkt zurueckgeliefert --- diff --git a/SL/Form.pm b/SL/Form.pm index 82962803c..cbfc81f32 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -654,6 +654,10 @@ sub format_amount { $main::lxdebug->enter_sub(2); my ($self, $myconfig, $amount, $places, $dash) = @_; + + if ($amount eq "") { + $amount = 0; + } my $neg = ($amount =~ s/-//); $amount = $self->round_amount($amount, $places) if ($places =~ /\d/); @@ -665,13 +669,14 @@ sub format_amount { $amount = $p[0]; $amount .= $d[0].$p[1].(0 x ($places - length $p[1])) if ($places || $p[1] ne ''); - + $amount = do { ($dash =~ /-/) ? ($neg ? "($amount)" : "$amount" ) : ($dash =~ /DRCR/) ? ($neg ? "$amount DR" : "$amount CR" ) : ($neg ? "-$amount" : "$amount" ) ; }; - + + $main::lxdebug->leave_sub(2); return $amount; }