From 9d3a0442c0ef9c4e1d913d0cf98a1dcff7dd5e20 Mon Sep 17 00:00:00 2001 From: Steve Date: Mon, 16 Jul 2018 17:10:33 +0200 Subject: [PATCH] dolibarr-develop, php 7.2.7 On third party, add bank account. After spanish account has been added, on summary screen ..../htdocs/societe/paymentmodes.php a correct account number causes the error: Warning: A non-numeric value encountered in .......\public_html\dolibarr-develop\htdocs\core\lib\bank.lib.php on line 359 This is `$sum += $values[$i] * substr($InumCta, $i, 1);` Since substr returns a string it cannot be summed (I assume). I changed it to `$sum += $values[$i] * (int)substr($InumCta, $i, 1)` --- htdocs/core/lib/bank.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index 5e1e300520c..e361d8fa9f6 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -356,7 +356,7 @@ function checkES($IentOfi, $InumCta) $sum = 0; for ($i = 0; $i < 11; $i++) { - $sum += $values[$i] * substr($InumCta, $i, 1); + $sum += $values[$i] * (int)substr($InumCta, $i, 1);//int to cast result of substr to a number } $key = 11 - $sum % 11;