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)`
This commit is contained in:
Steve 2018-07-16 17:10:33 +02:00
parent 5738020883
commit 9d3a0442c0

View File

@ -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;