Ë
    0kx&  ã                   ó  — d Z ddlmZ ddlmZ  G d„ dej
                  «      Z G d„ de«      Z G d	„ d
e«      Z G d„ de«      Z	 G d„ de«      Z
 G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ dej
                  «      Zy)zÛ
Modeles de reference DGI reutilises par les autres applications.

Ce module contient les structures de base necessaires a la fiscalisation :
groupes de taxe, types de client, types d'article et champs de securite DGI.
é    )Úmodelsé   )Úget_tax_group_labelc                   óp   — e Zd ZdZ ej
                  d¬«      Z ej
                  d¬«      Z G d„ d«      Zy)ÚTimespanmodelz;Modele representant timespanmodel dans la base applicative.T)Úauto_now_add©Úauto_nowc                   ó   — e Zd ZdZy)úTimespanmodel.MetaTN©Ú__name__Ú
__module__Ú__qualname__Úabstract© ó    ú(/var/www/faccontrol_acokin/dgi/models.pyÚMetar      ó   „ Ø‰r   r   N)	r   r   r   Ú__doc__r   ÚDateTimeFieldÚ
created_atÚ	update_atr   r   r   r   r   r      s3   „ ÙEà%�×%Ñ%°4Ô8€JØ$�×$Ñ$¨dÔ3€I÷ò r   r   c                   ó  — e Zd ZdZ ej
                  ddd¬«      Z ej
                  dd¬«      Z ej                  dd	¬
«      Z	 ej                  ddd¬«      Z ej                  dd¬«      Z G d„ d«      Zd„ Zed„ «       Zy)ÚTaxGroupuS   
    Groupe de taxation (ex: A, B, C...)
    d'aprÃ¨s l'API e-MCF (taxGroups).
    é
   Tz*Code du groupe de taxation (ex: 'A', 'B').©Ú
max_lengthÚuniqueÚ	help_textéd   z:Libelle officiel du groupe (ex: 'GROUPE B (TAXABLE 16%)').©r   r!   úDescription optionnelle.©Úblankr!   é   é   g        )Ú
max_digitsÚdecimal_placesÚdefaultu2   Permet de dÃ©sactiver un groupe sans le supprimer.©r+   r!   c                   ó   — e Zd ZdZdZdgZy)úTaxGroup.MetazGroupe de taxationzGroupes de taxationÚcodeN©r   r   r   Úverbose_nameÚverbose_name_pluralÚorderingr   r   r   r   r.   4   s   „ Ø+ˆØ3ÐØ�8‰r   r   c                 óB   — t        | j                  | j                  «      S )ú2Retourne une representation lisible de l'instance.©r   r/   Úname©Úselfs    r   Ú__str__zTaxGroup.__str__9   s   € ô # 4§9¡9¨d¯i©iÓ8Ð8r   c                 óB   — t        | j                  | j                  «      S )z8Libelle officiel utilise dans les selects et affichages.r6   r8   s    r   Údisplay_labelzTaxGroup.display_label>   s   € ô # 4§9¡9¨d¯i©iÓ8Ð8r   N)r   r   r   r   r   Ú	CharFieldr/   r7   Ú	TextFieldÚdescriptionÚDecimalFieldÚtaxÚBooleanFieldÚ	is_activer   r:   Úpropertyr<   r   r   r   r   r      s«   „ ñð ˆ6×ÑØØØ>ô€Dð
 ˆ6×ÑØØNô€Dð #�&×"Ñ"ØØ,ô€Kð 	ˆ×Ñ q¸ÀDÔI€Cà#�×#Ñ#ØØFô€I÷
ñ ò
9ð
 ñ9ó ñ9r   r   c                   óÌ   — e Zd ZdZ ej
                  ddd¬«      Z ej
                  dd¬«      Z ej                  dd	¬
«      Z	 ej                  dd¬«      Z G d„ d«      Zd„ Zy)Ú
ClientTypeu`   
    Type de client (ex: PP, PM, Administration...)
    d'aprÃ¨s l'API e-MCF (clientTypes).
    r   Tz"Code type client (ex: 'PP', 'PM').r   r"   z.Nom lisible du type (ex: 'Personne physique').r#   r$   r%   õ0   Permet de dÃ©sactiver un type sans le supprimer.r,   c                   ó   — e Zd ZdZdZdgZy)úClientType.MetazType de clientzTypes de clientr/   Nr0   r   r   r   r   rI   \   ó   „ Ø'ˆØ/ÐØ�8‰r   r   c                 ó8   — | j                   › d| j                  › �S ©r5   z - ©r/   r7   r8   s    r   r:   zClientType.__str__a   ó   € ð —)‘)�˜C §	¡	˜{Ð+Ð+r   N©r   r   r   r   r   r=   r/   r7   r>   r?   rB   rC   r   r:   r   r   r   rF   rF   E   s�   „ ñð ˆ6×ÑØØØ6ô€Dð
 ˆ6×ÑØØBô€Dð #�&×"Ñ"ØØ,ô€Kð $�×#Ñ#ØØDô€I÷
ñ ó
,r   rF   c                   óÌ   — e Zd ZdZ ej
                  ddd¬«      Z ej
                  dd¬«      Z ej                  dd	¬
«      Z	 ej                  dd¬«      Z G d„ d«      Zd„ Zy)ÚItemTypeuW   
    Type d'article (ex: GOODS, SERVICES...)
    d'aprÃ¨s l'API e-MCF (itemTypes).
    é   Tz+Code type article (ex: 'GOODS', 'SERVICE').r   r"   z$Nom lisible (ex: 'Bien', 'Service').r#   r$   r%   rG   r,   c                   ó   — e Zd ZdZdZdgZy)úItemType.MetazType d'articlezTypes d'articler/   Nr0   r   r   r   r   rT      rJ   r   r   c                 ó8   — | j                   › d| j                  › �S rL   rM   r8   s    r   r:   zItemType.__str__„   rN   r   NrO   r   r   r   rQ   rQ   g   s�   „ ñð
 ˆ6×ÑØØØ?ô€Dð
 ˆ6×ÑØØ8ô€Dð #�&×"Ñ"ØØ,ô€Kð $�×#Ñ#ØØDô€I÷
ñ ó
,r   rQ   c                   óh  — e Zd ZdZ ej
                  dddd¬«      Z ej
                  dd¬«      Z ej
                  d	dd
¬«      Z ej                  ddd¬«      Z
 ej
                  ddd¬«      Z ej                  eej                  dddd¬«      Z ej                   dd¬«      Z G d„ d«      Zd„ Zy)ÚClientu®   
    Client utilisÃ© dans la facturation e-MCF.
    Correspond Ã  la structure 'client' de l'API :
    - nif
    - name
    - contact
    - address
    - type / typeDesc
    rR   Tu2   NIF du client (peut Ãªtre vide si non renseignÃ©).)r   r&   Únullr!   éÿ   zNom / Raison sociale du client.r#   é2   u   TÃ©lÃ©phone ou autre contact.)r   r&   r!   z%Adresse email du client (facultatif).)r&   rX   r!   zAdresse postale du client.ÚclientszType de client (PP, PM, etc.).)Ú	on_deleterX   r&   Úrelated_namer!   u2   Permet de dÃ©sactiver un client sans le supprimer.r,   c                   ó   — e Zd ZdZdZdgZy)úClient.MetarW   ÚClientsr7   Nr0   r   r   r   r   r_   À   s   „ ØˆØ'ÐØ�8‰r   r   c                 ój   — | j                   r| j                  › d| j                   › d�S | j                  S )r5   z (ú))Únifr7   r8   s    r   r:   zClient.__str__Å   s0   € ð �8Š8Ø—i‘i�[  4§8¡8 *¨AÐ.Ð.Ø�y‰yÐr   N)r   r   r   r   r   r=   rc   r7   ÚcontactÚ
EmailFieldÚemailÚaddressÚ
ForeignKeyrF   ÚSET_NULLÚclient_typerB   rC   r   r:   r   r   r   rW   rW   Š   së   „ ñð ˆ&×
Ñ
ØØØØFô	€Cð ˆ6×ÑØØ3ô€Dð ˆf×ÑØØØ1ô€Gð
 ˆF×ÑØØØ9ô€Eð
 ˆf×ÑØØØ.ô€Gð $�&×#Ñ#ØØ—/‘/ØØØØ2ô€Kð $�×#Ñ#ØØFô€I÷
ñ ó
r   rW   c                   óö   — e Zd ZdZ ej
                  ddd¬«      Z ej
                  ddd¬«      Z ej
                  ddd¬«      Z ej
                  ddd¬«      Z	 ej
                  ddd¬«      Z G d„ d«      Z
y)ÚPointvente_Dgiz<Modele representant pointvente dgi dans la base applicative.rY   T)r   rX   r&   c                   ó   — e Zd ZdZy)úPointvente_Dgi.MetaTNr   r   r   r   r   rn   Ö   r   r   r   N)r   r   r   r   r   r=   rc   Úmode_dgiÚisf_dgiÚtype_dgir   r   r   r   rl   rl   Í   s}   „ ÙFà
ˆ&×
Ñ
 c°¸DÔ
A€CØˆv×Ñ¨3°TÀÔF€HØˆf×Ñ¨#°DÀÔE€GØˆv×Ñ¨3°TÀÔF€HØˆv×Ñ¨3°TÀÔF€H÷ò r   rl   c                   ó¤   — e Zd ZdZ ej
                  eej                  dd¬«      Z ej
                  e	ej                  dd¬«      Z
 G d„ d«      Zy)ÚArticle_Dgiz9Modele representant article dgi dans la base applicative.T)r\   rX   r&   c                   ó   — e Zd ZdZy)úArticle_Dgi.MetaTNr   r   r   r   r   ru   à   r   r   r   N)r   r   r   r   r   rh   rQ   ÚPROTECTÚtypeartr   Útaxgroupr   r   r   r   rs   rs   Ú   sI   „ ÙCàˆf×Ñ °F·N±NÈÐUYÔZ€GØ ˆv× Ñ  °V·^±^È$ÐVZÔ[€H÷ò r   rs   c                   ó,  — e Zd ZdZ ej
                  dddd¬«      Z ej
                  dddd¬«      Z ej
                  dddd¬«      Z ej
                  dddd¬«      Z	 ej
                  dddd¬«      Z
 ej
                  dddd¬«      Z G d„ d«      Zy)	ÚCommande_Dgiz:Modele representant commande dgi dans la base applicative.rY   Ú T)r   r+   rX   r&   c                   ó   — e Zd ZdZy)úCommande_Dgi.MetaTNr   r   r   r   r   r}   î   r   r   r   N)r   r   r   r   r   r=   ÚdateTimedgiÚ
codedefdgiÚcountersÚnimÚqrCodeÚuidr   r   r   r   rz   rz   ä   s    „ ÙDà"�&×"Ñ"¨c¸2ÀDÐPTÔU€KØ!�×!Ñ!¨S¸"À4ÈtÔT€JØˆv×Ñ¨3¸ÀÈTÔR€HØ
ˆ&×
Ñ
 c°2¸DÈÔ
M€CØˆV×Ñ¨°b¸tÈ4ÔP€FØˆ×Ñ C°¸$ÀdÔK€C÷ò r   rz   c                   óš  — e Zd ZdZdZdZdZdZedfedfedfed	ffZ e	j                  d
d
¬«      Z e	j                  d
¬«      Z e	j                  dd¬«      Z e	j                  dd
¬«      Z e	j                  dd
d¬«      Z e	j"                  d
d
d
¬«      Z e	j                  dd
dd
¬«      Z e	j                  deed
¬«      Z e	j*                  ddd
d
¬«      Z e	j*                  ddd
d
¬«      Z e	j*                  ddd
d
¬«      Z e	j*                  ddd
d
¬«      Z e	j                  dd
dd
¬«      Z e	j                  dd
d¬«      Z e	j                  dd
d¬«      Z e	j                  d
d
d
¬«      Z e	j<                  d
d
¬«      Z e	j<                  d
d
¬«      Z  e	j<                  d
d
¬«      Z! e	jD                  d
d¬«      Z# G d„ d «      Z$d!„ Z%y")#ÚJournalFiscala£  
    Journal electronique des echanges avec l'e-MCF.

    Chaque demande de facture, confirmation ou annulation y est tracee sur une
    connexion separee (autocommit) : la trace survit a l'annulation de la
    transaction de vente. On peut ainsi rapprocher ce que la DGI a enregistre
    de ce que FacControl a conserve, et retrouver une facture confirmee par
    la DGI dont l'enregistrement local aurait echoue.
    Ú
EN_ATTENTEÚ	CONFIRMEEÚANNULEEÚERREURzEn attente de finalisationzNormalisee (confirmee)zAnnulee (CANCEL)ÚErreurT)r   Údb_indexr	   r   ÚEMCF)r   r+   éP   )r   r‹   r(   r{   )r   r&   r+   )rX   r&   r‹   é@   )r   r&   r+   r‹   é   )r   Úchoicesr+   r‹   é   )r)   r*   rX   r&   é    )rX   r&   )r&   r+   c                   ó   — e Zd ZdZdZdgZy)úJournalFiscal.MetazJournal fiscal e-MCFz-created_atNr0   r   r   r   r   r”     s   „ Ø-ˆØ4ÐØ!�?‰r   r   c                 óR   — | j                   › d| j                  › d| j                  › �S )r5   z [z] )ÚnumeroÚstatutÚcode_def_dgir8   s    r   r:   zJournalFiscal.__str__$  s*   € ð —+‘+�˜b §¡ ¨R°×0AÑ0AÐ/BÐCÐCr   N)&r   r   r   r   ÚSTATUT_EN_ATTENTEÚSTATUT_CONFIRMEEÚSTATUT_ANNULEEÚSTATUT_ERREURÚSTATUT_CHOICESr   r   r   Ú
updated_atr=   Úcanalr–   Útype_factureÚPositiveIntegerFieldÚcommande_refrƒ   r—   r@   Útotal_ttc_localÚtotal_tva_localÚtotal_ttc_dgiÚtotal_tva_dgir˜   r�   r€   Údate_fiscaleÚ	JSONFieldÚdemandeÚreponse_demandeÚreponse_finalisationr>   Úmessager   r:   r   r   r   r…   r…   ò   s  „ ñð %ÐØ"ÐØ€NØ€Mà	Ð8Ð9Ø	Ð3Ð4Ø	Ð+Ð,Ø	˜Ð!ð	€Nð &�×%Ñ%°4À$ÔG€JØ%�×%Ñ%¨tÔ4€JØˆF×Ñ¨°FÔ;€EØˆV×Ñ¨°dÔ;€FØ#�6×#Ñ#¨q¸ÀbÔI€Lð /�6×.Ñ.°DÀÈtÔT€LØ
ˆ&×
Ñ
 b°¸bÈ4Ô
P€CØˆV×Ñ¨°^ÐM^ÐimÔn€FØ)�f×)Ñ)°RÈÐPTÐ\`Ôa€OØ)�f×)Ñ)°RÈÐPTÐ\`Ôa€OØ'�F×'Ñ'°2ÀaÈdÐZ^Ô_€MØ'�F×'Ñ'°2ÀaÈdÐZ^Ô_€MØ#�6×#Ñ#¨r¸ÀrÐTXÔY€LØ
ˆ&×
Ñ
 b°¸bÔ
A€CØˆv×Ñ¨2°TÀ2ÔF€HØ'�6×'Ñ'¨T¸ÈÔM€LØˆf×Ñ D°Ô5€GØ&�f×&Ñ&¨D¸Ô=€OØ+˜6×+Ñ+°¸TÔBÐØˆf×Ñ T°2Ô6€G÷#ñ #ó
Dr   r…   N)r   Ú	django.dbr   Ú
tax_groupsr   ÚModelr   r   rF   rQ   rW   rl   rs   rz   r…   r   r   r   ú<module>r°      sŽ   ðñõ å +ô�F—L‘Lô ô'9ˆ}ô '9ôT,�ô ,ôD ,ˆ}ô  ,ôF@ˆ]ô @ôF
�]ô 
ô�-ô ô�=ô ô5D�F—L‘Lõ 5Dr   