Ë
    Ã?ÆiQ
  ã                  óN   — d Z ddlmZ ddl­ ddlmZmZ d
d„Zdd„Zd
d„Z	dd„Z
y	)aÛ  BTW, TVA, NWSt, ondernemingsnummer (Belgian enterprise number).

The enterprise number (ondernemingsnummer) is a unique identifier of
companies within the Belgian administrative services. It was previously
the VAT ID number. The number consists of 10 digits.

>>> compact('BE403019261')
'0403019261'
>>> compact('(0)403019261')
'0403019261'
>>> validate('BE 428759497')
'0428759497'
>>> validate('BE431150351')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                óÚ   — t        | d«      j                  «       j                  «       } | j                  d«      r| dd } | j                  d«      rd| dd z   } t	        | «      dk(  rd| z   } | S )	zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.z -./ÚBEé   Nz(0)Ú0é   é	   )r   ÚupperÚstripÚ
startswithÚlen©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/be/vat.pyÚcompactr   ,   ss   € ô �6˜6Ó"×(Ñ(Ó*×0Ñ0Ó2€FØ×Ñ˜ÔØ˜˜�ˆØ×Ñ˜ÔØ�v˜a˜b�zÑ!ˆÜ
ˆ6ƒ{�aÒØ�v‘ˆØ€Mó    c                óB   — t        | dd «      t        | dd «      z   dz  S )zCalculate the checksum.Néþÿÿÿéa   )Úintr   s    r   Úchecksumr   9   s(   € ä��s˜�Óœs 6¨"¨# ;Ó/Ñ/°2Ñ5Ð5r   c                óä   — t        | «      } t        | «      rt        | «      dk  r
t        «       ‚t	        | «      dk7  r
t        «       ‚| d   dvr
t        «       ‚t        | «      dk7  r
t        «       ‚| S )zbCheck if the number is a valid VAT number. This checks the length,
    formatting and check digit.r   é
   Ú01)	r   r   r   ÚInvalidFormatr   ÚInvalidLengthÚInvalidComponentr   ÚInvalidChecksumr   s    r   Úvalidater"   >   sl   € ô �V‹_€FÜ�FÔœs 6›{¨aÒ/Ü‹oÐÜ
ˆ6ƒ{�bÒÜ‹oÐØ�!‰9˜ÑÜÓ Ð Ü�Ó˜1ÒÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z*Check if the number is a valid VAT number.F)Úboolr"   ÚValidationErrorr   s    r   Úis_validr&   M   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"N)r   ÚstrÚreturnr'   )r   r'   r(   r   )r   r'   r(   r$   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r   r"   r&   © r   r   ú<module>r.      s)   ðñ(õ$ #ä ß 'ó
ó6ó
ôr   