[lms-en] Latvian translation IBAN validation

Kristaps Dravnieks kristaps at 3net.lv
Mon Aug 12 01:55:56 CEST 2013


Hello!
I am working on Latvian translation

Can someone help on system.php

lithuanian file has:
function bankaccount($id, $account=NULL)
{
global $DB;

if($account === NULL)
$account = $DB->GetOne('SELECT account FROM divisions WHERE id IN (SELECT
divisionid
                        FROM customers WHERE id = ?)', array($id));
 $acclen = strlen($account);
 if(!empty($account) && $acclen < 13 && $acclen >= 5)
{
$cc = '2129'; // Country Code - Lithuania
$format = '%0'.(16 - $acclen) .'d';
return
'LT'.sprintf('%02d',98-bcmod($account.sprintf($format,$id).$cc.'00',97)).$account.sprintf($format,$id);
}

return $account;
}
how to tweak that for Latvian IBAN?
Regex is for LV IBAN is: 'LV' => 'LV[0-9]{2}[A-Z]{4}[A-Z0-9]{13}'

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lms.org.pl/pipermail/lms-en/attachments/20130812/c1b1874c/attachment.html>


More information about the lms-en mailing list