diff --git a/htdocs/core/lib/functionsnumtoword.lib.php b/htdocs/core/lib/functionsnumtoword.lib.php index 50b0dacbe92..7c7ace312da 100644 --- a/htdocs/core/lib/functionsnumtoword.lib.php +++ b/htdocs/core/lib/functionsnumtoword.lib.php @@ -1,7 +1,8 @@ - * Copyright (C) 2015 Víctor Ortiz Pérez - * Copyright (C) 2024 MDW +/* Copyright (C) 2015 Laurent Destailleur + * Copyright (C) 2015 Víctor Ortiz Pérez + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -139,7 +140,7 @@ function dol_convertToWord($num, $langs, $currency = '', $centimes = false) $concatWords .= ' '.$langs->transnoentities('and'); } - $concatWords .= ' '.dol_convertToWord($decimalpart, $langs, '', true); + $concatWords .= ' '.dol_convertToWord((float) $decimalpart, $langs, '', true); if (!empty($currency)) { $concatWords .= ' '.$langs->transnoentities('centimes'); } diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php index 27b79ba5c41..57ac5692220 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php @@ -524,7 +524,7 @@ class pdf_standard_supplierpayment extends ModelePDFSuppliersPayments // translate amount $currency = $conf->currency; - $translateinletter = strtoupper(dol_convertToWord(price2num($object->amount, 'MT'), $outputlangs, $currency)); + $translateinletter = strtoupper(dol_convertToWord((float) price2num($object->amount, 'MT'), $outputlangs, $currency)); $pdf->SetXY($this->marge_gauche + 50, $posy); $pdf->SetFont('', '', $default_font_size - 3); $pdf->MultiCell(90, 8, $translateinletter, 0, 'L', 1); diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 8f96fbcae87..483e829b74e 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -88,7 +88,7 @@ parameters: - '#(?:dol_(?:mktime|remove_file_process)|print_actions_filter) expects int, array\|string given\.#' - '# (CSMSFile) constructor expects int, array\|string given.#' - '#(?:ProductFournisseur::logPrice\(\)) expects float\|null#' - - '#(?:(?:Asset::addDepreciationL|Facture(?:(?:(?:Fournisseur)?::add|Fournisseur::update)l))ine\(\)|calcul_price_total|dol_convertToWord|(?:loanCalcMonthlyPaymen|print_paypal_redirec)t) expects float, string given.#' + - '#(?:(?:Asset::addDepreciationL|Facture(?:(?:(?:Fournisseur)?::add|Fournisseur::update)l))ine\(\)|calcul_price_total|(?:loanCalcMonthlyPaymen|print_paypal_redirec)t) expects float, string given.#' - '#EvalMath::trigger\(\) expects string\|null,#' - '#(?:F(?:acture(?:(?:Fournisseur)?Rec::addline\(\))|ichinterRec::addLineRec\(\))|dolMd2Html|setEventMessages) expects string\|null,#' - '#::printStdColumnContent\(\) expects string, float(\|(int|array)(\<.*\>)?)* given.#'