{% load i18n %}

<li class="px-0 border-0 d-flex justify-content-between">
    <span>{% trans 'Subtotal' %}</span>
    <span>${{ invoice.calculate_subtotal|default_if_none:"0.00"|floatformat:2 }}</span>
  </li>
  
{% if invoice.get_discounts %}
  <li class="px-0 border-0 d-flex justify-content-between">
      <span>{% trans 'Discount Applied' %}</span>
      <span>-${{ invoice.get_discounts|default_if_none:"0.00"|floatformat:2 }}</span>
    </li>
{% endif %}

  <li class="px-0 border-0 d-flex justify-content-between">
    <span>{% trans 'Estimated Shipping' %}</span>
    <span>${{ invoice.shipping|default_if_none:"0.00"|floatformat:2 }}</span>
  </li>

  <li class="px-0 border-0 d-flex justify-content-between">
    <span>{% trans 'Estimated Tax' %}</span>
    <span>${{ invoice.tax|default_if_none:"0.00"|floatformat:2 }}</span>
  </li>
  <li class="px-0 justify-content-between" style="list-style-type: none;">
    <hr class="my-3 border-dark border-5" />
  </li>

  <li class="px-0 border-0 d-flex justify-content-between">
    {% with currency=invoice.get_currency_display %}
    <span class="font-weight-bolder">{% blocktrans %}Total ({{ currency }}) {% endblocktrans %}</span>
    {% endwith %}
    <span class="text-primary">${{ invoice.total|default_if_none:"0.00"|floatformat:2 }}</span>
  </li>
  
{% if future_billing_info %}
  {% for billing_date, billing_total in invoice.get_billing_dates_and_prices.items %}
  <li class="px-0 border-0 d-flex justify-content-between mt-3">
    <span class="text-dark font-italic">{% trans 'Your credit card will be billed on ' %}{{ billing_date|date:"F j, Y" }}</span>
    <span class="font-italic" >${{ billing_total|default_if_none:"0.00"|floatformat:2 }}</span>
  </li>
  {% endfor %}
{% endif %}