From 8107da04d05b6cb34fb8061945f77a721f9efb31 Mon Sep 17 00:00:00 2001 From: anishTP Date: Wed, 10 Apr 2024 15:42:30 +0530 Subject: [PATCH] Fixed email footer and returned sum of base amount, discounted amount and final amount to the template --- boxoffice/templates/layout_email.html.jinja2 | 6 +----- boxoffice/templates/payment_receipt.html.jinja2 | 8 ++++---- boxoffice/views/order.py | 6 ++++++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/boxoffice/templates/layout_email.html.jinja2 b/boxoffice/templates/layout_email.html.jinja2 index 1d708fe4..7f2fb52c 100644 --- a/boxoffice/templates/layout_email.html.jinja2 +++ b/boxoffice/templates/layout_email.html.jinja2 @@ -628,11 +628,7 @@ {% trans %}Hasgeek Learning Private Limited{% endtrans %}
- {% trans %}Need help?{% endtrans %} {{ config['SITE_SUPPORT_EMAIL'] }}{{ config['SITE_SUPPORT_PHONE_FORMATTED'] }} - {%- if view %}{# Notification view #} -

- {% if view.reason_email %} {{ view.reason_email }} • {% endif %}{% trans %}Unsubscribe or manage preferences{% endtrans %} - {%- endif %} + {% trans %}Need help?{% endtrans %} {{ config['SITE_SUPPORT_EMAIL'] }}{{ config['SITE_SUPPORT_PHONE'] }} {% endblock footer %} diff --git a/boxoffice/templates/payment_receipt.html.jinja2 b/boxoffice/templates/payment_receipt.html.jinja2 index 09a25028..8f57d754 100644 --- a/boxoffice/templates/payment_receipt.html.jinja2 +++ b/boxoffice/templates/payment_receipt.html.jinja2 @@ -197,6 +197,7 @@ {{ line_item.ticket.description| safe}} + {%- endfor %} {{ line_break(gettext('linebreak')) }} @@ -208,7 +209,7 @@

-

{{ currency_symbol }} {{ line_item.base_amount }}

+

{{ currency_symbol }} {{ total_base_amount }}

@@ -218,7 +219,7 @@

-

{{ currency_symbol }} {{ line_item.discounted_amount }}

+

{{ currency_symbol }} {{ total_discount_amount }}

@@ -228,13 +229,12 @@

-

{{ currency_symbol }} {{ line_item.final_amount }}

+

{{ currency_symbol }} {{ final_amount }}

- {%- endfor %} {%- if order.refunded_amount %} {{ line_break(gettext('double_linebreak')) }} diff --git a/boxoffice/views/order.py b/boxoffice/views/order.py index 60a014eb..5c80e21c 100644 --- a/boxoffice/views/order.py +++ b/boxoffice/views/order.py @@ -479,8 +479,14 @@ def receipt(order: Order): line_items = LineItem.query.filter( LineItem.order == order, LineItem.status == LineItemStatus.CONFIRMED ).all() + total_base_amount = sum([line_item.base_amount for line_item in line_items]) + total_item_discount = sum([line_item.discounted_amount for line_item in line_items]) + final_amount = sum([line_item.final_amount for line_item in line_items]) return render_template( 'payment_receipt.html.jinja2', + total_base_amount=total_base_amount, + total_item_discount = total_item_discount, + final_amount=final_amount, order=order, org=order.organization, line_items=line_items,