ATOUTFOX
COMMUNAUTÉ FRANCOPHONE DES PROFESSIONNELS FOXPRO
Visual FoxPro : le développement durable

fonction de calcul de la clé IBAN   



L'auteur

eric leissler
France France
Membre Simple
# 0000002784
enregistré le 06/03/2010
http://www.aumeric.fr
67 ans
LEISSLER Eric
85290 MORTAGNE SUR SEVRE
de la société AUMERIC LOGICIELS
Fiche personnelle


Note des membres
18/20
1 vote


Contributions > 01 - PRG : Programmation > Calculs de clefs et Checksums (rib, iban, ...)

fonction de calcul de la clé IBAN
# 0000000084
ajouté le 21/11/2004 20:20:55 et modifié le 26/10/2008
consulté 12246 fois
Niveau initié

Version(s) Foxpro :
VFP 9.0
VFP 8.0
VFP 7.0
VFP 6.0
VFP 5.0
VFP 3.0
FPW 2.6
FPD 2.x

Description

Le calcul de la clé IBAN 

Francois, tu avais raison mon code était faux !

Méa culpa 

Je l'ai corrigé maintenant.

A plus

Aumeric

 

 

A priori en France, s'il n'y a pas de lettre dans le numéro de comte  le code est systématiquement 76.

 

Code source :

Function cleIban( nocompte)
m.cleiban=""
m.nocompte=ChrTran(m.nocompte,"AJBKSCLTDMUENVFOWGPXHQYIRZ","11222333444555666777888999")
m.nocompte = strtran( m.nocompte, "-""")
m.nocompte = strtran( m.nocompte, " """)
m.cleiban=int(MOD(VAL(SUBSTR(m.nocompte,1,9)),97))
m.cleiban1=padl(cleiban,2,"0")+substr(m.nocompte,10,7)
m.cleiban2= int(MOD(VAL(m.cleiban1),97))
m.cleiban3=padl(cleiban2,2,"0")+substr(m.nocompte,18,5)+"11"
m.cleiban4= int(MOD(VAL(m.cleiban3),97))
m.cleiban5=padl(cleiban4,2,"0")+"41"
m.cleiban6=int(MOD(val(m.cleiban5),97))


m.cleiban7=PADL(m.cleiban6,2,"0")
Return "FR" + m.cleiban7 + m.nocompte



Commentaires
le 20/04/2006, eric leissler a écrit :
Francois avait raison, mon code était faux
Je l'ai donc corrigé.
Méa culpa mais vive atoutfox
Cordialement
Aumeric


Publicité

Les pubs en cours :


www.atoutfox.org - Site de la Communauté Francophone des Professionnels FoxPro - v3.4.0 - © 2004-2024.
Cette page est générée par un composant COM+ développé en Visual FoxPro 9.0-SP2-HF3