<%! from django.utils.translation import ugettext as _ %> <%! from datetime import datetime, timedelta %> <%! import pytz %> <%page args="section_data"/> <%include file="add_coupon_modal.html" args="section_data=section_data" /> <%include file="edit_coupon_modal.html" args="section_data=section_data" /> <%include file="set_course_mode_price_modal.html" args="section_data=section_data" /> <%include file="generate_registarion_codes_modal.html" args="section_data=section_data" />

${_('Registration Codes')}

%if section_data['sales_admin']:

${_('Create one or more pre-paid course enrollment codes. Students can use these codes to enroll in the course.')}

${_('Create Enrollment Codes')}
%endif

${_('Download a .csv file of all enrollment codes for this course')}

${_('Download a .csv file of all unused enrollment codes for this course')}

${_('Download a .csv file of all used enrollment codes for this course')}

%if section_data['coupons_enabled']:

${_("Course Price")}

${_("Course Price: ")}${section_data['currency_symbol']}${section_data['course_price']} %if section_data['access']['finance_admin'] is True: + ${_('Set Price')} %endif
%endif %if section_data['access']['finance_admin']:

${_("Sales")}

%if section_data['total_amount'] is not None: ${_("Total Credit Card Purchases: ")}$${section_data['total_amount']} %endif

${_("Download a .csv file for all credit card purchases or for all invoices, regardless of status")}


${_("To cancel or resubmit an invoice, enter the invoice number below.")}

%endif %if section_data['coupons_enabled']:

${_("Coupons List")}

${_("Click to generate a CSV file of all Coupon Codes:")} ${_("Coupons Information")} + ${_("Add Coupon")}
%if len(section_data['coupons']): %for coupon in section_data['coupons']: <% current_date = datetime.now(pytz.UTC) %> <% coupon_expiry_date = coupon.expiration_date %> %if coupon.is_active == False: %elif coupon_expiry_date is not None and current_date >= coupon_expiry_date: %else: %endif %endfor
${_("Code")} ${_("Description")} ${_("Expiry Date")} ${_("Discount (%)")} ${_("Redeem Count")} ${_("Actions")}
${_('{code}').format(code=coupon.code)} ${_('{description}').format(description=coupon.description)} ${coupon.display_expiry_date} ${_('{discount}').format(discount=coupon.percentage_discount)} ${ coupon.couponredemption_set.filter(order__status='purchased').count() } [x]${_('Edit')}
%endif
%endif