From 582f4e7c76a12269007e0148131c5e5f713a812d Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 22 Nov 2006 16:25:13 +0000 Subject: [PATCH] Recommit von r1152 von skoehler: Nachtag zu r1125, neue format_amount gab keine negativen Zahlen zurueck --- SL/Form.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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; -- 2.20.1