iban human readable
This commit is contained in:
parent
183b205c32
commit
6923bd9c06
@ -758,7 +758,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans($ibankey).'</td>';
|
||||
print '<td>'.$object->iban.' ';
|
||||
print '<td>'.getIbanHumanReadable($object).' ';
|
||||
if (!empty($object->iban)) {
|
||||
if (!checkIbanForAccount($object)) {
|
||||
print img_picto($langs->trans("IbanNotValid"), 'warning');
|
||||
|
||||
@ -290,6 +290,24 @@ function checkIbanForAccount(Account $account)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the iban human readable
|
||||
*
|
||||
* @param Account $account Account object
|
||||
* @return string
|
||||
*/
|
||||
function getIbanHumanReadable(Account $account)
|
||||
{
|
||||
if ($account->getCountryCode() == 'FR') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/php-iban/oophp-iban.php';
|
||||
$ibantoprint = preg_replace('/[^a-zA-Z0-9]/', '', $account->iban);
|
||||
$iban = new PHP_IBAN\IBAN($ibantoprint);
|
||||
return $iban->HumanFormat();
|
||||
}
|
||||
|
||||
return $account->iban;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check account number informations for a bank account
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user