From c2f2c60ea875a6946476c4959ee5c033e88dac3e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Wed, 11 Mar 2009 13:43:14 +0000 Subject: [PATCH] =?utf8?q?Potentieller=20Fix=20f=C3=BCr=20Bug=20879.=20IS:?= =?utf8?q?:cogs=20hatte=20unsicheres=20basefactor=20Handling.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/IS.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SL/IS.pm b/SL/IS.pm index c1ab0b644..98f283711 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -1212,6 +1212,9 @@ sub cogs { $main::lxdebug->enter_sub(); my ($dbh, $form, $id, $totalqty, $basefactor, $row) = @_; + + $basefactor ||= 1; + $form->{taxzone_id} *=1; my $transdate = $form->{invdate} ? $dbh->quote($form->{invdate}) : "current_date"; my $taxzone_id = $form->{"taxzone_id"} * 1; @@ -1242,7 +1245,7 @@ sub cogs { # total expenses and inventory # sellprice is the cost of the item - my $linetotal = $form->round_amount(($ref->{sellprice} * $qty) / $basefactor, 2); + my $linetotal = $form->round_amount(($ref->{sellprice} * $qty) / ( $basefactor || 1 ), 2); if (!$main::eur) { $ref->{expense_accno} = ($form->{"expense_accno_$row"}) ? $form->{"expense_accno_$row"} : $ref->{expense_accno}; -- 2.20.1