Common Lisp Package: COM.INFORMATIMAGO.COMMON-LISP.BANK.RIB

This package provides a class representing a French "Relevé d'Identité Banquaire", composed of three codes and a control key value: (banque, branch-code, account-number, check-digits). See also: COM.INFORMATIMAGO.COMMON-LISP.BANK.IBAN -- the new European bank account numbers. License: Copyright Pascal Bourguignon 1994 - 2012 This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>

README:

FUNCTION

Private

Undocumented

COMPUTE-CHECK-DIGITS (BANK-CODE BRANCH-CODE ACCOUNT-NUMBER)

TEST

GENERIC-FUNCTION

Public

SETFACCOUNT-NUMBER (ACCOUNT-NUMBER RIB)

DO: Sets the account-number of the RIB. RETURN: RIB

SETFBANK-CODE (BANK-CODE RIB)

DO: Sets the bank-code of the RIB. RETURN: RIB

SETFBRANCH-CODE (BRANCH-CODE RIB)

DO: Sets the branch-code of the RIB. RETURN: RIB

CHECK-DIGITS (RIB)

RETURN: The check digits of the RIB.

GET-RIB (RIB &KEY WITH-SPACES (WITH-SPACES NIL))

RETURN: A string containing the RIB. When WITH-SPACES is true, spaces are used to separate the various fields of the RIB.

SET-ACCOUNT-NUMBER (RIB ACCOUNT-NUMBER)

DO: Sets the account-number of the RIB. RETURN: RIB

SET-BANK-CODE (RIB BANK-CODE)

DO: Sets the bank-code of the RIB. RETURN: RIB

SET-BRANCH-CODE (RIB BRANCH-CODE)

DO: Sets the branch-code of the RIB. RETURN: RIB

SET-RIB (RIB NEW-RIB &KEY WITH-CHECK-DIGITS (WITH-CHECK-DIGITS NIL))

DO: Replace the RIB fields with the data obtained from the NEW-RIB string. NEW-RIB: A string containing the new rib numbers. RETURN: RIB

SLOT-ACCESSOR

Public

ACCOUNT-NUMBER (RIB)

The RETURN: The account number of the RIB.

BANK-CODE (RIB)

The RETURN: The bank code of the RIB.

BRANCH-CODE (RIB)

The RETURN: The branch code of the RIB.

Private

CHECK-DIGITS-CHANGED (RIB)

The RETURN: The check digits changed flag. NOTE: The check-digits are updated lazily when other slots are changed. This flag indicates that check-digits need to be recomputed.

VARIABLE

Private

Undocumented

+ALPHABET-FROM+

+ALPHABET-VALUE+

CLASS

Public

RIB

INVARIANT: (length banque)=5, (length branch-code)=5, (length account-number)=11, (length check-digits)=2, for each attribute in {banque,branch-code,account-number,check-digits}, foreach i in [0,strlen(attribute)-1], attribute()[i] in {'0',...,'9','A',...,'Z'}. check-digits=f(banque,branch-code,account-number).

CONDITION

Private

RIB-ERROR

A RIB error