Skip to content

Commit

Permalink
FIX Fatal Error PHP 8 : division by 0 (Dolibarr#25384)
Browse files Browse the repository at this point in the history
* FIX Fatal Error PHP 8 : division by 0

* Update objectline_view.tpl.php

---------

Co-authored-by: atm-lena <lena.papazian@atm-consulting.fr>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
  • Loading branch information
3 people authored and Anthony Berton committed Aug 1, 2023
1 parent 627e414 commit bbc96f3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions htdocs/bom/tpl/objectline_view.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,17 @@
$resql_supplier_price = $object->db->query($sql_supplier_price);
if ($resql_supplier_price) {
$obj = $object->db->fetch_object($resql_supplier_price);
<<<<<<< HEAD
if (!empty($obj->qty) && !empty($sub_bom_line->qty) && !empty($line->qty)) $line_cost = $obj->min_price/$obj->qty * $sub_bom_line->qty * $line->qty;
else $line_cost = $obj->min_price;

=======
if (!empty($obj->qty) && !empty($sub_bom_line->qty) && !empty($line->qty)) {
$line_cost = $obj->min_price/$obj->qty * $sub_bom_line->qty * $line->qty;
} else {
$line_cost = $obj->min_price;
}
>>>>>>> 5997ae4bb7f (FIX Fatal Error PHP 8 : division by 0 (#25384))
print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'"><span class="amount">'.price2num($line_cost, 'MT').'</span></td>';
$total_cost+= $line_cost;
}
Expand Down

0 comments on commit bbc96f3

Please sign in to comment.