From: Moritz Bunkus Date: Wed, 22 Nov 2006 16:25:13 +0000 (+0000) Subject: Recommit von r1152 von skoehler: Nachtag zu r1125, neue format_amount gab keine negat... X-Git-Tag: release-2.4.0^2~213 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=582f4e7c76a12269007e0148131c5e5f713a812d;p=kivitendo-erp.git Recommit von r1152 von skoehler: Nachtag zu r1125, neue format_amount gab keine negativen Zahlen zurueck --- diff --git a/SL/Form.pm b/SL/Form.pm index 49e09818c..d21e3f87c 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -647,10 +647,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;