Skip to content
Snippets Groups Projects
Commit c2568020 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix IBAN class is uppercase

parent 32626c5a
No related branches found
No related tags found
No related merge requests found
<?php <?php
/* Copyright (C) 2006-2007 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* *
...@@ -134,7 +134,7 @@ function checkSwiftForAccount($account) ...@@ -134,7 +134,7 @@ function checkSwiftForAccount($account)
} }
/** /**
* Check IBAN number informations for a bank account * Check IBAN number informations for a bank account.
* *
* @param Account $account A bank account * @param Account $account A bank account
* @return boolean True if informations are valid, false otherwise * @return boolean True if informations are valid, false otherwise
...@@ -142,14 +142,12 @@ function checkSwiftForAccount($account) ...@@ -142,14 +142,12 @@ function checkSwiftForAccount($account)
function checkIbanForAccount($account) function checkIbanForAccount($account)
{ {
require_once DOL_DOCUMENT_ROOT.'/includes/php-iban/oophp-iban.php'; require_once DOL_DOCUMENT_ROOT.'/includes/php-iban/oophp-iban.php';
$iban = new Iban($account->iban);
$iban = new IBAN($account->iban);
$check = $iban->Verify(); $check = $iban->Verify();
if ($check) {
return true;
} else {
return false;
}
if ($check) return true;
else return false;
} }
/** /**
...@@ -225,6 +223,8 @@ function checkBanForAccount($account) ...@@ -225,6 +223,8 @@ function checkBanForAccount($account)
return true; return true;
} }
/** /**
* Returns the key for Spanish Banks Accounts * Returns the key for Spanish Banks Accounts
* *
...@@ -232,7 +232,8 @@ function checkBanForAccount($account) ...@@ -232,7 +232,8 @@ function checkBanForAccount($account)
* @param string $InumCta InumCta * @param string $InumCta InumCta
* @return string Key * @return string Key
*/ */
function checkES($IentOfi, $InumCta) { function checkES($IentOfi, $InumCta)
{
if (empty($IentOfi) || empty($InumCta) || strlen($IentOfi) != 8 || strlen($InumCta) != 10) { if (empty($IentOfi) || empty($InumCta) || strlen($IentOfi) != 8 || strlen($InumCta) != 10) {
$keycontrol = ""; $keycontrol = "";
return $keycontrol; return $keycontrol;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment