Ë
    Öík(  ã                   óf   — d Z ddlmZ ddlmZ ddlmZ dZd„ Zd„ Z G d„ d	ej                  «      Z	y
)ae  
Renseigne la date de normalisation des factures deja emises.

La DGI classe une facture a la date/heure de sa normalisation (dateTime de
l'e-MCF, DT du MCF), conservee en texte dans `dateTimedgi`. Les rapports
utilisent desormais cette date : une vente creee a 23:59:59 et normalisee
apres minuit compte, comme a la DGI, le lendemain (ou le mois suivant).
é    )Údatetime)Ú
migrations)Útimezone)z%d/%m/%Y %H:%M:%Sz%Y%m%d%H%M%Sz%d/%m/%Y %H:%Mz%Y-%m-%dT%H:%M:%Sz%Y-%m-%d %H:%M:%Sc                 óÈ   — t        | xs d«      j                  «       } t        D ]-  }	 t        j                  t        j                  | |«      «      c S  y # t        $ r Y Œ<w xY w)NÚ )ÚstrÚstripÚFORMATSr   Ú
make_awarer   ÚstrptimeÚ
ValueError)ÚtextÚfmts     úO/var/www/faccontrol_acokin/facturation/migrations/0064_backfill_date_fiscale.pyÚ_parser      sc   € ÜˆtŠz�r‹?× Ñ Ó"€DÜò ˆð	Ü×&Ñ&¤x×'8Ñ'8¸¸sÓ'CÓDÒDðð
 øô ò 	Ùð	ús   ¨(AÁ	A!Á A!c                 ót  — | j                  dd«      }|j                  j                  }g }|j                  j	                  |«      j                  d¬«      j                  d¬«      j                  d¬«      j                  dd	«      }|j                  d
¬«      D ]o  }t        |j                  «      }|€Œ||_        |j                  |«       t        |«      dk\  sŒB|j                  j	                  |«      j                  |dg«       g }Œq |r-|j                  j	                  |«      j                  |dg«       y y )NÚfacturationÚCommandeT)Údate_fiscale__isnull)ÚdateTimedgi__isnullr   )ÚdateTimedgiÚpkr   iÐ  )Ú
chunk_sizeiè  Údate_fiscale)Ú	get_modelÚ
connectionÚaliasÚobjectsÚusingÚfilterÚexcludeÚonlyÚiteratorr   r   r   ÚappendÚlenÚbulk_update)ÚappsÚschema_editorr   r   ÚbatchÚquerysetÚcommandeÚparseds           r   Úbackfillr-      s  € Ø�~‰~˜m¨ZÓ8€HØ×$Ñ$×*Ñ*€EØ€Eà×Ñ×Ñ˜uÓ%ß	‰ TˆÓ	*ß	‰ TˆÓ	*ß	‰˜RˆÓ	 ß	‰ˆd�MÓ	"ð ð ×%Ñ%°Ð%Ó6ò ˆÜ˜×,Ñ,Ó-ˆØˆ>ØØ &ˆÔØ�‰�XÔÜˆu‹:˜ÓØ×Ñ×"Ñ" 5Ó)×5Ñ5°e¸nÐ=MÔNØ‰Eðñ Ø×Ñ×Ñ˜uÓ%×1Ñ1°%¸.Ð9IÕJð ó    c                   ób   — e Zd ZdgZ ej
                  eej
                  j                  «      gZy)Ú	Migration)r   Ú"0063_commande_montants_fiscaux_dgiN)	Ú__name__Ú
__module__Ú__qualname__Údependenciesr   Ú	RunPythonr-   ÚnoopÚ
operations© r.   r   r0   r0   5   s5   „ ð 	>ð€Lð
 	ˆ
×Ñ˜X z×';Ñ';×'@Ñ'@ÓAð�Jr.   r0   N)
Ú__doc__r   Ú	django.dbr   Údjango.utilsr   r
   r   r-   r0   r9   r.   r   ú<module>r=      s:   ðñõ å  Ý !ð l€òòKô0�
×$Ñ$õ r.   