Ë
    Ã?ÆiÆ	  ã                  óR   — d Z ddlm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y	)a  Partita IVA (Italian VAT number).

The Partita IVA (Imposta sul valore aggiunto) consists of 11 digits. The
first 7 digits are a company identifier, the next 3 refer to the province
of residence and the last is a check digit.

The fiscal code for individuals is not accepted as valid code for
intracommunity VAT related operations so it is ignored here.

>>> validate('IT 00743110157')
'00743110157'
>>> validate('00743110158')  # invalid check digit
Traceback (most recent call last):
    ...
InvalidChecksum: ...
é    )Úannotations)Úluhn)Ú*)ÚcleanÚisdigitsc                ó‚   — t        | d«      j                  «       j                  «       } | j                  d«      r| dd } | S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.z -:ÚITé   N)r   ÚupperÚstripÚ
startswith©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/it/iva.pyÚcompactr   ,   s@   € ô �6˜5Ó!×'Ñ'Ó)×/Ñ/Ó1€FØ×Ñ˜ÔØ˜˜�ˆØ€Mó    c                ó  — t        | «      } t        | «      rt        | dd «      dk(  r
t        «       ‚t	        | «      dk7  r
t        «       ‚d| dd cxk  rdk  sn | dd dv s
t        «       ‚t        j                  | «       | S )zbCheck if the number is a valid VAT number. This checks the length,
    formatting and check digit.r   é   é   Ú001é
   Ú100)Ú120Ú121Ú888Ú999)	r   r   ÚintÚInvalidFormatÚlenÚInvalidLengthÚInvalidComponentr   Úvalidater   s    r   r"   r"   5   s~   € ô �V‹_€FÜ�FÔœs 6¨!¨A ;Ó/°1Ò4Ü‹oÐÜ
ˆ6ƒ{�bÒÜ‹oÐà�V˜A˜b�\Ô* UÔ*¨f°Q°r¨lÐ>ZÑ.ZÜÓ Ð Ü‡M�M�&ÔØ€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&   D   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"N)r   ÚstrÚreturnr'   )r   r'   r(   r$   )Ú__doc__Ú
__future__r   Ústdnumr   Ústdnum.exceptionsÚstdnum.utilr   r   r   r"   r&   © r   r   ú<module>r/      s'   ðñ(õ" #å Ü ß 'óóôr   