Add ho values

This commit is contained in:
PCoder 2020-04-07 19:33:13 +05:30
parent 3aff4bb69a
commit 8443e03b1f
2 changed files with 4 additions and 2 deletions

View file

@ -86,8 +86,8 @@
<tbody> <tbody>
{% for ho, stripe_charge_data in invs_charge %} {% for ho, stripe_charge_data in invs_charge %}
<tr> <tr>
<td class="xs-td-inline">{{ho.generic_product.product_name.capitalize()}}</td> <td class="xs-td-inline">{{ho.generic_product.product_name}}</td>
<td class="xs-td-inline">{{ho.created_at.strftime('%Y-%m-%d')}}</td> <td class="xs-td-inline">{{ho.created_at}}</td>
<td class="xs-td-inline">{{ho.price}}</td> <td class="xs-td-inline">{{ho.price}}</td>
<td class="text-right last-td"> <td class="text-right last-td">
<a class="btn btn-order-detail" href="{stripe_charge_data.receipt_url}" target="_blank">{% trans "See Invoice" %}</a> <a class="btn btn-order-detail" href="{stripe_charge_data.receipt_url}" target="_blank">{% trans "See Invoice" %}</a>

View file

@ -1344,6 +1344,8 @@ class InvoiceListView(LoginRequiredMixin, TemplateView):
) )
stripe_chgs = [] stripe_chgs = []
for ho in hosting_orders: for ho in hosting_orders:
ho.generic_product.product_name = ho.generic_product.product_name.capitalize()
ho.created = ho.created.strftime('%Y-%m-%d')
stripe_chgs.append( stripe_chgs.append(
{ho: stripe.Charge.retrieve(ho.stripe_charge_id)}) {ho: stripe.Charge.retrieve(ho.stripe_charge_id)})
paginator_charges = Paginator(stripe_chgs, 10) paginator_charges = Paginator(stripe_chgs, 10)