{% extends 'layout.html.twig' %}

{% block subnavi %}{% endblock %}

{% block body %}
  <div class="row">
    <div class="col-sm-offset-1 col-sm-8 invoice-document margin-bottom-30">
      <div class="frame row">
        <div class="col-sm-12 inner">
          <p class="sender">Better School! Internatsberatung GmbH, Lenzhalde 68, D-70192 Stuttgart</p>

          <p class="recipient">
            {{ invoice.provider }}<br />
            {{ invoice.address }}<br />
            {{ invoice.zip }}<br />
            {{ invoice.country }}
          </p>

          {% set tradingYear = 'now'|date('y') ~ '/' ~ 'now + 1 year'|date('y') %}
          {% if 'now'|date('m') < 8 %}
            {% set tradingYear = 'now - 1 year'|date('y') ~ '/' ~ 'now'|date('y') %}
          {% endif %}
          <p class="date">
          Stuttgart, {{ 'now'|date('d.m.Y') }}<br/>
          Invoice No. S-{{ invoice.invoiceNo }} {{ tradingYear }}<br/>
          VAT {{ invoice.vat }}<br/>
          </p>

          <h1>Invoice</h1>
          <p>
            Dear Sir, dear Madam,
          </p>

          <p>
            Please find enclosed our invoice concerning our commission for {{ term.termName }}  Term {{ term.year }}
          </p>

          <div class="invoice-items">
            <div class="table">
              <div class="head">
                <span>Last name</span>
                <span>First name</span>
                <span>Year</span>
                <span>Start at School</span>
                <span>Term at School</span>
                <span>Termly fees</span>
                <span>Commission (%)</span>
                <span>Commission (€)</span>
                <span></span>
              </div>

              {% for item in invoice.invoiceItems %}
                {% include 'partials/invoice_item.html.twig' %}
              {% endfor %}

              <div class="total-row">
                <div style="display: none"></div>
                <div>Total:</div>
                <div class="empty"></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                <div></div>
                <div id="total-cell">{{ total|number_format(2, ',', '.') }}</div>
              </div>
            </div>
          </div>

          <div class="footer row">
            <div class="col-sm-12">
              <p>
                Reverse charge is applicable. Tax liability is shifted to the recipient.
              </p>
              <p>
                Thank you very much for the excellent cooperation!
              </p>
              <p>
                Yours sincerely,<br />
                <img src="../../JvB.jpg" alt="Signature" width="100" />
              </p>

              <div class="hint col-sm-offset-4 col-sm-4">
                <strong>Please send the amount in GBP and make sure it will not be<br/>
                  exchanged to Euro as we hold a GBP account in Germany
                </strong>
                (and not an EUR account) to avoid unnecessary cost and loss of money.<br/>
                <br/>
                <span class="text-danger">
                  Please notice the attached information sheet <br/>
                  and give this to your bank processing the transfer.
                </span>
                <br/>
                <br/>
                Choosing the given intermediary banks for reimbursement<br/>
                should avoid unrequested exchange by one of the banks involved.
              </div>

              <div class="col-sm-12">
                <hr />
              </div>
              <div class="company-info col-sm-offset-2 col-sm-8">
                <div class="row">
                  <div class="col-sm-4">
                    Better School! Internatsberatung GmbH<br/>
                    Geschäftsführung: <br/>
                    Dr. Juliane von Bülow, Thomas von Bülow<br/>
                    Lenzhalde 68, 70192 Stuttgart, Germany
                  </div>
                  <div class="col-sm-4">
                    Bank details: Kreissparkasse Böblingen<br/>
                    70134 Böblingen, Germany<br/>
                    IBAN: DE50 6035 0130 0220 0017 48<br/>
                    SWIFT: BBKR DE6B XXX<br /><br />
                    Registergericht Stuttgart HRB 721 791<br/>
                    USt ID DE 252221682
                  </div>
                  <div class="col-sm-4">
                    info@betterschool.de | www.BetterSchool.de<br/>
                    Tel.: +49 (0)711 469 179 -40  |  Fax.: -49
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>

      <a href="/pdfinvoice.php?art=rid&id={{ invoice.id }}" class="btn btn-primary margin-bottom-30">Rechung erstellen</a>
    </div>
  </div>
{% endblock %}

 {% block javascripts %}
   <script src="/scripts/main.js" type="module"></script>
 {% endblock %}