diff --git a/requirements.txt b/requirements.txt index 41c2e07..9d0a1b3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ jinja2==3.1.4 -reportlab==3.6.13 +reportlab==4.2.0 python-dateutil==2.9.0 diff --git a/receipts/totals.py b/receipts/totals.py index 5e8f0aa..c31b7d2 100644 --- a/receipts/totals.py +++ b/receipts/totals.py @@ -1,12 +1,12 @@ -from decimal import Decimal, ROUND_HALF_UP +from decimal import Decimal, ROUND_HALF_EVEN TWOPLACES = Decimal("0.01") def match_amount(amount: Decimal) -> Decimal: """Sponsor match on a donation: 25p for every pound given.""" - return (amount * Decimal("0.25")).quantize(TWOPLACES, rounding=ROUND_HALF_UP) + return (amount * Decimal("0.25")).quantize(TWOPLACES, rounding=ROUND_HALF_EVEN) def receipt_total(amount: Decimal) -> Decimal: - return amount + match_amount(amount) + return (amount + match_amount(amount)).quantize(TWOPLACES, rounding=ROUND_HALF_EVEN) diff --git a/receipts/templates/receipt.html b/receipts/templates/receipt.html index 0b7d3e1..4aa29f0 100644 --- a/receipts/templates/receipt.html +++ b/receipts/templates/receipt.html @@ -12,9 +12,8 @@
Donor: {{ donor_name }}
Amount given: £{{ amount }}
Sponsor match: £{{ match }}
Total to the rescue: £{{ total }}
-Registered charity no. {{ charity_number }}
-Receipt issued {{ issued_on }}
+Thank you for supporting Hollyfield Animal Rescue. Receipt issued {{ issued_on }}