+
     ‚Úiù  ã                   ó   € R t ^ RIt^ RIHt ^ RIHtHt ^ RIHt ^ RI	H
t
 ^ RIHtHtHt ^ RIHt ^RIHt ^R	IHtHtHt R
t ! R R4      t ! R R]]]4      t ! R R]]]4      t ! R R]4      t ! R R]]4      tR# )z2Vues de consultation et de creation des proformas.N)ÚLoginRequiredMixin)ÚOperationalErrorÚProgrammingError)ÚJsonResponse)Úreverse)Ú
DetailViewÚListViewÚView)ÚConfiguration)ÚProforma)ÚProformaBusinessErrorÚProformaCreationServiceÚbuild_proforma_document_contextzeLa base Pro-Forma n'est pas encore prete. Executez `python manage.py migrate` puis rechargez la page.c                   ó*   a € ] tR t^t o RtR tRtV tR# )ÚProformaAccessMixinzº
Restreint l'acces aux proformas selon la portee de l'utilisateur.

Les administrateurs voient l'ensemble des proformas, tandis qu'un vendeur
standard reste limite a son point de vente.
c                óV  € \         P                  P                  RRR4      P                  RR4      pV P                  P
                  pVP                  '       g   VP                  4       # VP                  R8X  g   VP                  '       d   V# VP                  VP                  R7      # )zFRetourne uniquement les proformas visibles pour l'utilisateur courant.ÚclientÚvendeurÚpoint_de_venteÚlignes__produitÚpaiements__mode_paiementÚADMIN)r   )r   ÚobjectsÚselect_relatedÚprefetch_relatedÚrequestÚuserÚis_authenticatedÚnoneÚroleÚis_superuserÚfilterr   )ÚselfÚquerysetr   s   &  Ú0D:\ProjetDjango\FacControl_1.3\proforma\views.pyÚget_querysetÚ ProformaAccessMixin.get_queryset!   s•   € ô ×#Ñ#×2Ñ2ØØØó
÷ Ñ
ØØ&ó
ð	 	ð �|‰|× Ñ ˆØ×$×$Ð$Ø—=‘=“?Ð"Ø�9‰9˜Ô 4×#4×#4Ð#4ØˆOØ�‰¨d×.AÑ.AˆÓBÐBó    © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r%   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r$   r   r      s   ø‡ € ñ÷Cð Cr'   r   c                   ó&   € ] tR t^4tRt]tRtRtRt	R# )ÚProformaListViewzFAffiche la liste des proformas consultables par l'utilisateur courant.zproforma/proforma_list.htmlÚ	proformasr(   N)
r)   r*   r+   r,   r-   r   ÚmodelÚtemplate_nameÚcontext_object_namer.   r(   r'   r$   r3   r3   4   s   † ÙPØ€EØ1€MØ%Ôr'   r3   c                   óF   a a€ ] tR t^;t oRt]tRtRtRt	V 3R lt
RtVtV ;t# )ÚProformaDetailViewzCAffiche une proforma complete avec ses lignes, paiements et totaux.zproforma/proforma_detail.htmlÚproformaFc                óÜ  <€ \         SV `  ! R/ VB p\        P                  P	                  4       VR&   \        V P                  P                  P                  RR4      4      P                  4       R	9   VR&   \        V P                  P                  P                  RR4      4      P                  4       R	9   VR&   V P                  VR&   VP                  \        V P                  4      4       V# )
z<Injecte les donnees d'affichage complementaires du document.ÚconfigÚcreatedÚ Úis_newly_createdÚ	duplicataÚis_duplicataÚ
auto_printr(   >   Ú1ÚyesÚtrue)ÚsuperÚget_context_datar
   r   ÚfirstÚstrr   ÚGETÚgetÚlowerrB   Úupdater   Úobject)r"   ÚkwargsÚcontextÚ	__class__s   &, €r$   rG   Ú#ProformaDetailView.get_context_dataB   sÂ   ø€ ä‘'Ò*Ñ4¨VÑ4ˆÜ)×1Ñ1×7Ñ7Ó9ˆ�ÑÜ&)¨$¯,©,×*:Ñ*:×*>Ñ*>¸yÈ"Ó*MÓ&N×&TÑ&TÓ&VÐZnÑ&nˆÐ"Ñ#Ü"% d§l¡l×&6Ñ&6×&:Ñ&:¸;ÈÓ&KÓ"L×"RÑ"RÓ"TÐXlÑ"lˆ�ÑØ $§¡ˆ�ÑØ�‰Ô6°t·{±{ÓCÔDØˆr'   r(   )r)   r*   r+   r,   r-   r   r5   r6   r7   rB   rG   r.   r/   Ú__classcell__)rQ   r1   s   @@r$   r9   r9   ;   s'   ù‡ € ÙMØ€EØ3€MØ$ÐØ€J÷õ r'   r9   c                   ó   € ] tR t^MtRtRtRtR# )ÚProformaPrintViewz>Active l'impression automatique de la proforma cote interface.Tr(   N)r)   r*   r+   r,   r-   rB   r.   r(   r'   r$   rU   rU   M   s
   † ÙHØ„Jr'   rU   c                   ó.   a € ] tR t^Rt o Rt]tR tRtV t	R# )ÚProformaCreateViewz·
Endpoint appele par le POS pour convertir un panier en proforma.

Cette vue ne fiscalise rien : elle delegue seulement la persistence du
document commercial au service metier dedie.
c           
     óž  €  \         P                  ! VP                  4      p T P                  4       P                  TP                  T4      p\        R
TP                  .R7       R2p\        RTP                  .R7      p\	        RRRTP                  RTRT/4      #   \         P                   d    \	        RRRR/RR7      u # i ; i  \         d%   p\	        RRR\        T4      /RR7      u Rp?# Rp?i\        \        3 d    \	        RRR\        /RR7      u # \         d%   p\	        RRR\        T4      /R	R7      u Rp?# Rp?ii ; i)zIValide le JSON entrant puis retourne les URLs de consultation/impression.ÚsuccessFÚerrorzPayload JSON invalide.i�  )ÚstatusNi÷  iô  zproforma:detail)Úargsz
?created=1zproforma:printTÚproforma_idÚ
detail_urlÚ	print_url)ÚjsonÚloadsÚbodyÚJSONDecodeErrorr   Úservice_classÚcreate_from_payloadr   r   rI   r   r   ÚPROFORMA_SCHEMA_ERRORÚ	Exceptionr   Úpk)	r"   r   r\   rO   Údatar:   Úexcr^   r_   s	   &&*,     r$   ÚpostÚProformaCreateView.post[   sD  € ð	cÜ—:’:˜gŸl™lÓ+ˆDð		SØ×)Ñ)Ó+×?Ñ?ÀÇÁÈdÓSˆHô  Ð 1¸¿¹¸ÔFÐGÀzÐRˆ
ÜÐ,°H·K±K°=ÔAˆ	Üà˜4Ø˜xŸ{™{Ø˜jØ˜Yð	ó
ð 	
øô! ×#Ñ#ô 	cÜ ¨E°7Ð<TÐ UÐ^aÔbÒbð	cûô
 %ô 	SÜ ¨E°7¼CÀ»HÐ EÈcÔRÕRûÜ Ô"2Ð3ô 	`ô   ¨E°7Ô<QÐ RÐ[^Ô_Ò_Üô 	SÜ ¨E°7¼CÀ»HÐ EÈcÔRÕRûð	SúsR   ‚ B £*C	 Â&CÃCÃ	EÃC3Ã-EÃ3EÄEÄEÄ'EÄ(EÅEÅEr(   N)
r)   r*   r+   r,   r-   r   rd   rk   r.   r/   r0   s   @r$   rW   rW   R   s   ø‡ € ñð ,€M÷
ð 
r'   rW   )r-   r`   Údjango.contrib.auth.mixinsr   Ú	django.dbr   r   Údjango.httpr   Údjango.urlsr   Údjango.views.genericr   r   r	   Úfacturation.modelsr
   Úmodelsr   Úservicesr   r   r   rf   r   r3   r9   rU   rW   r(   r'   r$   Ú<module>ru      s€   ðÙ 8ã å 9ß 8Ý $Ý ß ;Ñ ;å ,å ß eÑ eðBð ÷Cñ Cô4&Ð*Ð,>Àô &ôÐ,Ð.@À*ô ô$Ð*ô ô
$
Ð+¨Tö $
r'   