Ë
    ãjb  ã                   óþ   — d Z ddlmZ ddlmZ ddlmZ  G d„ dej                  «      Z	 G d„ dej                  «      Z
 G d	„ d
ej                  «      Z G d„ dej                  «      Z G d„ dej                  «      Zy)zEAffectations produit <-> point de vente et historique des operations.é    )Úsettings)Úmodels)Úgettext_lazyc            
       óø   — e Zd ZdZ ej
                  dd ed«      ¬«      Z ej                  d ed«      ¬«      Z	 ej                  ej                  ej                  ddd ed	«      ¬
«      Z G d„ d«      Zd„ Zy)ÚMentionPointDeVentezTFamille de points de vente (Magasin, Supermarche...) qui vendent les memes produits.éP   TÚMention)Ú
max_lengthÚuniqueÚverbose_nameõ
   CrÃ©Ã©e le©Úauto_now_addr   ú+õ   CrÃ©Ã©e par©Ú	on_deleteÚnullÚblankÚrelated_namer   c                   ó0   — e Zd ZdZ ed«      Z ed«      Zy)úMentionPointDeVente.Meta)ÚnomÚpkzMention de point de ventezMentions de points de venteN©Ú__name__Ú
__module__Ú__qualname__ÚorderingÚ_r   Úverbose_name_plural© ó    ú2/var/www/faccontrol_acokin/G_Affectation/models.pyÚMetar      s   „ Ø ˆÙÐ4Ó5ˆÙÐ =Ó>Ñr#   r%   c                 ó   — | j                   S )N)r   ©Úselfs    r$   Ú__str__zMentionPointDeVente.__str__   s   € Ø�x‰xˆr#   N)r   r   r   Ú__doc__r   Ú	CharFieldr    r   ÚDateTimeFieldÚcree_leÚ
ForeignKeyr   ÚAUTH_USER_MODELÚSET_NULLÚcree_parr%   r)   r"   r#   r$   r   r      su   „ Ù^à
ˆ&×
Ñ
 b°ÁAÀiÃLÔ
Q€CØ"ˆf×"Ñ"°Á1À\Ã?ÔS€GØ ˆv× Ñ Ø× Ñ ¨F¯O©OÀ$ÈdØ¡q¨Ó'7ô€H÷
?ñ ?ó
r#   r   c            
       óì   — e Zd ZdZ ej
                  dej                  d ed«      ¬«      Z ej                  e
ej                  ddd ed«      ¬	«      Z ej                  d¬
«      Z G d„ d«      Zd„ Zy)ÚParametrePointDeVentezIParametrage d'affectation d'un PDV : sa mention, choisie des sa creation.úfacturation.PointDeVenteÚparametre_affectationúPoint de vente©r   r   r   TÚ
parametresr	   r   )Úauto_nowc                   ó,   — e Zd Z ed«      Z ed«      Zy)úParametrePointDeVente.Metau   ParamÃ©trage du point de venteu    ParamÃ©trage des points de venteN)r   r   r   r    r   r!   r"   r#   r$   r%   r;   (   s   „ ÙÐ9Ó:ˆÙÐ BÓCÑr#   r%   c                 ó@   — | j                   › d| j                  xs d› �S )Nõ    â€” ú-)Úpoint_de_venteÚmentionr'   s    r$   r)   zParametrePointDeVente.__str__,   s$   € Ø×%Ñ%Ð& e¨D¯L©LÒ,?¸CÐ+@ÐAÐAr#   N)r   r   r   r*   r   ÚOneToOneFieldÚCASCADEr    r?   r.   r   ÚPROTECTr@   r,   Ú
modifie_ler%   r)   r"   r#   r$   r3   r3      s|   „ ÙSà)�V×)Ñ)Ø"¨f¯n©nÐKbÙÐ'Ó(ô€Nð  ˆf×ÑØ v§~¡~¸DÈØ!±°)³ô€Gð &�×%Ñ%¨tÔ4€J÷Dñ DóBr#   r3   c            
       ó®  — e Zd ZdZ ej
                  dej                  d ed«      ¬«      Z ej
                  dej                  ddd ed	«      ¬
«      Z
 ej
                  eej                  ddd ed«      ¬
«      Z ej                  d ed«      ¬«      Z ej
                  ej                   ej"                  ddd ed«      ¬«      Z G d„ d«      Zd„ Zy)ÚAffectationProduitPDVzîLe produit se vend dans ce PDV, ou dans tous les PDV de cette mention.

    Sans aucune ligne, il se vend partout. Une ligne vise soit un PDV, soit une
    mention (jamais les deux) : un PDV cree plus tard avec la mention en profite.
    úfacturation.ProduitÚaffectations_pdvÚProduitr7   r4   Úaffectations_produitsTr6   )r   r   r   r   r   r	   r   r   r   r   r   c            	       ó@  — e Zd Z ed«      Z ed«      Z ej                  dd¬«       ej                  dd¬«       ej                   ej                  dd	¬
«       ej                  d	d¬
«      z  d¬«      gZ
 ej                  dd¬«       ej                  dd¬«      gZy)úAffectationProduitPDV.MetazAffectation produitzAffectations produits)Úproduitr?   Úgaffectation_produit_pdv_unique©ÚfieldsÚname)rM   r@   Ú#gaffectation_produit_mention_uniqueFT)Úpoint_de_vente__isnullÚmention__isnullÚgaffectation_cible_unique)Ú	conditionrQ   )r?   rM   Úgaffectation_pdv_produit)r@   rM   Úgaffectation_mention_produitN)r   r   r   r    r   r!   r   ÚUniqueConstraintÚCheckConstraintÚQÚconstraintsÚIndexÚindexesr"   r#   r$   r%   rL   I   s°   „ ÙÐ.Ó/ˆÙÐ 7Ó8Ðà#ˆF×#Ñ#Ð+HÐOpÔqØ#ˆF×#Ñ#Ð+AÐHmÔnØ"ˆF×"Ñ"Ø#˜6Ÿ8™8¸5ÐRVÔWØ%˜VŸX™X¸TÐSXÔYñZà0ôð
ˆð ˆF�L‰LÐ =ÐD^Ô_ØˆF�L‰LÐ 6Ð=[Ô\ð
‰r#   r%   c                 óT   — | j                   › d| j                  xs | j                  › �S )Nu    â†’ )rM   r?   r@   r'   s    r$   r)   zAffectationProduitPDV.__str__\   s'   € Ø—,‘,�˜u T×%8Ñ%8Ò%H¸D¿L¹LÐ$IÐJÐJr#   N)r   r   r   r*   r   r.   rB   r    rM   rC   r?   r   r@   r,   r-   r   r/   r0   r1   r%   r)   r"   r#   r$   rF   rF   0   sß   „ ñð  ˆf×ÑØ¨¯©ÐFXÙ�y“\ô€Gð '�V×&Ñ&Ø"¨f¯n©nÐKbØ˜©AÐ.>Ó,?ô€Nð  ˆf×ÑØ v§~¡~ÐD[Ø˜©A¨i«Lô€Gð #ˆf×"Ñ"°Á1À\Ã?ÔS€GØ ˆv× Ñ Ø× Ñ ¨F¯O©OÀ$ÈdØ¡q¨Ó'7ô€H÷

ñ 
ó&Kr#   rF   c            
       ó~  — e Zd ZdZdZdZdZe ed«      fe ed«      fe ed«      ffZ e	j                  de ed	«      ¬
«      Z e	j                  de	j                  ddd ed«      ¬«      Z e	j                  ee	j                  ddd ed«      ¬«      Z e	j                  ej$                  e	j&                  ddd ed«      ¬«      Z e	j*                  dd ed«      ¬«      Z e	j                  dd ed«      ¬«      Z e	j0                  d ed«      ¬«      Z e	j4                  d ed«      ¬«      Z G d„ d«      Zd„ Zy )!ÚOperationAffectationzDUne declaration de la page Affectation Produit (un lot de produits).ÚdeplacerÚajouterÚpartoutu   DÃ©placer vers ce PDVzVendre aussi dans ce PDVzVendre partouté   ÚMode)r
   Úchoicesr   r4   TÚoperations_affectationr6   r   Ú
operationsr	   ÚUtilisateurÚDate)r   Údb_indexr   éÈ   ÚMotif)r
   r   r   r   zNombre de produits)Údefaultr   FzTransfert du stockc                   ó0   — e Zd ZdZ ed«      Z ed«      Zy)úOperationAffectation.Meta)z-cree_lez-pku   OpÃ©ration d'affectationu   OpÃ©rations d'affectationNr   r"   r#   r$   r%   rq   ~   s   „ Ø&ˆÙÐ3Ó4ˆÙÐ ;Ó<Ñr#   r%   c                 ód   — | j                  «       › d| j                  xs d› d| j                  › d�S )Nr=   Ú z (ú))Úget_mode_displayÚdestinationÚnombre_produitsr'   s    r$   r)   zOperationAffectation.__str__ƒ   s9   € Ø×'Ñ'Ó)Ð*¨%°×0@Ñ0@Ò0FÀBÐ/GÀrÈ$×J^ÑJ^ÐI_Ð_`ÐaÐar#   N)r   r   r   r*   ÚMODE_DEPLACERÚMODE_AJOUTERÚMODE_PARTOUTr    ÚMODE_CHOICESr   r+   Úmoder.   rC   rv   r   r@   r   r/   r0   Úutilisateurr,   r-   ÚmotifÚPositiveIntegerFieldrw   ÚBooleanFieldÚtransfert_stockr%   r)   r"   r#   r$   ra   ra   `   sd  „ ÙNà€MØ€LØ€Là	™Ð1Ó2Ð3Ø	‘qÐ3Ó4Ð5Ø	‘qÐ)Ó*Ð+ð€Lð ˆ6×Ñ r°<ÉaÐPVËiÔX€DØ#�&×#Ñ#Ø"¨f¯n©nÀ4ÈtØ-¹AÐ>NÓ<Oô€Kð  ˆf×ÑØ v§~¡~¸DÈØ!±°)³ô€Gð $�&×#Ñ#Ø× Ñ ¨F¯O©OÀ$ÈdØ-¹A¸mÓ<Lô€Kð #ˆf×"Ñ"°¸tÑRSÐTZÓR[Ô\€GØˆF×Ñ¨°4ÁaÈÃjÔQ€EØ1�f×1Ñ1¸!É!ÐL`ÓJaÔb€OØ)�f×)Ñ)°%ÁaÐH\ÓF]Ô^€O÷=ñ =ó
br#   ra   c                   ón  — e Zd ZdZ ej
                  eej                  d¬«      Z ej
                  dej                  d¬«      Z	 ej                  ed¬«      Z ej                  ed¬«      Z ej                  ed¬«      Z ej                   ddd	¬
«      Z ej$                  d¬«      Z G d„ d«      Zd„ Zy)ÚLigneOperationAffectationuÊ  Visibilite avant / apres d'un produit et stock transfere par PDV source.

    `visibilite_avant` et `visibilite_apres` : cibles Â« p:<id PDV> Â» ou
    Â« m:<id mention> Â» (un entier seul = PDV, premieres operations), liste vide =
    partout. `stock_transfere` : {id PDV source: quantite} ; `transferts` : un
    transfert par PDV source qui a cede son stock (un produit peut en avoir
    plusieurs, d'ou la relation multiple plutot qu'une seule cle).
    Úlignes)r   r   rG   Úlignes_affectationT)ro   r   zstock.TransfertStockr   )r   r   )r   c                   ó:   — e Zd ZdZ ej
                  dd¬«      gZy)úLigneOperationAffectation.Meta)r   )rM   Ú	operationÚgaffectation_ligne_produitrO   N)r   r   r   r   r   r]   r^   r"   r#   r$   r%   r‡   ™   s   „ ØˆØ�6—<‘<Ð'?ÐFbÔcÐd‰r#   r%   c                 ó8   — | j                   › d| j                  › �S )Nr=   )Úoperation_idÚ
produit_idr'   s    r$   r)   z!LigneOperationAffectation.__str__�   s   € Ø×#Ñ#Ð$ E¨$¯/©/Ð):Ð;Ð;r#   N)r   r   r   r*   r   r.   ra   rB   rˆ   rM   Ú	JSONFieldÚlistÚvisibilite_avantÚvisibilite_apresÚdictÚstock_transfereÚManyToManyFieldÚ
transfertsÚ	TextFieldÚnoter%   r)   r"   r#   r$   rƒ   rƒ   ‡   sº   „ ñð "�×!Ñ!Ð"6À&Ç.Á.Ð_gÔh€IØˆf×ÑÐ 5ÀÇÁÐ^rÔs€GØ'�v×'Ñ'°¸DÔAÐØ'�v×'Ñ'°¸DÔAÐØ&�f×&Ñ&¨t¸4Ô@€OØ'�×'Ñ'Ð(>ÀdÐY\Ô]€JØˆ6×Ñ $Ô'€D÷eñ eó<r#   rƒ   N)r*   Údjango.confr   Ú	django.dbr   Údjango.utils.translationr   r    ÚModelr   r3   rF   ra   rƒ   r"   r#   r$   ú<module>r›      si   ðÙ Kå  Ý Ý 6ô˜&Ÿ,™,ô ô&B˜FŸL™Lô Bô*-K˜FŸL™Lô -Kô`$b˜6Ÿ<™<ô $bôN< §¡õ <r#   