X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIR.pm;h=86b1323fdd432710b23db8a64fe5db1cd45c7471;hb=07ad0fee6523cc8d9272dcb847a79f899fdeaf67;hp=602ffc36508b5f59b0981d282aac82f14720dcd9;hpb=b256bef1f542bc5f6c1a7aa38854e5a141e57af1;p=kivitendo-erp.git diff --git a/SL/IR.pm b/SL/IR.pm index 602ffc365..86b1323fd 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -400,12 +400,10 @@ sub post_invoice { # shall receive the total rounding error, and the next time it is rounded # the 1 cent correction will be introduced. - my $total_rounding_diff = $invoicediff+$expensediff; - $form->{amount}{ $form->{id} }{$lastinventoryaccno} -= $invoicediff if $lastinventoryaccno; $form->{amount}{ $form->{id} }{$lastexpenseaccno} -= $expensediff if $lastexpenseaccno; - if ( ($expensediff+$invoicediff) >= 0.005 and $expensediff < 0.005 and $invoicediff < 0.005 ) { + if ( (abs($expensediff)+abs($invoicediff)) >= 0.005 and abs($expensediff) < 0.005 and abs($invoicediff) < 0.005 ) { # in total the rounding error adds up to 1 cent effectively, correct the # larger of the two numbers