Ë
    Ã?Æit
  ã                  óJ   — d Z ddlmZ ddlmZ ddl­ d
d„Zd
d„Zdd„Zd
d„Z	y	)u'  VAT, MWST, TVA, IVA, TPV (Mehrwertsteuernummer, the Swiss VAT number).

The Swiss VAT number is based on the UID but is followed by either "MWST"
(Mehrwertsteuer, the German abbreviation for VAT), "TVA" (Taxe sur la valeur
ajoutÃ©e in French), "IVA" (Imposta sul valore aggiunto in Italian) or "TPV"
(Taglia sin la plivalur in Romanian).

This module only supports the "new" format that was introduced in 2011 which
completely replaced the "old" 6-digit format in 2014.

More information:

* https://www.ch.ch/en/value-added-tax-number-und-business-identification-number/
* https://www.uid.admin.ch/

>>> validate('CHE-107.787.577 IVA')
'CHE107787577IVA'
>>> validate('CHE-107.787.578 IVA')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> format('CHE107787577IVA')
'CHE-107.787.577 IVA'
é    )Úannotations)Úuid)Ú*c                ó,   — t        j                  | «      S )zhConvert the number to the minimal representation. This strips
    surrounding whitespace and separators.)r   Úcompact©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/ch/vat.pyr   r   4   s   € ô �;‰;�vÓÐó    c                óœ   — t        | «      } t        | «      dvr
t        «       ‚t        j                  | dd «       | dd dvr
t        «       ‚| S )zbCheck if the number is a valid VAT number. This checks the length,
    formatting and check digit.)é   é   Né   )ÚMWSTÚTVAÚIVAÚTPV)r   ÚlenÚInvalidLengthr   ÚvalidateÚInvalidComponentr   s    r
   r   r   :   sP   € ô �V‹_€FÜ
ˆ6ƒ{˜(Ñ"Ü‹oÐÜ‡L�L�˜˜�ÔØˆbˆc€{Ð7Ñ7ÜÓ Ð Ø€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   F   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óZ   — t        | «      } t        j                  | dd «      dz   | dd z   S )z8Reformat the number to the standard presentation format.Nr   ú )r   r   Úformatr   s    r
   r   r   N   s0   € ä�V‹_€FÜ�:‰:�f˜S˜b�kÓ" SÑ(¨6°"°#¨;Ñ6Ð6r   N)r	   ÚstrÚreturnr   )r	   r   r    r   )
Ú__doc__Ú
__future__r   Ú	stdnum.chr   Ústdnum.exceptionsr   r   r   r   © r   r
   ú<module>r&      s)   ðñ*õ2 #å Ü óó	óô7r   