Update societe.class.php

Line 2942 throws an error in php 7 "Warning: A non-numeric value encountered" when doing math sum, as substr() may be empty.
Convert to intval(substr()) to fix.
This commit is contained in:
areaeuro 2018-05-18 10:27:54 +02:00 committed by GitHub
parent e503aeb2e5
commit 11714b9b6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2939,7 +2939,7 @@ class Societe extends CommonObject
//algorithm checking type code CIF
$sum = $num[2] + $num[4] + $num[6];
for ($i = 1; $i < 8; $i += 2)
$sum += substr((2 * $num[$i]),0,1) + substr((2 * $num[$i]),1,1);
$sum += intval(substr((2 * $num[$i]),0,1)) + intval(substr((2 * $num[$i]),1,1));
$n = 10 - substr($sum, strlen($sum) - 1, 1);
//Chek special NIF