Commit e72eaf81 by Nimisha Asthagiri

Merge pull request #8582 from edx/cdodge/fix-none-totals

fix price per seat
parents a77923dc 61aa3505
......@@ -1108,11 +1108,13 @@ def get_executive_report(course_id):
single_purchase_total = PaidCourseRegistration.get_total_amount_of_purchased_item(course_id)
bulk_purchase_total = CourseRegCodeItem.get_total_amount_of_purchased_item(course_id)
paid_invoices_total = InvoiceTransaction.get_total_amount_of_paid_course_invoices(course_id)
gross_revenue = single_purchase_total + bulk_purchase_total + paid_invoices_total
gross_paid_revenue = single_purchase_total + bulk_purchase_total + paid_invoices_total
all_invoices_total = Invoice.get_invoice_total_amount_for_course(course_id)
gross_pending_revenue = all_invoices_total - float(paid_invoices_total)
gross_revenue = float(gross_paid_revenue) + float(gross_pending_revenue)
refunded_self_purchased_seats = PaidCourseRegistration.get_self_purchased_seat_count(
course_id, status='refunded'
)
......@@ -1165,6 +1167,7 @@ def get_executive_report(course_id):
'total_seats': total_seats,
'currency': currency,
'gross_revenue': float(gross_revenue),
'gross_paid_revenue': float(gross_paid_revenue),
'gross_pending_revenue': gross_pending_revenue,
'total_seats_refunded': total_seats_refunded,
'total_amount_refunded': float(total_amount_refunded),
......
......@@ -52,10 +52,14 @@ h2 {
<td align="right">${total_enrollments}</td>
</tr>
<tr>
<td>${_("Gross Revenue Collected")}</td>
<td>${_("Gross Revenue")}</td>
<td align="right">${currency}${"{0:0.2f}".format(gross_revenue)}</td>
</tr>
<tr>
<td>${_("Gross Revenue Collected")}</td>
<td align="right">${currency}${"{0:0.2f}".format(gross_paid_revenue)}</td>
</tr>
<tr>
<td>${_("Gross Revenue Pending")}</td>
<td align="right">${currency}${"{0:0.2f}".format(gross_pending_revenue)}</td>
</tr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment