Ë
    Ã?Æi¦  ã                  óf   — d Z ddlmZ ddlmZ ddl­ ddlmZ ddlm	Z	m
Z
 dd„Zdd„Zdd	„Zdd
„Zy)at  NPWP (Nomor Pokok Wajib Pajak, Indonesian VAT Number).

The Nomor Pokok Wajib Pajak (NPWP) is assigned to organisations and
individuals (families) by the Indonesian Tax Office after registration by the
tax payers.

The number consists of 16 digits and is either a NIK (Nomor Induk Kependudukan)
or a number that starts with a 0, followed by 2 digits that denote the type of
entity, 6 digits to identify the tax payer, a check digit over the first 8
digits followed by 3 digits to identify the local tax office and 3 digits for
branch code.

This module also accepts the old 15 digit format which is just the 16 digit
format without the starting 0.

More information:

* https://www.oecd.org/tax/automatic-exchange/crs-implementation-and-assistance/tax-identification-numbers/Indonesia-TIN.pdf
* https://metacpan.org/pod/Business::ID::NPWP
* https://wiki.scn.sap.com/wiki/display/CRM/Indonesia

>>> validate('01.312.166.0-091.000')
'013121660091000'
>>> validate('016090524017000')
'016090524017000'
>>> validate('123456789')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> format('013000666091000')
'01.300.066.6-091.000'
é    )Úannotations)Úluhn)Ú*)Únik)ÚcleanÚisdigitsc                ó6   — t        | d«      j                  «       S )z’Convert the number to the minimal representation.

    This strips the number of any valid separators and removes
    surrounding whitespace.
    z -.)r   Ústrip©Únumbers    úU/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/id/npwp.pyÚcompactr   ?   s   € ô �˜Ó×%Ñ%Ó'Ð'ó    c                óB  — t        | «      } t        | «      s
t        «       ‚t        | «      dk(  rt	        j
                  | dd «       | S t        | «      dk(  r@| j                  d«      st        j
                  | «      S t	        j
                  | dd «       | S t        «       ‚)ú5Check if the number is a valid Indonesia NPWP number.é   Né	   é   Ú0é
   )	r   r   ÚInvalidFormatÚlenr   ÚvalidateÚ
startswithr   ÚInvalidLengthr   s    r   r   r   H   sˆ   € ä�V‹_€FÜ�FÔÜ‹oÐÜ
ˆ6ƒ{�bÒä�‰�f˜R˜a�jÔ!ØˆÜ
ˆ6ƒ{�bÒð × Ñ  Ô%Ü—<‘< Ó'Ð'Ü�‰�f˜S˜b�kÔ"ØˆÜ
‹/Ðr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r   F)Úboolr   ÚValidationErrorr   s    r   Úis_validr   [   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                ób   — t        | «      } | dd ›d| dd ›d| dd ›d| d   ›d| dd ›d| dd ›�S )	z8Reformat the number to the standard presentation format.Né   ú.é   é   ú-r   é   )r   r   s    r   Úformatr'   c   sF   € ä�V‹_€Fàˆr�Š
�F˜1˜Q’K ¨¨!¢¨f°Q«i¸ÀÀ"ºÀvÈbÈcÁ{ðTð Tr   N)r   ÚstrÚreturnr(   )r   r(   r)   r   )Ú__doc__Ú
__future__r   Ústdnumr   Ústdnum.exceptionsÚ	stdnum.idr   Ústdnum.utilr   r   r   r   r   r'   © r   r   ú<module>r1      s1   ðñ,õB #å Ü Ý ß 'ó(óó&ôTr   