templates/reglement/edit.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}Edition Règlement{% endblock %}
  3. {% block body %}
  4.     <ol class="breadcrumb">
  5.         <li>
  6.             <i class="clip-grid-6"></i>
  7.             <a href="#">
  8.                 Règlement
  9.             </a>
  10.         </li>
  11.         <li class="active">
  12.             Edition
  13.         </li>
  14.     </ol>
  15.     <div class="page-header">
  16.         <h1>Règlement</h1>
  17.     </div>
  18.     <div class="row">
  19.         <div class="col-md-12">
  20.             {{ form_start(form, {'attr': {'id': 'form_billing'}}) }}
  21.             <div class="row topPart">
  22.                 {% include 'formErrors.html.twig' %}
  23.                 <div class="col-md-6">
  24.                     {#<div>Numéro facture : {{ billing.id }}</div>#}
  25.                     <div>Date de règlement : {{ form_row(form.date) }}</div>
  26.                     <div>Mode de règlement : {{ form_row(form.mode) }}</div>
  27.                     <div>Montant TTC : {{ form_row(form.ttc) }}</div>
  28.                     <div>Reference : {{ form_row(form.reference) }}</div>
  29.                     <div>Statut : {{ form_row(form.status) }}</div>
  30.                     <div>Nom client : {% if reglement.client %}{{ reglement.client.firstname }} {{ reglement.client.lastname }}{% endif %}</div>
  31.                     <div>Adresse facturation : {% if reglement.client %}{% endif %}</div>
  32.                     <div>Remise client : {{ reglement.client and reglement.client.billingInfos ? reglement.client.billingInfos.discount : 0  }} % </div>
  33.                 </div>
  34.                 <div class="col-md-6">
  35.                     <div>Mode de paiement : {{ reglement.client and reglement.client.billingInfos ? reglement.client.billingInfos.getPayModeString : '' }}</div>
  36.                     <div>Banque: {{ reglement.client and reglement.client.billingInfos ? reglement.client.billingInfos.bankName : '' }} IBAN: {{ reglement.client and reglement.client.billingInfos ? reglement.client.billingInfos.iban : ''  }}</div>
  37.                     <div>Montant règlement :  </div>
  38.                 </div>
  39.             </div>
  40.             <div class="row topPart" style="padding: 20px">
  41.                 <table class="product-table">
  42.                     <thead>
  43.                     <tr>
  44.                         <th>Date</th>
  45.                         <th>Référence</th>
  46.                     </tr>
  47.                     </thead>
  48.                     <tbody>
  49.                     {% for billing in reglement.billings %}
  50.                         <tr class="billingItem">
  51.                             <td>{{  billing.dateBilling|date('d/m/Y') }}</td>
  52.                             <td>{{  billing.code }}</td>
  53.                         </tr>
  54.                     {% else %}
  55.                         <tr>
  56.                             <td colspan="4">Aucun enregistrement trouvé</td>
  57.                         </tr>
  58.                     {% endfor %}
  59.                     </tbody>
  60.                 </table>
  61.             </div>
  62.             <div class="row" style="margin-top:20px;">
  63.                 <div class="col-md-12">
  64.                     <button class="btn btn-success btn-block btn-valid" type="submit">
  65.                         Validation <i class="fa fa-arrow-circle-right"></i>
  66.                     </button>
  67.                 </div>
  68.             </div>
  69.             {{ form_end(form) }}
  70.             <style>
  71.                 .topPart .form-group {
  72.                     display:inline-block;
  73.                 }
  74.             </style>
  75.         </div>
  76.     </div>
  77.     <a href="{{ path('app_reglement_index') }}" class="btn btn-outline-info back-button">Revenir à la liste</a>
  78.     <div>
  79.         {% if reglement.status  != 'Annulé' %}
  80.             {{ form_start(cancelForm, {'attr': {'id': 'form-cancel'}}) }}
  81.                 {{ form_row(cancelForm.motifCancel) }}
  82.                 <button href="#" target="_blank" class="btn btn-danger back-button btn-cancel">ATTENTION : Annuler un réglement</button>
  83.             {{ form_end(cancelForm) }}
  84.         {% endif %}
  85.     </div>
  86. {% endblock %}
  87. {% block javascripts %}
  88.     {{ parent() }}
  89.     <script type="application/javascript">
  90.         $('.btn-cancel').on('click', function (e) {
  91.             e.preventDefault();
  92.             notie.confirm({
  93.                 text: "Etes-vous sur d'annuler ce réglement?",
  94.                 submitText: 'Confirmer', // optional, default = 'Yes'
  95.                 cancelText: 'Annuler', // optional, default = 'Cancel'
  96.                 position: 'top', // optional, default = 'top', enum: ['top', 'bottom']
  97.                 submitCallback: function () {
  98.                     //let pathCancel ="{{ path('reglement_cancel',{'id' : reglement.id }) }}";
  99.                     //window.location = pathCancel;
  100.                     $('#form-cancel').submit();
  101.                 }, // optional
  102.                 cancelCallback: function () {
  103.                 } // optional
  104.             }, function () {
  105.             }, function () {
  106.             })
  107.         })
  108.         function addTagForm($collectionHolder) {
  109.             // Get the data-prototype explained earlier
  110.             var prototype = $collectionHolder.data('prototype');
  111.             // get the new index
  112.             var index = $collectionHolder.data('index');
  113.             var newForm = prototype;
  114.             // You need this only if you didn't set 'label' => false in your tags field in TaskType
  115.             // Replace '__name__label__' in the prototype's HTML to
  116.             // instead be a number based on how many items we have
  117.             // newForm = newForm.replace(/__name__label__/g, index);
  118.             // Replace '__name__' in the prototype's HTML to
  119.             // instead be a number based on how many items we have
  120.             newForm = newForm.replace(/__name__/g, index);
  121.             // increase the index with one for the next item
  122.             $collectionHolder.data('index', index + 1);
  123.             // Display the form in the page in an li, before the "Add a tag" link li
  124.             var $newFormLi = $('<div></div>').append(newForm);
  125.             //$newLinkLi.before($newFormLi);
  126.             $collectionHolder.after($newFormLi);
  127.             $newFormLi.find(".flatpicker").flatpickr({
  128.                 'dateFormat' : 'd-m-Y',
  129.                 "locale": "fr"
  130.             });
  131.         }
  132.         var $collectionHolder;
  133.         // setup an "add a tag" link
  134.         var $addTagButton = jQuery('.btnAddContrat');
  135.         jQuery(document).ready(function() {
  136.             // Get the ul that holds the collection of tags
  137.             $collectionHolder = jQuery('ul.contratList');
  138.             // count the current form inputs we have (e.g. 2), use that as the new
  139.             // index when inserting a new item (e.g. 2)
  140.             $collectionHolder.data('index', $collectionHolder.find(':input').length);
  141.             $addTagButton.on('click', function(e) {
  142.                 // add a new tag form (see next code block)
  143.                 addTagForm($collectionHolder);
  144.             });
  145.             $(document).on('click','.btnDeleteContract', function(e) {
  146.                 // add a new tag form (see next code block)
  147.                 $(e.target).parents('.contract-item').remove();
  148.                 var index = $collectionHolder.data('index');
  149.                 $collectionHolder.data('index', index - 1);
  150.             });
  151.         });
  152.     </script>
  153. {% endblock %}