From: Stephan Köhler Date: Fri, 9 Jun 2006 13:51:24 +0000 (+0000) Subject: Nachtag zu r1125, neue format_amount gab keine negativen Zahlen zurueck X-Git-Tag: release-2.4.0^2~272 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=a4a6a0d34b965bec11b5a8de554a21fa7370a9d6;p=kivitendo-erp.git Nachtag zu r1125, neue format_amount gab keine negativen Zahlen zurueck --- diff --git a/SL/Form.pm b/SL/Form.pm index b97833e77..9e55af355 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -627,10 +627,11 @@ sub format_amount { $amount = $p[0]; $amount .= $d[0].$p[1].(0 x ($places - length $p[1])) if ($places || $p[1] ne ''); - $amount = ($neg) ? "($amount)" : "$amount" if $dash =~ ?-?; - $amount = ($neg) ? "$amount DR" : "$amount CR" if $dash =~ ?DRCR?; - $amount = ($neg) ? "-$amount" : "$amount" if $dash =~ ??; - reset; + $amount = do { + ($dash =~ /-/) ? ($neg ? "($amount)" : "$amount" ) : + ($dash =~ /DRCR/) ? ($neg ? "$amount DR" : "$amount CR" ) : + ($neg ? "-$amount" : "$amount" ) ; + }; $main::lxdebug->leave_sub(2); return $amount;