B
    ²ô`¨  ã               @   sx   d dl mZ d dlmZmZ eddƒZeddƒZeddƒZeddƒZ	G d	d
„ d
eƒZ
G dd„ deƒZG dd„ deƒZdS )é    )Úgettext_lazy)Ú	get_classÚ	get_modelzdashboard.reports.reportsÚReportGeneratorÚReportCSVFormatterÚReportHTMLFormatterÚvoucherÚVoucherc               @   s   e Zd ZdZdd„ ZdS )ÚVoucherReportCSVFormatterzvoucher-performance.csvc             C   s`   |   |¡}tdƒtdƒtdƒtdƒg}| |¡ x*|D ]"}|j|j|j|jg}| |¡ q6W d S )NzVoucher codezAdded to a basketzUsed in an orderzTotal discount)Zget_csv_writerÚ_ÚwriterowÚcodeZnum_basket_additionsZ
num_ordersZtotal_discount)ÚselfÚresponseÚvouchersÚwriterZ
header_rowr   Úrow© r   úI/home/dcms/DCMS/lib/python3.7/site-packages/oscar/apps/voucher/reports.pyÚgenerate_csv   s    



z&VoucherReportCSVFormatter.generate_csvN)Ú__name__Ú
__module__Ú__qualname__Úfilename_templater   r   r   r   r   r
      s   r
   c               @   s   e Zd ZdZdS )ÚVoucherReportHTMLFormatterz4oscar/dashboard/reports/partials/voucher_report.htmlN)r   r   r   r   r   r   r   r   r       s   r   c               @   s&   e Zd ZdZedƒZeZee	dœZ
dS )ÚVoucherReportGeneratorr   zVoucher performance)ZCSV_formatterZHTML_formatterN)r   r   r   r   r   Údescriptionr	   Zmodel_classr
   r   Ú
formattersr   r   r   r   r   $   s
   r   N)Zdjango.utils.translationr   r   Zoscar.core.loadingr   r   r   r   r   r	   r
   r   r   r   r   r   r   Ú<module>   s   

