From 16892d5c19dc0ef8a773cccd39aad972fd2a7856 Mon Sep 17 00:00:00 2001 From: MDW Date: Thu, 28 Mar 2024 02:04:00 +0100 Subject: [PATCH] Fix phan notice with cast --- htdocs/mrp/tpl/originproductline.tpl.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php index 237a9914246..fc85c3f14cd 100644 --- a/htdocs/mrp/tpl/originproductline.tpl.php +++ b/htdocs/mrp/tpl/originproductline.tpl.php @@ -1,6 +1,7 @@ * Copyright (C) 2017 Charlie Benke + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -71,7 +72,7 @@ print ''.$this->tpl['qty'].(($this->tpl['efficiency'] > 0 && $ print ''.measuringUnitString($this->tpl['fk_unit'], '', '', 1).''; print ''; if ($tmpproduct->isStockManaged()) { - print (empty($this->tpl['stock']) ? 0 : price2num($this->tpl['stock'], 'MS')); + print(empty($this->tpl['stock']) ? 0 : price2num($this->tpl['stock'], 'MS')); if ($this->tpl['seuil_stock_alerte'] != '' && ($this->tpl['stock'] < $this->tpl['seuil_stock_alerte'])) { print ' '.img_warning($langs->trans("StockLowerThanLimit", $this->tpl['seuil_stock_alerte'])); } @@ -79,7 +80,7 @@ if ($tmpproduct->isStockManaged()) { print ''; print ''; if ($tmpproduct->isStockManaged()) { - print ((empty($this->tpl['virtual_stock']) ? 0 : price2num($this->tpl['virtual_stock'], 'MS'))); + print((empty($this->tpl['virtual_stock']) ? 0 : price2num($this->tpl['virtual_stock'], 'MS'))); if ($this->tpl['seuil_stock_alerte'] != '' && ($this->tpl['virtual_stock'] < $this->tpl['seuil_stock_alerte'])) { print ' '.img_warning($langs->trans("StockLowerThanLimit", $this->tpl['seuil_stock_alerte'])); } @@ -110,7 +111,7 @@ print ''."\n"; // Select of all the sub-BOM lines $sql = 'SELECT rowid, fk_bom_child, fk_product, qty FROM '.MAIN_DB_PREFIX.'bom_bomline AS bl'; -$sql.= ' WHERE fk_bom ='. (int) $tmpbom->id; +$sql .= ' WHERE fk_bom ='. (int) $tmpbom->id; $resql = $db->query($sql); if ($resql) { @@ -148,7 +149,7 @@ if ($resql) { if ($sub_bom_line->qty_frozen > 0) { print ''.price($sub_bom_line->qty, 0, '', 0, 0).''; } else { - print ''.price($sub_bom_line->qty * $line->qty, 0, '', 0, 0).''; + print ''.price($sub_bom_line->qty * (float) $line->qty, 0, '', 0, 0).''; } // Unit