From 284b226e18d898ecbeceef0f8bb215c3c1ad8aa7 Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Tue, 21 Dec 2010 13:07:59 +0100 Subject: [PATCH] Bug 1520: Division by zero Fehler MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit verhindern, daß Preisfaktor 0 ist --- SL/IS.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SL/IS.pm b/SL/IS.pm index 590923361..f9f8046f7 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -1277,7 +1277,7 @@ sub cogs { # total expenses and inventory # sellprice is the cost of the item - my $linetotal = $form->round_amount(($ref->{sellprice} * $qty) / ($ref->{price_factor} * ( $basefactor || 1 )), 2); + my $linetotal = $form->round_amount(($ref->{sellprice} * $qty) / ( ($ref->{price_factor} ̣|| 1) * ( $basefactor || 1 )), 2); if (!$main::eur) { $ref->{expense_accno} = ($form->{"expense_accno_$row"}) ? $form->{"expense_accno_$row"} : $ref->{expense_accno}; -- 2.20.1