From 35d74f7bc318842eccb9221981318980196d43f4 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Mon, 25 Nov 2024 14:00:11 -0500 Subject: [PATCH] membershipworks: Fix subtotals in event invoices --- membershipworks/tables.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/membershipworks/tables.py b/membershipworks/tables.py index 8011be4..9718922 100644 --- a/membershipworks/tables.py +++ b/membershipworks/tables.py @@ -153,7 +153,7 @@ class CurrentAndUpcomingEventTable(EventTable): sequence = ("title", "start", "next_meeting") -class MoneyFooterColumn(MoneyColumn): +class MoneyFooterColumn(CurrencySymbolMoneyColumn): def render_footer(self, bound_column, table): value = getattr(table.event, bound_column.accessor) if value is not None: @@ -182,18 +182,16 @@ class InvoiceTable(tables.Table): _math_header("Quantity", "Q"), footer=lambda table: table.event.quantity, ) - amount = CurrencySymbolMoneyColumn(_math_header("Amount", "A=P*Q")) - materials = CurrencySymbolMoneyColumn( - _math_header("CMS Collected Materials Fee", "M=m*Q") - ) - amount_without_materials = CurrencySymbolMoneyColumn( + amount = MoneyFooterColumn(_math_header("Amount", "A=P*Q")) + materials = MoneyFooterColumn(_math_header("CMS Collected Materials Fee", "M=m*Q")) + amount_without_materials = MoneyFooterColumn( _math_header("Event Revenue Base", "B=A-M") ) - instructor_revenue = CurrencySymbolMoneyColumn( + instructor_revenue = MoneyFooterColumn( _math_header("Instructor Percentage Revenue", "R=B*I"), ) - instructor_amount = CurrencySymbolMoneyColumn( - _math_header("Amount Due to Instructor", "R+M") + instructor_amount = MoneyFooterColumn( + _math_header("Amount Due to Instructor", "R+M"), ) class Meta: