mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 16:24:08 -04:00
Display letter postage on the usage page
The monthly letter cost was already broken down by price on the usage page, but this change adds postage details to the usage page too.
This commit is contained in:
@@ -435,8 +435,12 @@ def get_free_paid_breakdown_for_billable_units(year, free_sms_fragment_limit, bi
|
||||
free_sms_fragment_limit, cumulative, previous_cumulative,
|
||||
[billing_month for billing_month in sms_units if billing_month['month'] == month]
|
||||
)
|
||||
letter_billing = [(x['billing_units'], x['rate'], (x['billing_units'] * x['rate']))
|
||||
letter_billing = [(x['billing_units'], x['rate'], (x['billing_units'] * x['rate']), x['postage'])
|
||||
for x in letter_units if x['month'] == month]
|
||||
|
||||
if letter_billing:
|
||||
letter_billing.sort(key=lambda x: (x[3], x[1]))
|
||||
|
||||
letter_total = 0
|
||||
for x in letter_billing:
|
||||
letter_total += x[2]
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
<ul>
|
||||
{% for letter in month.letters%}
|
||||
{% if letter[0] %}
|
||||
<li class="tabular-numbers">{{ "{:,}".format(letter[0])}} letters at {{ '{:.0f}p'.format(letter[1] * 100) }}
|
||||
<li class="tabular-numbers">{{ "{:,} {}".format(letter[0], letter[3])}} class letters at {{ '{:.0f}p'.format(letter[1] * 100) }}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user