[lms-en] Latvian translation IBAN validation

Tomasz Chiliński tomasz.chilinski at chilan.com
Mon Aug 12 18:38:35 CEST 2013


W dniu 12.08.2013 01:55, Kristaps Dravnieks napisał(a):
> Hello!

Hello,

> I am working on Latvian translation

Nice to hear that.

> 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}'

Have you read the article below yet?
http://en.wikipedia.org/wiki/International_Bank_Account_Number
I think it will be possible to adjust calculations in system.php for 
Latvian
bank accounts according to knowledge covered in this article.

> Thanks!

-- 
Bests,
Tomasz Chiliński, Chilan


More information about the lms-en mailing list