diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index d7a57f25818..ee6e39c591c 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -34,7 +34,7 @@ class modExpenseReport extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param Database $db Database handler + * @param DoliDb $db Database handler */ public function __construct($db) { diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index 27bf6dc1c8f..05d0f3f8a7c 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -553,8 +553,6 @@ class MultiCurrency extends CommonObject */ public static function getAmountConversionFromInvoiceRate($fk_facture, $amount, $way = 'dolibarr', $table = 'facture') { - global $db; - $multicurrency_tx = self::getInvoiceRate($fk_facture, $table); if ($multicurrency_tx) @@ -588,10 +586,11 @@ class MultiCurrency extends CommonObject } /** - * With free account we can't set source then recalcul all rates to force another source + * With free account we can't set source then recalcul all rates to force another source. + * This modify the array &$TRate. * * @param stdClass $TRate Object containing all currencies rates - * @return -1 if KO, 0 if nothing, 1 if OK + * @return int -1 if KO, 0 if nothing, 1 if OK */ public static function recalculRates(&$TRate) { diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php index b67f56db935..3bb4f7312ee 100644 --- a/htdocs/variants/class/ProductCombination.class.php +++ b/htdocs/variants/class/ProductCombination.class.php @@ -542,18 +542,10 @@ WHERE c.fk_product_parent = ".(int) $productid." AND p.tosell = 1"; } //Final weight impact - $weight_impact = $forced_weightvar; - - if ($forced_weightvar === false) { - $weight_impact = 0; - } + $weight_impact = (float) $forced_weightvar; // If false, return 0 //Final price impact - $price_impact = $forced_pricevar; - - if ($forced_pricevar === false) { - $price_impact = 0; - } + $price_impact = (float) $forced_pricevar; // If false, return 0 $newcomb = new ProductCombination($db); $existingCombination = $newcomb->fetchByProductCombination2ValuePairs($product->id, $combinations); diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index fa5eab60fa8..ae5f1f285a4 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -1003,7 +1003,7 @@ function getListOfProductsOrServices($authentication, $filterproduct) * * @param array $authentication Array of authentication information * @param array $id Category id - * @param $lang $lang Force lang + * @param Translate $lang Force lang * @return array Array result */ function getProductsForCategory($authentication, $id, $lang = '')