From 1ac1470d29715521ef70e14ba4b8a7e9ff0daaa3 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Mon, 4 Mar 2024 15:35:37 -0500 Subject: [PATCH] membershipworks: Rename Instructor Revenue column in invoices --- membershipworks/models.py | 7 ++++--- membershipworks/views.py | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/membershipworks/models.py b/membershipworks/models.py index 56835d2..97fb04a 100644 --- a/membershipworks/models.py +++ b/membershipworks/models.py @@ -471,7 +471,7 @@ class EventExtQuerySet(models.QuerySet["EventExt"]): "amount", "materials", "amount_without_materials", - "instructor_fee", + "instructor_revenue", "instructor_amount", ] }, @@ -615,12 +615,13 @@ class EventTicketTypeManager(models.Manager["EventTicketType"]): amount_without_materials=ExpressionWrapper( F("amount") - F("materials"), output_field=models.DecimalField() ), - instructor_fee=ExpressionWrapper( + instructor_revenue=ExpressionWrapper( F("amount_without_materials") * F("event__instructor_percentage"), output_field=models.DecimalField(), ), instructor_amount=ExpressionWrapper( - F("instructor_fee") + F("materials"), output_field=models.DecimalField() + F("instructor_revenue") + F("materials"), + output_field=models.DecimalField(), ), ) diff --git a/membershipworks/views.py b/membershipworks/views.py index 1e0a42e..ab20034 100644 --- a/membershipworks/views.py +++ b/membershipworks/views.py @@ -306,10 +306,10 @@ class InvoiceTable(tables.Table): amount = InvoiceMoneyFooterColumn("Amount [A = P * Q]") materials = InvoiceMoneyFooterColumn("CMS Collected Materials Fee [M = m * Q]") amount_without_materials = InvoiceMoneyFooterColumn( - "Event Revenue Base [R = A - M]" + "Event Revenue Base [B = A - M]" ) - instructor_fee = InvoiceMoneyFooterColumn("Instructor Fee [F = R * I]") - instructor_amount = InvoiceMoneyFooterColumn("Amount Due to Instructor [F + M]") + instructor_revenue = InvoiceMoneyFooterColumn("Instructor Revenue [R = B * I]") + instructor_amount = InvoiceMoneyFooterColumn("Amount Due to Instructor [R + M]") class Meta: attrs = {