<commit_before>{% extends 'report_html_accounts/reports/base.html' %}

{% block title %}
  Invoice
{% endblock %}

{% block main %}
    {% for invoice in records %}
      <div class="container-fluid {% if not loop.first %}page-break{% endif %}">
        <div class="row">
          <div class="col-xs-12">
            <table class="table no-border">
              <tr>
                {% block header %}
                {% include header%}
                {% endblock %}
              </tr>
              <tr>
                <td>
                  <span><strong>Invoice#</strong> {{ invoice.number or '' }}</span><br />
                  <span><strong>Date:</strong> {{ (invoice.invoice_date or datetime.date.today())|dateformat }}</span>
                </td>
              </tr>
              <tr>
                <td>
                  <strong>Sold To:</strong>
                </td>
                <td style="border-left: 1px solid #ddd">
                  <strong>Sold By:</strong>
                </td>
              </tr>
              <tr style="border-bottom: 1px solid #ddd">
                <td>
                  {% if invoice.invoice_address %}
                    {% for line in invoice.invoice_address.full_address.split('\n') %}
                      {{ line }}<br/>
                    {% endfor %}
                    {% if invoice.party.phone %}
                      <br/>Phone: {{ invoice.party.phone }}
                    {% endif %}
                    {% if invoice.party.fax %}
                      <br/>Fax: {{ invoice.party.fax }}
                    {% endif %}
                    {% if invoice.party.email %}
                      <br/>Email: {{ invoice.party.email }}
                    {% endif %}
                  {% endif %}
                </td>
                <td style="border-left: 1px solid #ddd">
                  {% set company_party = user.company.party %}
                  {% for line in company_party.addresses[0].full_address.split('\n') %}
                    {{ line }}<br/>
                  {% endfor %}
                  {% if company_party.phone %}
                    <br/>Phone: {{ company_party.phone }}
                  {% endif %}
                  {% if company_party.fax %}
                    <br/>Fax: {{ company_party.fax }}
                  {% endif %}
                  {% if company_party.email %}
                    <br/>Email: {{ company_party.email }}
                  {% endif %}
                </td>
              </tr>
            </table>
            <table class="table borderless bottom2px top2px">
              <thead>
                <th nowrap>Product</th>
                <th nowrap>SKU</th>
                <th class="text-right" nowrap>Qty</th>
                <th class="text-right" nowrap>Unit Price</th>
                <th class="text-right" nowrap>Amount</th>
              </thead>
              <tbody>
                {% for line in invoice.lines %}
                  <tr>
                    <td>{{ line.product and line.product.name or line.description }}</td>
                    <td>{{ line.product and line.product.code or '-' }}</td>
                    <td class="text-right">{{ formatLang(line.quantity, invoice.party.lang, digits=line.unit_digits) }}</td>
                    <td class="text-right">{{ line.unit_price|currencyformat(invoice.currency.code) }}</td>
                    <td class="text-right">{{ line.amount|currencyformat(invoice.currency.code)   }}</td>
                  </tr>
                {% endfor %}
                <tr class="b-hide">
                  <td colspan="8"></td>
                </tr>
              </tbody>
            </table>
          </div>
          <div class="col-xs-5 col-xs-offset-7">
            <table class="table borderless bottom2px">
              <tbody>
                {% for tax in invoice.taxes|sorted_tax_lines %}
                  <tr>
                    <td class="base-tax-padding">
                      {{ "Base %s" % (tax.tax.rate * 100)|round|int|string + '%' }}
                    </td>
                    <td class="text-right base-tax-padding">
                      {{ tax.base|currencyformat(invoice.currency.code) }}
                    </td>
                    <td class="text-right base-tax-padding">
                      {{ tax.amount|currencyformat(invoice.currency.code) }}
                    </td>
                    <td class="text-right base-tax-padding">
                      {{ (tax.base + tax.amount)|currencyformat(invoice.currency.code) }}
                    </td>
                  </tr>
                {% endfor %}
              </tbody>
            </table>
          </div>
          <div class="col-xs-6 col-xs-offset-6">
            <table class="table borderless bottom2px">
              <tr>
                <td class="text-right" style="width:100%;">
                  Total (excl. tax)
                </td>
                <td class="text-right">
                  {{ invoice.untaxed_amount|currencyformat(invoice.currency.code) }}
                </td>
              </tr>
              <tr>
                <td class="text-right" style="width:100%;">
                  Tax
                </td>
                <td class="text-right">
                  {{ invoice.tax_amount|currencyformat(invoice.currency.code) }}
                </td>
              </tr>
              <tr class="font-bold">
                <td class="text-right text12" style="width:100%;">
                  Total (incl. tax)
                </td>
                <td class="text-right text12">
                  {{ invoice.total_amount|currencyformat(invoice.currency.code) }}
                </td>
              </tr>
            </table>
          </div>
        </div>
      </div>
    {% endfor %}
{% endblock %}
<commit_msg>Use format number instead of formatLang<commit_after>{% extends 'report_html_accounts/reports/base.html' %}

{% block title %}
  Invoice
{% endblock %}

{% block main %}
    {% for invoice in records %}
      <div class="container-fluid {% if not loop.first %}page-break{% endif %}">
        <div class="row">
          <div class="col-xs-12">
            <table class="table no-border">
              <tr>
                {% block header %}
                {% include header%}
                {% endblock %}
              </tr>
              <tr>
                <td>
                  <span><strong>Invoice#</strong> {{ invoice.number or '' }}</span><br />
                  <span><strong>Date:</strong> {{ (invoice.invoice_date or datetime.date.today())|dateformat }}</span>
                </td>
              </tr>
              <tr>
                <td>
                  <strong>Sold To:</strong>
                </td>
                <td style="border-left: 1px solid #ddd">
                  <strong>Sold By:</strong>
                </td>
              </tr>
              <tr style="border-bottom: 1px solid #ddd">
                <td>
                  {% if invoice.invoice_address %}
                    {% for line in invoice.invoice_address.full_address.split('\n') %}
                      {{ line }}<br/>
                    {% endfor %}
                    {% if invoice.party.phone %}
                      <br/>Phone: {{ invoice.party.phone }}
                    {% endif %}
                    {% if invoice.party.fax %}
                      <br/>Fax: {{ invoice.party.fax }}
                    {% endif %}
                    {% if invoice.party.email %}
                      <br/>Email: {{ invoice.party.email }}
                    {% endif %}
                  {% endif %}
                </td>
                <td style="border-left: 1px solid #ddd">
                  {% set company_party = user.company.party %}
                  {% for line in company_party.addresses[0].full_address.split('\n') %}
                    {{ line }}<br/>
                  {% endfor %}
                  {% if company_party.phone %}
                    <br/>Phone: {{ company_party.phone }}
                  {% endif %}
                  {% if company_party.fax %}
                    <br/>Fax: {{ company_party.fax }}
                  {% endif %}
                  {% if company_party.email %}
                    <br/>Email: {{ company_party.email }}
                  {% endif %}
                </td>
              </tr>
            </table>
            <table class="table borderless bottom2px top2px">
              <thead>
                <th nowrap>Product</th>
                <th nowrap>SKU</th>
                <th class="text-right" nowrap>Qty</th>
                <th class="text-right" nowrap>Unit Price</th>
                <th class="text-right" nowrap>Amount</th>
              </thead>
              <tbody>
                {% for line in invoice.lines %}
                  <tr>
                    <td>{{ line.product and line.product.name or line.description }}</td>
                    <td>{{ line.product and line.product.code or '-' }}</td>
                    <td class="text-right">{{ format_number(line.quantity, invoice.party.lang, digits=line.unit_digits) }}</td>
                    <td class="text-right">{{ line.unit_price|currencyformat(invoice.currency.code) }}</td>
                    <td class="text-right">{{ line.amount|currencyformat(invoice.currency.code)   }}</td>
                  </tr>
                {% endfor %}
                <tr class="b-hide">
                  <td colspan="8"></td>
                </tr>
              </tbody>
            </table>
          </div>
          <div class="col-xs-5 col-xs-offset-7">
            <table class="table borderless bottom2px">
              <tbody>
                {% for tax in invoice.taxes|sorted_tax_lines %}
                  <tr>
                    <td class="base-tax-padding">
                      {{ "Base %s" % (tax.tax.rate * 100)|round|int|string + '%' }}
                    </td>
                    <td class="text-right base-tax-padding">
                      {{ tax.base|currencyformat(invoice.currency.code) }}
                    </td>
                    <td class="text-right base-tax-padding">
                      {{ tax.amount|currencyformat(invoice.currency.code) }}
                    </td>
                    <td class="text-right base-tax-padding">
                      {{ (tax.base + tax.amount)|currencyformat(invoice.currency.code) }}
                    </td>
                  </tr>
                {% endfor %}
              </tbody>
            </table>
          </div>
          <div class="col-xs-6 col-xs-offset-6">
            <table class="table borderless bottom2px">
              <tr>
                <td class="text-right" style="width:100%;">
                  Total (excl. tax)
                </td>
                <td class="text-right">
                  {{ invoice.untaxed_amount|currencyformat(invoice.currency.code) }}
                </td>
              </tr>
              <tr>
                <td class="text-right" style="width:100%;">
                  Tax
                </td>
                <td class="text-right">
                  {{ invoice.tax_amount|currencyformat(invoice.currency.code) }}
                </td>
              </tr>
              <tr class="font-bold">
                <td class="text-right text12" style="width:100%;">
                  Total (incl. tax)
                </td>
                <td class="text-right text12">
                  {{ invoice.total_amount|currencyformat(invoice.currency.code) }}
                </td>
              </tr>
            </table>
          </div>
        </div>
      </div>
    {% endfor %}
{% endblock %}

{'fraction_non_alphanumeric': 0.14583154828206665, 'fraction_numerical': 0.005312312569616999, 'mean_word_length': 1.1023054755043227, 'pattern_counts': {'":': 0, '<': 237, '<?xml version=': 0, '>': 237, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1960774', 'n_tokens_mistral': 3396, 'n_tokens_neox': 2967, 'n_words': 573}