]> wagnertech.de Git - mfinanz.git/blobdiff - SL/IS.pm
Bug 1520: Division by zero Fehler
[mfinanz.git] / SL / IS.pm
index 590923361bd293b8548ab10128f7628c58ef149b..f9f8046f7a0fca84d442e2fd1e317767b041f13e 100644 (file)
--- 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};