3

‘ã\É  ã               @   s6   d dl mZ d dlmZ eddƒZG dd„ deƒZdS )é    )Úgettext_lazy)Ú	get_classzdashboard.reports.reportsÚReportCSVFormatterc               @   s    e Zd ZdZdd„ Zdd„ ZdS )ÚOrderDiscountCSVFormatterz order-discounts-for-offer-%s.csvc             C   sl   | j |ƒ}tdƒtdƒtdƒtdƒg}|j|ƒ x6|D ].}|j}|j| j|jƒ|j|jg}|j|ƒ q6W d S )NzOrder numberz
Order datezOrder totalZCost)	Úget_csv_writerÚ_ÚwriterowÚorderÚnumberÚformat_datetimeÚdate_placedÚtotal_incl_taxÚamount)ÚselfÚresponseÚorder_discountsÚwriterÚ
header_rowÚorder_discountr	   Úrow© r   ú>/var/www/html/oscar2019/oscar/apps/dashboard/offers/reports.pyÚgenerate_csv   s    




z&OrderDiscountCSVFormatter.generate_csvc             C   s   | j |j S )N)Úfilename_templateÚid)r   Úofferr   r   r   Úfilename   s    z"OrderDiscountCSVFormatter.filenameN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r   r   	   s   r   N)Údjango.utils.translationr   r   Úoscar.core.loadingr   r   r   r   r   r   r   Ú<module>   s   