Ë
    Ã?ÆiI  ã                  ó^   — d Z ddlmZ ddl­ ddlmZ ddlmZ ddlm	Z	m
Z
 dd„Zdd„Zdd	„Zy
)aþ  Btw-identificatienummer (Omzetbelastingnummer, the Dutch VAT number).

The btw-identificatienummer (previously the btw-nummer) is the Dutch number
for identifying parties in a transaction for which VAT is due. The btw-nummer
is used in communication with the tax agency while the
btw-identificatienummer (EORI-nummer) can be used when dealing with other
companies though they are used interchangeably.

The btw-nummer consists of a RSIN or BSN followed by the letter B and two
digits that identify the number of the company created. The
btw-identificatienummer has a similar format but different checksum and does
not contain the BSN.

More information:

* https://en.wikipedia.org/wiki/VAT_identification_number
* https://nl.wikipedia.org/wiki/Btw-nummer_(Nederland)

>>> validate('004495445B01')
'004495445B01'
>>> validate('NL4495445B01')
'004495445B01'
>>> validate('NL002455799B11')  # valid since 2020-01-01
'002455799B11'
>>> validate('123456789B90')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
é    )Úannotations)Ú*)Ú	mod_97_10)Úbsn)ÚcleanÚisdigitsc                óº   — t        | d«      j                  «       j                  «       } | j                  d«      r| dd } t	        j
                  | dd «      | dd z   S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.z -.ÚNLé   Néýÿÿÿ)r   ÚupperÚstripÚ
startswithr   Úcompact©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/nl/btw.pyr   r   :   s[   € ô �6˜5Ó!×'Ñ'Ó)×/Ñ/Ó1€FØ×Ñ˜ÔØ˜˜�ˆÜ�;‰;�v˜c˜r�{Ó# f¨R¨S kÑ1Ð1ó    c                óˆ  — t        | «      } t        | dd «      rt        | dd «      dk  r
t        «       ‚t        | dd «      rt        | dd «      dk  r
t        «       ‚t	        | «      dk7  r
t        «       ‚| d   dk7  r
t        «       ‚t        j                  | dd «      s"t        j                  d| z   «      s
t        «       ‚| S )zbCheck if the number is a valid btw number. This checks the length,
    formatting and check digit.Né	   r   é
   é   ÚBr
   )
r   r   ÚintÚInvalidFormatÚlenÚInvalidLengthr   Úis_validr   ÚInvalidChecksumr   s    r   Úvalidater    C   sµ   € ô �V‹_€FÜ�F˜2˜A�JÔ¤3 v¨b¨q z£?°aÒ#7Ü‹oÐÜ�F˜2˜3�KÔ ¤C¨¨r¨s¨Ó$4¸Ò$9Ü‹oÐÜ
ˆ6ƒ{�bÒÜ‹oÐØˆa�y�CÒÜ‹oÐÜ�<‰<˜˜r ˜
Ô#¬I×,>Ñ,>¸tÀf¹}Ô,MÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z*Check if the number is a valid btw number.F)Úboolr    ÚValidationErrorr   s    r   r   r   T   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"N)r   ÚstrÚreturnr$   )r   r$   r%   r"   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.iso7064r   Ú	stdnum.nlr   Ústdnum.utilr   r   r   r    r   © r   r   ú<module>r-      s*   ðñ(õ< #ä Ý $Ý ß 'ó2óô"r   