templates/piece/show.html.twig line 1

Open in your IDE?
  1. {% extends 'back.html.twig' %}
  2. {% block title %}
  3.     Détails facture
  4. {% endblock %}
  5. {% block body %}
  6.     <div class="row">
  7.         <div class="col-md-12">
  8.             <h3>Info Rechnung</h3>
  9.             <hr>
  10.         </div>
  11.     </div>
  12.     <div class="row">
  13.         <div class="col-md-6 m_t_20">
  14.             <ul class="ul_action">
  15.                 <li>
  16.                     <a href="{{ path('piece_index') }}" class="btn btn-sm btn-info"> <span class="fa fa-list-ul"></span>
  17.                         Rechnungen Liste</a>
  18.                 </li>
  19.                 <li>
  20.                     <a href="{{ path('piece_print',{'id':piece.id}) }}"
  21.                        class="btn btn-secondary btn-sm" target="_blank">
  22.                         <span class="fa fa-print"></span> Drücken
  23.                     </a>
  24.                 </li>
  25.                 {% if app.user.isSuperAdmin or getParam('param_title') != 'IRON-APP' %}
  26.                 <li>
  27.                     <a href="{{ path('piece_edit',{'id':piece.id}) }}"
  28.                        class="btn btn-warning btn-sm">
  29.                         <span class="fa fa-edit"></span> Andern
  30.                     </a>
  31.                 </li>
  32.                 {% elseif app.user.isSuperAdmin  %}
  33.                 <li>
  34.                     <a href="{{ path('piece_delete_confirmation',{'id':piece.id}) }}"
  35.                        class="btn btn-danger btn-sm">
  36.                         <span class="fa fa-trash-alt"></span> Löschen
  37.                     </a>
  38.                 </li>
  39.                 {% endif %}
  40.             </ul>
  41.         </div>
  42.     </div>
  43.     <div class="row">
  44.         <div class="col-12">
  45.             <b>Facture: </b>{{ piece.numero }}
  46.         </div>
  47.         <div class="col-12 m_t_10">
  48.             <b>Date: </b>{{ piece.date ? piece.date|date('d/m/Y') : '' }}
  49.         </div>
  50.         <div class="col-12 m_t_10">
  51.             <b>Kunde: </b><a href="{{ path('client_show',{'id':piece.client.id}) }}">{{ piece.client ? piece.client.nomComplet : '' }}</a>
  52.         </div>
  53.         <div class="col-12 m_t_10">
  54.             <b>Solde: </b> {% if piece.solde == 0 %} <span class="badge badge-success">{{ piece.solde }}</span>{% else %}<span class="badge badge-danger">{{ piece.solde }}</span>{% endif %}
  55.         </div>
  56.         <div class="col-12 m_t_10">
  57.             <b>vous Sie wurden serviert von: </b> {{ piece.user ? piece.user.nomComplet : '' }}
  58.         </div>
  59.     </div>
  60.     <div class="row m_t_10">
  61.         <div class="col-12">
  62.             <div class="table-responsive">
  63.                 <table class="table table-condensed">
  64.                     <thead>
  65.                     <tr>
  66.                         <th>Code</th>
  67.                         <th>Barcode</th>
  68.                         <th>Produkt</th>
  69.                         {% if app.user.isSuperAdmin %}
  70.                         <th class="text-right">Einkaufpreis</th>
  71.                         {% endif %}
  72.                         <th class="text-right">Preis Ohne Mwst</th>
  73.                         <th class="text-center">Qté</th>
  74.                         <th class="text-right">Rabatt</th>
  75.                         <th class="text-right">Mwst</th>
  76.                         <th class="text-right">Total Ohne Mwst %</th>
  77.                         <th class="text-right">Total Ohne Mwst</th>
  78.                     </tr>
  79.                     </thead>
  80.                     <tbody>
  81.                     {% for ligne_piece in piece.pieceLines %}
  82.                         <tr>
  83.                             <td>{{ ligne_piece.product ? ligne_piece.product.code : '' }}</td>
  84.                             <td>{{ ligne_piece.product ? ligne_piece.product.barecode : '' }}</td>
  85.                             <td>{{ ligne_piece.product ? ligne_piece.product.nomComplet : '' }}</td>
  86.                             {% if app.user.isSuperAdmin %}
  87.                             <td class="text-right">{{ ligne_piece.priceBuyHT }}</td>
  88.                             {% endif %}
  89.                             <td class="text-right">{{ ligne_piece.priceHT }}</td>
  90.                             <td class="text-center">{{ ligne_piece.qty }}</td>
  91.                             <td class="text-right">{{ ligne_piece.rabais!='' ? ligne_piece.rabais : '0.00' }}%</td>
  92.                             <td class="text-right">{{ ligne_piece.tva!='' ? ligne_piece.tva : '0.00' }}%</td>
  93.                             <td class="text-right">{{ ligne_piece.totalHT }}</td>
  94.                             <td class="text-right">{{ ligne_piece.rabais!='' ? (ligne_piece.totalHT *(1-(ligne_piece.rabais/100)))|number_format(2,'.','') : ligne_piece.totalHT }}</td>
  95.                         </tr>
  96.                     {% endfor %}
  97.                     </tbody>
  98.                 </table>
  99.             </div>
  100.         </div>
  101.     </div>
  102.     <div class="row">
  103.         <div class="col-md-7 m_t_20">
  104.             {% if piece.client.getAvailablePoints() > 0 and piece.solde > 0 %}
  105.                 <span
  106.                         class="btn btn-outline-info" data-amount="{{ piece.amountTTC }}" data-available="{{ piece.client.getAvailablePoints() }}"
  107.                         data-toggle="collapse" data-target="#collapseAffectationPoints" aria-expanded="{% if app.request.get('col') == 'gift' %}true{% else %}false{% endif %}" aria-controls="collapseAffectationPoints"
  108.                 >
  109.                     ({{ piece.client.getAvailablePoints() }}) points fidélité disponible
  110.                 </span>
  111.             {% endif %}
  112.             {% if piece.client.getNotAffectedPayement() is not null and piece.solde > 0 %}
  113.                 <span
  114.                         class="btn btn-outline-primary" data-amount="{{ piece.amountTTC }}" data-available="{{ piece.client.getNotAffectedPayement().getRest() }}"
  115.                         data-toggle="collapse" data-target="#collapseAffectationPaiement" aria-expanded="{% if app.request.get('col') == 'affect' %}true{% else %}false{% endif %}" aria-controls="collapseAffectationPaiement"
  116.                 >
  117.                     ({{ piece.client.getNotAffectedPayement().getRest()|number_format(2, '.', ' ') }}) paiement enregistré mais non affecté
  118.                 </span>
  119.             {% endif %}
  120.             {% if piece.solde > 0 %}
  121.                 <span
  122.                         class="btn btn-outline-dark"
  123.                         data-toggle="collapse" data-target="#collapseAjouterPaiement" aria-expanded="{% if app.request.get('col') == 'new' %}true{% else %}false{% endif %}" aria-controls="collapseAjouterPaiement"
  124.                 ><span class="fa fa-plus"></span> Zahlung machen</span>
  125.             {% endif %}
  126.             {% if piece.client.getAvailablePoints() > 0 and piece.solde > 0 %}
  127.                 <div class="collapse collapse-afectation bg-info m_t_20 p-4 {% if app.request.get('col') == 'gift' %}show{% endif %}" id="collapseAffectationPoints">
  128.                     <form action="{{ path('affect_payment_piece',{'id':piece.id}) }}" method="POST">
  129.                         <div class="row">
  130.                             <div class="col-12">
  131.                                 <h4>Affectation de points fidélité</h4>
  132.                             </div>
  133.                         </div>
  134.                         <div class="row">
  135.                             <div class="col-6">
  136.                                 <input type="text" class="form-control" name="affectation" value="{% if app.request.get('affectation') is not null  %}{{ app.request.get('affectation') }}{% else %}{{ min(piece.solde,piece.client.getAvailablePoints()) }}{% endif %}">
  137.                                 <input type="hidden" name="type" value="gift">
  138.                             </div>
  139.                             <div class="col-6">
  140.                                 <input type="submit" value="Speichern" class="btn btn-danger">
  141.                             </div>
  142.                         </div>
  143.                     </form>
  144.                 </div>
  145.             {% endif %}
  146.             {% if piece.client.getNotAffectedPayement() is not null and piece.solde > 0 %}
  147.             <div class="collapse bg-primary collapse-afectation m_t_20 p-4 {% if app.request.get('col') == 'affect' %}show{% endif %}" id="collapseAffectationPaiement">
  148.                 <form action="{{ path('affect_payment_piece',{'id':piece.id}) }}" method="POST">
  149.                     <div class="row">
  150.                         <div class="col-12">
  151.                             <h4>Affectation de paiement</h4>
  152.                         </div>
  153.                     </div>
  154.                     <div class="row">
  155.                         <div class="col-6">
  156.                             <input type="text" class="form-control" name="affectation" value="{% if app.request.get('affectation') is not null  %}{{ app.request.get('affectation') }}{% else %}{{ min(piece.solde,piece.client.getNotAffectedPayement().getRest()) }}{% endif %}">
  157.                             <input type="hidden" name="type" value="affect">
  158.                         </div>
  159.                         <div class="col-6">
  160.                             <input type="submit" value="Speichern" class="btn btn-danger">
  161.                         </div>
  162.                     </div>
  163.                 </form>
  164.             </div>
  165.             {% endif %}
  166.             {% if piece.solde > 0 %}
  167.                 <div class="collapse bg-dark collapse-afectation m_t_20 p-4 {% if app.request.get('col') == 'new' %}show{% endif %}" id="collapseAjouterPaiement">
  168.                     <form action="{{ path('affect_payment_piece',{'id':piece.id}) }}" method="POST">
  169.                         <div class="row">
  170.                             <div class="col-12">
  171.                                 <h4>Zahlung Machen</h4>
  172.                             </div>
  173.                         </div>
  174.                         <div class="row">
  175.                             <div class="col-3">
  176.                                 <label for="typePayment">Mode de paiement</label>
  177.                                 <select type="text" class="form-control" id="typePayment" name="typePayment">
  178.                                     <option></option>
  179.                                     {% for mode,k in modes %}
  180.                                         <option value="{{ k }}" {% if k == app.request.get('typePayment') %}selected{% endif %}>{{ mode }}</option>
  181.                                     {% endfor %}
  182.                                 </select>
  183.                                 <input type="hidden" name="type" value="new">
  184.                             </div>
  185.                             <div class="col-3">
  186.                                 <label for="typePayment">Montant</label>
  187.                                 <input type="text" class="form-control" id="amountPayment" name="amountPayment" value="{% if app.request.get('amountPayment') is not null %}{{ app.request.get('amountPayment') }}{% else %}{{ piece.solde }}{% endif %}">
  188.                             </div>
  189.                             <div class="col-3">
  190.                                 <label for="datePayment">Date</label>
  191.                                 <input type="date" class="form-control" id="datePayment" name="datePayment" value="{% if app.request.get('datePayment') is not null %}{{ app.request.get('datePayment') }}{% else %}{{ "now"|date("Y-m-d") }}{% endif %}">
  192.                             </div>
  193.                             <div class="col-3">
  194.                                 <span class="d-block m_t_30"></span>
  195.                                 <input type="submit" value="Enregistrer" class="btn btn-danger">
  196.                             </div>
  197.                         </div>
  198.                     </form>
  199.                 </div>
  200.             {% endif %}
  201.             {% if piece.affectations|length > 0 %}
  202.                 <table class="table table-bordered table-striped m_t_20">
  203.                     <tr>
  204.                         <th>N°</th>
  205.                         <th>Date</th>
  206.                         <th>Type</th>
  207.                         <th>Montant affecté</th>
  208.                         <th>Action</th>
  209.                     </tr>
  210.                 {% for affectation in piece.affectations %}
  211.                     <tr>
  212.                         <td>{{ affectation.payment.id }}</td>
  213.                         <td>{{ affectation.payment.date|date('d/m/Y') }}</td>
  214.                         <td>{{ affectation.payment.getTypeText() }}</td>
  215.                         <td>{{ affectation.amount|number_format(2, '.', ' ') }}</td>
  216.                         <td>
  217.                             <a href="{{ path('payment_show',{'id':affectation.payment.id}) }}" class="btn btn-secondary"><span class="fa fa-info"></span></a>
  218.                             <a href="{{ path('payment_delete_affectation',{'id':affectation.id}) }}" class="btn btn-danger confirm-button" data-message="Voulez-vous vraiment supprimer cette affectation?"><span class="fa fa-trash"></span></a>
  219.                         </td>
  220.                     </tr>
  221.                 {% endfor %}
  222.                 </table>
  223.             {% else %}
  224.                 <div class="alert alert-info m_t_20">Aucun paiement affecté pour cette facture</div>
  225.             {% endif %}
  226.         </div>
  227.         <div class="offset-lg-1 col-lg-4">
  228.             <div class="table-responsive">
  229.                 <table class="table table-condensed">
  230.                     {% if app.user.isSuperAdmin %}
  231.                     <tr>
  232.                         <th>Montant Achat</th>
  233.                         <td class="text-right">{{ piece.amountBuyHT }}</td>
  234.                     </tr>
  235.                     <tr>
  236.                         <th>Montant Marge</th>
  237.                         <td class="text-right">{{ piece.amountMarge }}</td>
  238.                     </tr>
  239.                     {% endif %}
  240.                     <tr>
  241.                         <th>Montant HT</th>
  242.                         <td class="text-right">{{ piece.amountHT }}</td>
  243.                     </tr>
  244.                     <tr>
  245.                         <th>Montant Remise</th>
  246.                         <td class="text-right">{{ piece.amountDiscount }}</td>
  247.                     </tr>
  248.                     <tr>
  249.                         <th>Montant TVA</th>
  250.                         <td class="text-right">{{ piece.amountTVA }}</td>
  251.                     </tr>
  252.                     <tr>
  253.                         <th>Bon réduction</th>
  254.                         <td class="text-right">{{ piece.amountDiscountTotal }}</td>
  255.                     </tr>
  256.                     <tr>
  257.                         <th>Montant TTC</th>
  258.                         <td class="text-right">{{ piece.amountTTC }}</td>
  259.                     </tr>
  260.                 </table>
  261.             </div>
  262.         </div>
  263.     </div>
  264. {% endblock %}
  265. {% block javascripts %}
  266.     <script src="{{ asset('js/collection_piece_line.js') }}"></script>
  267.     <script>
  268.         $('#piece_client').select2();
  269.     </script>
  270. {% endblock %}