-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed email footer and returned sum of base amount, discounted amount…
… and final amount to the template
- Loading branch information
Showing
3 changed files
with
11 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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]) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
anishTP
Author
Contributor
|
||
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, | ||
|
For purchases with more than one
item-id
thetotal_base_amount
,discount_amount
needs to be grouped byitem-id
to prevent duplication ofline_item
inside the receipt template