
    Fdf                     J    d dl mZ d dlmZ d dlmZ d dlmZmZ d dlm	Z	 d Z
y)    )Count)timezone)now)datetime	timedelta)	Customersc                    	 t        j                         }|t        d      z
  }g g g g d}t        d      D ]  }|t        d|z        z   }|t        d      z   }t        j
                  j                  | t        j                  |      t        j                  |            }|j                  ddg	      j                         }|j                  ddg	      j                         }	|j                         }
|d
   j                  |       |d   j                  |	       |d   j                  |
       |d   j                  |j                  d             " |S # t        $ r
}Y d}~yd}~ww xY w)znot tested yet   )days)
registeredunregisteredtotalmonths      )$batch__category__created_by__companycreated__gtecreated__lt N)password__inr   r   r   r   z%Y-%m)r   r   r   ranger   objectsfilter
make_awareexcludecountappendstrftime	Exception)companyr   
start_datemonthly_dataistart_of_monthend_of_monthmonthly_customersregistered_countunregistered_counttotal_countes               O\\Desktop-e2rpvrc\rescue_scanner\qr_onkar\website\company_view\reports_views.pyget_monthly_customer_datar,   	   sn   lln9&11
	
 q 	LA')a*@@N)I2,>>L ) 1 1 8 85<%00@$//= !9 !  188r4j8QWWY!2!9!9Dz!9!R!X!X!Z+113K&--.>?(//0BC!((5")).*A*A'*JK#	L&  s   EE 	E/*E/N)django.db.modelsr   django.utilsr   django.utils.timezoner   r   r   accounts.modelsr   r,        r+   <module>r3      s    " ! % ( %!r2   