From b1c4912afc714f794291a4f80c2316456e3be94e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 23 Oct 2024 23:26:48 +0200 Subject: [PATCH] fix phpstan (#31493) * fix phpstan * fix phpstan --- phpstan.neon.dist | 1 - .../email_expire_services_to_customers.php | 14 +++++++------- .../email_unpaid_invoices_to_representatives.php | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 10f34675db2..9d12d9234aa 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -93,7 +93,6 @@ parameters: - '#(?:(?:Asset::addDepreciationL|Facture(?:(?:(?:Fournisseur)?::add|Fournisseur::update)l))ine\(\)|calcul_price_total|dol_convertToWord|(?: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,#' - - '# (envoi_mail|sendEmailTo) expects string, \(float\|int\) given.#' - '#::printStdColumnContent\(\) expects string, float(\|(int|array)(\<.*\>)?)* given.#' - '#::HTML2OpenIDServer\(\) expects string, array given.#' - '#create_line\(\) expects string, float given.#' diff --git a/scripts/contracts/email_expire_services_to_customers.php b/scripts/contracts/email_expire_services_to_customers.php index 6b7e5e09421..c9b027c3691 100755 --- a/scripts/contracts/email_expire_services_to_customers.php +++ b/scripts/contracts/email_expire_services_to_customers.php @@ -1,11 +1,11 @@ #!/usr/bin/env php - * Copyright (C) 2005-2013 Laurent Destailleur - * Copyright (C) 2013 Juanjo Menent - * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2005 Rodolphe Quiedeville + * Copyright (C) 2005-2013 Laurent Destailleur + * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2024 Frédéric France + * 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 @@ -155,7 +155,7 @@ if ($resql) { if ($startbreak) { // Break onto sales representative (new email or cid) if (dol_strlen($oldemail) && $oldemail != 'none' && empty($trackthirdpartiessent[$oldsid.'|'.$oldemail])) { - sendEmailTo($mode, $oldemail, $message, $total, $oldlang, $oldtarget, (int) $duration_value); + sendEmailTo($mode, $oldemail, $message, price2num($total), $oldlang, $oldtarget, (int) $duration_value); $trackthirdpartiessent[$oldsid.'|'.$oldemail] = 'contact id '.$oldcid; } else { if ($oldemail != 'none') { @@ -209,7 +209,7 @@ if ($resql) { // If there are remaining messages to send in the buffer if ($foundtoprocess) { if (dol_strlen($oldemail) && $oldemail != 'none' && empty($trackthirdpartiessent[$oldsid.'|'.$oldemail])) { // Break onto email (new email) - sendEmailTo($mode, $oldemail, $message, $total, $oldlang, $oldtarget, (int) $duration_value); + sendEmailTo($mode, $oldemail, $message, price2num($total), $oldlang, $oldtarget, (int) $duration_value); $trackthirdpartiessent[$oldsid.'|'.$oldemail] = 'contact id '.$oldcid; } else { if ($oldemail != 'none') { diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index a5b176c4f72..ce4347d8ebc 100755 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -125,7 +125,7 @@ if ($resql) { if (($obj->email != $oldemail || $obj->uid != $olduid) || $oldemail == 'none') { // Break onto sales representative (new email or uid) if (dol_strlen($oldemail) && $oldemail != 'none') { - envoi_mail($mode, $oldemail, $message, $total, $oldlang, $oldsalerepresentative); + envoi_mail($mode, $oldemail, $message, price2num($total), $oldlang, $oldsalerepresentative); } else { if ($oldemail != 'none') { print "- No email sent for ".$oldsalerepresentative.", total: ".$total."\n"; @@ -173,7 +173,7 @@ if ($resql) { // If there are remaining messages to send in the buffer if ($foundtoprocess) { if (dol_strlen($oldemail) && $oldemail != 'none') { // Break onto email (new email) - envoi_mail($mode, $oldemail, $message, $total, $oldlang, $oldsalerepresentative); + envoi_mail($mode, $oldemail, $message, price2num($total), $oldlang, $oldsalerepresentative); } else { if ($oldemail != 'none') { print "- No email sent for ".$oldsalerepresentative.", total: ".$total."\n";