Merge pull request #27851 from thibdrev/patch-3

qual: phpstan for htdocs/product/class/product.class.php
This commit is contained in:
Laurent Destailleur 2024-01-29 00:46:07 +01:00 committed by GitHub
commit 3f82e3153a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2358,7 +2358,7 @@ class Product extends CommonObject
$price_min_ttc = 0;
}
} else {
$price = price2num($newprice, 'MU');
$price = (float) price2num($newprice, 'MU');
$price_ttc = ($newnpr != 1) ? (float) price2num($newprice) * (1 + ($newvat / 100)) : $price;
$price_ttc = price2num($price_ttc, 'MU');
@ -2905,8 +2905,8 @@ class Product extends CommonObject
if ($price_result >= 0) {
$this->price = $price_result;
// Calculate the VAT
$this->price_ttc = price2num($this->price) * (1 + ($this->tva_tx / 100));
$this->price_ttc = price2num($this->price_ttc, 'MU');
$this->price_ttc = (float) price2num($this->price) * (1 + ($this->tva_tx / 100));
$this->price_ttc = (float) price2num($this->price_ttc, 'MU');
}
}
@ -5062,7 +5062,7 @@ class Product extends CommonObject
/**
* Return if loaded product is a variant
*
* @return int
* @return bool|int Return true if the product is a variant, false if not, -1 if error
*/
public function isVariant()
{
@ -5587,7 +5587,7 @@ class Product extends CommonObject
/**
* Retour label of nature of product
*
* @return string Label
* @return string|int Return label or ''. -1 if error
*/
public function getLibFinished()
{