templates/client/_form.html.twig line 1

Open in your IDE?
  1. {{ form_start(form, {'attr': {'id': 'form_client'}}) }}
  2.     <div class="row">
  3.         {% include 'formErrors.html.twig' %}
  4.         <div class="col-md-6">
  5.             {{ form_row(form.lastname) }}
  6.             {{ form_row(form.civilite) }}
  7.         </div>
  8.         <div class="col-md-6">
  9.             {{ form_row(form.firstname) }}
  10.             {{ form_row(form.birthday) }}
  11.         </div>
  12.         <div class="col-md-6">
  13.             {{ form_row(form.site) }}
  14.             {{ form_row(form.roomNumber) }}
  15.         </div>
  16.         <div class="col-md-6">
  17.             {{ form_row(form.deathday) }}
  18.             {{ form_row(form.statusProspect) }}
  19.         </div>
  20.         <div class="col-md-6">
  21.             {{ form_row(form.consignesClient) }}
  22.         </div>
  23.         <div class="col-md-6">
  24.             {{ form_row(form.comments) }}
  25.         </div>
  26.         <div class="col-md-6">
  27.             {{ form_row(form.daysOfWeek) }}
  28.         </div>
  29.         {% if client %}
  30.             <div class="row col-md-12">
  31.                 <div class="col-md-6" style="display: flex;column-gap: 10px">
  32.                     {% if client.statusProspect != 'Inactif' and client.statusProspect !='Parti' and client.statusProspect !='Décès' %}
  33.                         <a href="{{ path('app_planning_liste',  {'client_id': client.id}) }}" class="btn btn-primary">Voir le planning</a>
  34.                         {% if client.id %}
  35.                           <a href="{{ path('app_client_recurrence',  {'id': client.id}) }}" class="btn btn-primary" target="_blank">
  36.                               Recurrence Coiffure✂️
  37.                           </a>
  38.                         {% endif %}
  39.                         {% if client.id %}
  40.                             <a href="{{ path('app_client_recurrenceesthetique',  {'id': client.id}) }}" class="btn btn-primary" target="_blank">
  41.                                 Recurrence Esthetique 💄</a>
  42.                         {% endif %}
  43.                     {% endif %}
  44. {#                    <div>#}
  45. {#                        <button class="btn btn-success open-envoi-facture"  data-target="#modalEnvoiFacture">Envoi facture</button>#}
  46. {#                    </div>#}
  47.                 </div>
  48.             </div>
  49.         {% endif %}
  50.     </div>
  51.     {% include 'requiredFields.html.twig' %}
  52.     <div class="row">
  53.         <div class="col-md-12">
  54.             <ul class="nav nav-tabs">
  55.                 <li class="{{ (isBilling is defined and isBilling) or (isReg is defined and isReg) ? '' : 'active' }}">
  56.                     <a href="#contacts" data-toggle="tab">Contact principal</a>
  57.                 </li>
  58.                 <li>
  59.                     <a href="#famille" data-toggle="tab">Proches</a>
  60.                 </li>
  61. {#                <li class="">#}
  62. {#                    <a href="#prestations" data-toggle="tab">Contrat de prestations</a>#}
  63. {#                </li>#}
  64.                 <li class="">
  65.                     <a href="#facturation" data-toggle="tab">Gestion facturation</a>
  66.                 </li>
  67.                 <li class="{{ isBilling is defined and isBilling ? 'active' : '' }}">
  68.                     <a href="#factures" data-toggle="tab" aria-expanded="{{ isBilling is defined and isBilling ? 'true' : 'false' }}">Factures</a>
  69.                 </li>
  70.                 <li class="{{ isReg is defined and isReg ? 'active' : '' }}">
  71.                   <a href="#reglements" data-toggle="tab" aria-expanded="{{ isReg is defined and isReg ? 'true' : 'false' }}">Réglements</a>
  72.                 </li>
  73. {#                <li class="">#}
  74. {#                    <a href="#recurrence" data-toggle="tab">Récurrence</a>#}
  75. {#                </li>#}
  76.             </ul>
  77.             <div class="tab-content clearfix">
  78.                 <!-- contact -->
  79.                 <div class="tab-pane {{ (isBilling is defined and isBilling) or (isReg is defined and isReg) ? '' : 'active' }}" id="contacts">
  80.                     <div class="panel-heading">
  81.                        Contact principal
  82.                     </div>
  83.                     <div class="panel-body">
  84.                         <div class="col-md-12">
  85.                             <div class="col-md-6">
  86.                                 {{ form_row(form.nomTuteur) }}
  87.                             </div>
  88.                             <div class="col-md-6">
  89.                                 {{ form_row(form.prenomTuteur) }}
  90.                             </div>
  91.                             <div class="col-md-6">
  92.                                 {{ form_row(form.civiliteTuteur) }}
  93.                             </div>
  94.                             <div class="col-md-6">
  95.                                 {{ form_row(form.commentTuteur) }}
  96.                             </div>
  97.                             <div class="col-md-6">
  98.                                 {{ form_row(form.numeroTuteur) }}
  99.                             </div>
  100.                             <div class="col-md-6">
  101.                                 {{ form_row(form.emailTuteur) }}
  102.                             </div>
  103.                             <div class="col-md-6">
  104.                                 {{ form_row(form.addressTuteur) }}
  105.                             </div>
  106.                             <div class="col-md-6">
  107.                                 {{ form_row(form.addressTuteur2) }}
  108.                             </div>
  109.                             <div class="col-md-6">
  110.                                 {{ form_row(form.zipcode) }}
  111.                             </div>
  112.                             <div class="col-md-6">
  113.                                 {{ form_row(form.city) }}
  114.                             </div>
  115.                         </div>
  116.                     </div>
  117.                 </div>
  118.                 <!-- famille -->
  119.                 <div class="tab-pane" id="famille">
  120.                     <div class="panel-heading">
  121.                        Proches
  122.                     </div>
  123.                     <div class="panel-body">
  124.                         <ul class="familyList" style="list-style: none"
  125.                             data-prototype="{% apply escape %}{% include 'client/familyPrototype.html.twig' with {'form': form.familyMembers.vars.prototype} %}{% endapply %}">
  126.                             {% for famille in form.familyMembers %}
  127.                                 <div class="row family-item">
  128.                                     <div class="col-md-6">
  129.                                         {{ form_row(famille.firstname) }}
  130.                                     </div>
  131.                                     <div class="col-md-6">
  132.                                         {{ form_row(famille.lastname) }}
  133.                                     </div>
  134.                                     <div class="col-md-6">
  135.                                         {{ form_row(famille.email) }}
  136.                                     </div>
  137.                                     <div class="col-md-6">
  138.                                         {{ form_row(famille.phone) }}
  139.                                     </div>
  140.                                     <div class="col-md-6">
  141.                                         {{ form_row(famille.type) }}
  142.                                     </div>
  143.                                     <div class="col-md-12">
  144.                                         <button type="button" class="btn btn-danger btnDeleteFamily">Suppresion d'un membre de la famille</button>
  145.                                     </div>
  146.                                 </div>
  147.                                 <hr>
  148.                             {% endfor %}
  149.                         </ul>
  150.                     </div>
  151.                     <div class="text-center col-md-12">
  152.                         <button type="button" class="btn btn-success btnAddFamily">Ajout d'un membre de la famille</button>
  153.                     </div>
  154.                 </div>
  155.                 <!-- contract -->
  156. {#                <div class="tab-pane" id="prestations">#}
  157. {#                    <ul class="contratList" style="list-style: none"#}
  158. {#                        data-prototype="{% apply escape %}{% include 'client/contractPrototype.html.twig' with {'form': form.contract.vars.prototype} %}{% endapply %}">#}
  159. {#                        {% for contract in form.contract %}#}
  160. {#                            Référence contrat : {{ contract.vars.data.id }}#}
  161. {#                            <div class="row contract-item">#}
  162. {#                                <div class="col-md-6">#}
  163. {#                                    {{ form_row(contract.dateDebutRelation) }}#}
  164. {#                                </div>#}
  165. {#                                <div class="col-md-6">#}
  166. {#                                    {{ form_row(contract.dateFinRelation) }}#}
  167. {#                                </div>#}
  168. {#                                <div class="col-md-6">#}
  169. {#                                    {{ form_row(contract.typeRDV) }}#}
  170. {#                                </div>#}
  171. {#                                #}{#<div class="col-md-6">#}
  172. {#                                    #}{#{{ form_row(contract.libellePrestation) }}#}
  173. {#                                #}{#</div>#}
  174. {#                                <div class="col-md-6">#}
  175. {#                                    {{ form_row(contract.recurrence) }}#}
  176. {#                                </div>#}
  177. {#                                <div class="col-md-6">#}
  178. {#                                    {{ form_row(contract.products) }}#}
  179. {#                                </div>#}
  180. {#                                <div class="col-md-6">#}
  181. {#                                    {{ form_row(contract.priorite) }}#}
  182. {#                                </div>#}
  183. {#                                <div class="col-md-6">#}
  184. {#                                    {{ form_row(contract.foumulaireReservation) }}#}
  185. {#                                </div>#}
  186. {#                                <div class="col-md-6">#}
  187. {#                                    {{ form_row(contract.heure) }}#}
  188. {#                                </div>#}
  189. {#                                <div class="col-md-6">#}
  190. {#                                    {{ form_row(contract.remarque   ) }}#}
  191. {#                                </div>#}
  192. {#                                <div class="col-md-12">#}
  193. {#                                    <button type="button" class="btn btn-danger btnDeleteContract">Suppresion du contrat</button>#}
  194. {#                                </div>#}
  195. {#                                <div class="col-md-12">#}
  196. {#                                    <hr>#}
  197. {#                                </div>#}
  198. {#                            </div>#}
  199. {#                        {% endfor %}#}
  200. {#                    </ul>#}
  201. {#                    <div class="text-center col-md-12">#}
  202. {#                        <button type="button" class="btn btn-success btnAddContrat">Ajout d'un contrat</button>#}
  203. {#                    </div>#}
  204. {#                </div>#}
  205.                 <div class="tab-pane" id="facturation">
  206.                     <div class="panel-heading">
  207.                        Gestion facturation
  208.                     </div>
  209.                     <div class="panel-body">
  210.                         <div class="col-md-6">
  211.                         {{ form_row(form.billingInfos.company) }}
  212.                         </div>
  213.                         <div class="col-md-6">
  214.                         {{ form_row(form.billingInfos.billingMode) }}
  215.                         </div>
  216.                         <div class="col-md-6">
  217.                         {{ form_row(form.billingInfos.email) }}
  218.                         </div>
  219.                         <div class="col-md-6">
  220.                         {{ form_row(form.billingInfos.phone) }}
  221.                         </div>
  222.                         <div class="col-md-6">
  223.                         {{ form_row(form.billingInfos.discount) }}
  224.                         </div>
  225.                         <div class="col-md-6">
  226.                         {{ form_row(form.billingInfos.sendMode) }}
  227.                         </div>
  228.                         <div class="col-md-6">
  229.                         {{ form_row(form.billingInfos.payMode) }}
  230.                         </div>
  231.                         <div class="col-md-6">
  232.                             {{ form_row(form.civiliteFacturation) }}
  233.                         </div>
  234.                         <div class="col-md-6">
  235.                             {{ form_row(form.nomFacturation) }}
  236.                         </div>
  237.                         <div class="col-md-6">
  238.                             {{ form_row(form.prenomFacturation) }}
  239.                         </div>
  240.                         <div class="col-md-6">
  241.                             {{ form_row(form.addressFacturation) }}
  242.                         </div>
  243.                         <div class="col-md-6">
  244.                             {{ form_row(form.ComplementAdresseFacturation) }}
  245.                         </div>
  246.                         <div class="col-md-6">
  247.                             {{ form_row(form.villeFacturation) }}
  248.                         </div>
  249.                         <div class="col-md-6">
  250.                             {{ form_row(form.codePostalFacturation) }}
  251.                         </div>
  252.                         <div class="col-md-6">
  253.                         {{ form_row(form.billingInfos.account) }}
  254.                         </div>
  255.                         <div class="col-md-6">
  256.                             {{ form_row(form.billingInfos.bankName) }}
  257.                         </div>
  258.                         <div class="col-md-6">
  259.                             {{ form_row(form.billingInfos.iban) }}
  260.                         </div>
  261.                         <div class="col-md-6">
  262.                             {{ form_row(form.billingInfos.bic) }}
  263.                         </div>
  264.                         <div class="col-md-6">
  265.                             {{ form_row(form.billingInfos.rum) }}
  266.                         </div>
  267.                         <div class="col-md-6">
  268.                             {{ form_row(form.billingInfos.dateSignatureMandat) }}
  269.                         </div>
  270.                    </div>
  271.                 </div>
  272.                 <div class="tab-pane {{ isBilling is defined and isBilling ? 'active' : '' }}" id="factures">
  273.                     <div class="panel panel-default">
  274.                         <div class="panel-heading">
  275.                             Factures
  276.                         </div>
  277.                         {% if factures is defined %}
  278.                             <div class="row">
  279.                                 {{ form_start(formFilter) }}
  280.                                 <div class="col-md-2">
  281.                                     {{ form_row(formFilter.status) }}
  282.                                 </div>
  283.                                 <div class="col-md-2">
  284.                                     {{ form_row(formFilter.dateDebut) }}
  285.                                 </div>
  286.                                 <div class="col-md-2">
  287.                                     {{ form_row(formFilter.dateFin) }}
  288.                                 </div>
  289.                                 <div class="col-md-2"  style="padding-top: 23px;">
  290.                                     <button type="submit" class="btn btn-success">Filtrer</button>
  291.                                 </div>
  292.                                 {{ form_end(formFilter) }}
  293.                                 <div  class="col-md-2"  style="padding-top: 23px;">
  294.                                     <button class="btn btn-success" id="envoiFacture">Envoi factures</button>
  295.                                 </div>
  296.                             </div>
  297.                         {% endif %}
  298.                         <div class="panel-body">
  299.                                 <table class="table table-hover">
  300.                                     <thead>
  301.                                     <th style="padding: 20px"><input type="checkbox" class="checkAll" id="checkAllFactures" /></th>
  302.                                     <th style="padding: 20px">Référence</th>
  303.                                     <th  style="padding: 20px">Statut</th>
  304.                                     <th  style="padding: 20px">Date</th>
  305.                                     <th style="padding: 20px">TTC</th>
  306.                                     <th style="padding: 20px">Solde</th>
  307.                                     <th style="padding: 20px">Lien paiement paytweak</th>
  308.                                     <th style="padding: 20px">Societé facturante</th>
  309.                                     <th style="padding: 20px">Réglement</th>
  310.                                     </thead>
  311.                                     {% if factures is defined %}
  312.                                         {% for facture in factures %}
  313.                                         <tr>
  314.                                             <td>
  315.                                                 <input type="checkbox" class="calcul" data-billing="{{ facture.id }}" data-ttc="{{ facture.ttc }}" data-solde="{% if facture.solde %}{{ facture.solde }}{% else %}0{% endif %}" />
  316.                                             </td>
  317.                                             <td>
  318.                                                 <a href="{{ path('billing_edit', {id : facture.id}) }}">{{ facture.code }}</a>
  319.                                             </td>
  320.                                             <td>
  321.                                                 {{ facture.status }}
  322.                                             </td>
  323.                                             <td>
  324.                                                 {{ facture.dateBilling|date('d/m/Y') }}
  325.                                             </td>
  326.                                             <td style="text-align: right">
  327.                                                 {{ facture.ttc|number_format(2, '.', ',') }}
  328.                                             </td>
  329.                                             <td style="text-align: right">
  330.                                                 {{ facture.solde|number_format(2, '.', ',') }}
  331.                                             </td>
  332.                                             <td>
  333.                                                 {% if facture.linkPaytweak %}
  334.                                                     {% if facture.company.id == 2 %}
  335.                                                             <a href="https://silver-beaute.link/{{ facture.linkPaytweak }}">https://silver-beaute.link/{{ facture.linkPaytweak }}</a>
  336.                                                     {% else %}
  337.                                                         <a href="https://paytweak.link/{{ facture.linkPaytweak }}">https://silver-beaute.link/{{ facture.linkPaytweak }}</a>
  338.                                                     {% endif %}
  339.                                                 {% endif %}
  340.                                             </td>
  341.                                             <td>
  342.                                                 {{ facture.company ? facture.company.name : ''}}
  343.                                             </td>
  344.                                             <td>
  345.                                                 <a {% if facture.reglement and facture.reglement.status == 'Annulé' %} style="color:red;text-decoration:line-through;"{% endif %} href="{{ facture.reglement ? path('reglement_edit', {'id': facture.reglement.id}) : '#' }}">
  346.                                                     {{ facture.reglement ? facture.reglement.id : ''}}
  347.                                                 </a>
  348.                                             </td>
  349.                                         </tr>
  350.                                         {% endfor %}
  351.                                     {% endif %}
  352.                                 </table>
  353.                             <div>
  354.                                 <div><b>Total TTC:</b> <span class="calcul-total"></span></div>
  355.                                 <div><b>Total Solde:</b> <span class="calcul-solde"></span></div>
  356.                             </div>
  357.                         </div>
  358.                     </div>
  359.                 </div>
  360.                 <div class="tab-pane {{ isReg is defined and isReg ? 'active' : '' }}" id="reglements">
  361.                     <div class="panel panel-default">
  362.                     <div class="panel-heading">
  363.                        Réglements
  364.                     </div>
  365.                     {% if reglements is defined %}
  366.                         <div class="row">
  367.                             {{ form_start(formFilterReglement) }}
  368.                             <div class="col-md-2">
  369.                                 {{ form_row(formFilterReglement.statut) }}
  370.                             </div>
  371.                             <div class="col-md-2">
  372.                                 {{ form_row(formFilterReglement.mode) }}
  373.                             </div>
  374.                             <div class="col-md-2">
  375.                                 {{ form_row(formFilterReglement.date) }}
  376.                             </div>
  377.                             <div class="col-md-2">
  378.                                 {{ form_row(formFilterReglement.dateEnd) }}
  379.                             </div>
  380.                             <div class="col-md-2">
  381.                                 {{ form_row(formFilterReglement.billing) }}
  382.                             </div>
  383.                             <div class="col-md-2">
  384.                                 {{ form_row(formFilterReglement.reference) }}
  385.                             </div>
  386.                             <div class="col-md-2">
  387.                                 {{ form_row(formFilterReglement.ttc) }}
  388.                             </div>
  389.                             <div class="col-md-2"  style="padding-top: 23px;">
  390.                                 <button type="submit" class="btn btn-success">Filtrer</button>
  391.                             </div>
  392.                             {{ form_end(formFilterReglement) }}
  393.                         </div>
  394.                     {% endif %}
  395.                     <div class="panel-body">
  396.                             <table class="table table-hover">
  397.                                 <thead>
  398.                                 <th style="padding: 20px"><input type="checkbox" id="checkAllReglements" class="checkAllReglement" /></th>
  399.                                     <th style="padding: 20px">N° règlement</th>
  400.                                     <th  style="padding: 20px">Date</th>
  401.                                     <th style="padding: 20px;text-align: right">Montant TTC</th>
  402.                                     <th style="padding: 20px">Mode de règlement</th>
  403.                                     <th style="padding: 20px">Référence</th>
  404.                                     <th style="padding: 20px">Statut</th>
  405.                                     <th style="padding: 20px">Numéro facture</th>
  406.                                     <th style="padding: 20px"></th>
  407.                                 </thead>
  408.                                 {% if reglements is defined %}
  409.                                     {% for reglement in reglements  %}
  410.                                         <tr>
  411.                                             <td>
  412.                                                 <input type="checkbox" class="calculReglement" data-ttc="{{ reglement.ttc }}"  />
  413.                                             </td>
  414.                                             <td>
  415.                                                 <a href="{{ path('reglement_edit', {id : reglement.id}) }}">{{ reglement.id }}</a>
  416.                                             </td>
  417.                                             <td>
  418.                                                 {{ reglement.date|date('d/m/Y') }}
  419.                                             </td>
  420.                                             <td>
  421.                                                 {{ reglement.ttc|number_format(2, '.', ',') }}
  422.                                             </td>
  423.                                             <td>
  424.                                                 {{ reglement.mode }}
  425.                                             </td>
  426.                                             <td>
  427.                                                 {{ reglement.reference }}
  428.                                             </td>
  429.                                             <td>
  430.                                                 {{ reglement.status }} ({{ reglement.motifCancel }})
  431.                                             </td>
  432.                                             <td>
  433.                                                 {%for billing in reglement.billings%}{{ billing.code }}, {%endfor%}
  434.                                             </td>
  435.                                             <td>
  436.                                                 <a href="{{ path('reglement_edit', {'id': reglement.id}) }}" target="_blank">Edition</a>
  437.                                             </td>
  438.                                         </tr>
  439.                                     {% endfor %}
  440.                                     {% else %}
  441.                                         {% for reglement in client.reglements  %}
  442.                                             <tr>
  443.                                                 <td>
  444.                                                     <input type="checkbox" class="calculReglement" data-ttc="{{ reglement.ttc }}"  />
  445.                                                 </td>
  446.                                                 <td>
  447.                                                     <a href="{{ path('reglement_edit', {id : reglement.id}) }}">{{ reglement.id }}</a>
  448.                                                 </td>
  449.                                                 <td>
  450.                                                     {{ reglement.date|date('d/m/Y') }}
  451.                                                 </td>
  452.                                                 <td>
  453.                                                     {{ reglement.ttc|number_format(2, '.', ',') }}
  454.                                                 </td>
  455.                                                 <td>
  456.                                                     {{ reglement.mode }}
  457.                                                 </td>
  458.                                                 <td>
  459.                                                     {{ reglement.reference }}
  460.                                                 </td>
  461.                                                 <td>
  462.                                                     {{ reglement.status }} ({{ reglement.motifCancel }})
  463.                                                 </td>
  464.                                                 <td>
  465.                                                     {%for billing in reglement.billings%}{{ billing.code }}, {%endfor%}
  466.                                                 </td>
  467.                                                 <td>
  468.                                                     <a href="{{ path('reglement_edit', {'id': reglement.id}) }}" target="_blank">Edition</a>
  469.                                                 </td>
  470.                                             </tr>
  471.                                         {% endfor %}
  472.                                     {% endif %}
  473.                             </table>
  474.                         <div>
  475.                             <div><b>Total TTC:</b> <span class="calcul-total-reglement"></span></div>
  476. {#                            <div><b>Total Solde:</b> <span class="solde-total-reglement"></span></div>#}
  477.                         </div>
  478.                     </div>
  479.                 </div>
  480.                 <!--recurrence -->
  481. {#                <div class="tab-pane" id="recurrence">#}
  482. {#                    <div class="panel panel-default">#}
  483. {#                        <div class="panel-heading">#}
  484. {#                            Récurrence#}
  485. {#                        </div>#}
  486. {#                    </div>#}
  487. {#                </div>#}
  488.                 </div>
  489.             </div>
  490.         </div>
  491.     <div class="row" style="margin-top:20px;">
  492.             <div class="col-md-12">
  493.                 <button class="btn btn-success btn-block btn-valid" type="submit">
  494.                     Validation <i class="fa fa-arrow-circle-right"></i>
  495.                 </button>
  496.             </div>
  497.     </div>
  498. {{ form_end(form) }}
  499.     </div>
  500. <script type="text/javascript">
  501.     document.addEventListener('DOMContentLoaded', function () {
  502.         var validationButton = document.querySelector('.btn-valid');
  503.         validationButton.addEventListener('click', function (event) {
  504.             event.preventDefault();
  505.             {% if isContact is defined and isContact %}
  506.                 var userConfirmation = confirm('Voulez-vous modifier les infos dans la gestion de facturation ?');
  507.                 if (userConfirmation) {
  508.                     var form = document.getElementById('form_client');
  509.                     form.submit();
  510.                 }
  511.             {% else %}
  512.                 var form = document.getElementById('form_client');
  513.                 form.submit();
  514.             {% endif %}
  515.         });
  516.     });
  517.     var checkboxes = document.querySelectorAll('.calcul');
  518.     checkboxes.forEach(function (checkbox) {
  519.         checkbox.addEventListener('change', calculateTotal);
  520.     });
  521.     var checkboxesReglement = document.querySelectorAll('.calculReglement');
  522.     checkboxesReglement.forEach(function (checkbox) {
  523.         checkbox.addEventListener('change', calculateTotalReglement);
  524.     });
  525.     var checkAllFactures = document.getElementById('checkAllFactures');
  526.     checkAllFactures.addEventListener('change', function () {
  527.         checkboxes.forEach(function (checkbox) {
  528.             checkbox.checked = checkAllFactures.checked;
  529.         });
  530.         calculateTotal();
  531.     });
  532.     var checkAllReglements = document.getElementById('checkAllReglements');
  533.     checkAllReglements.addEventListener('change', function () {
  534.         checkboxesReglement.forEach(function (checkbox) {
  535.             checkbox.checked = checkAllReglements.checked;
  536.         });
  537.         calculateTotalReglement();
  538.     });
  539.     function isNumber(value) {
  540.         return typeof value === 'number';
  541.     }
  542.     function calculateTotal() {
  543.         var total = 0;
  544.         var solde = 0;
  545.         checkboxes.forEach(function (checkbox) {
  546.             console.log( checkbox.getAttribute('data-solde'));
  547.             var soldeGet = checkbox.getAttribute('data-solde');
  548.             if(soldeGet ==''){
  549.                 soldeGet = 0;
  550.             }
  551.             if(soldeGet == undefined){
  552.                 soldeGet = 0;
  553.             }
  554.             if (checkbox.checked) {
  555.                 total += parseFloat(!isNaN(checkbox.getAttribute('data-ttc')) ? checkbox.getAttribute('data-ttc') : 0) || 0;
  556.                 solde += parseFloat(soldeGet)|| 0;
  557.             }
  558.         });
  559.         document.querySelector('.calcul-total').textContent = total.toFixed(2);
  560.         document.querySelector('.calcul-solde').textContent = solde.toFixed(2);
  561.     }
  562.     function calculateTotalReglement() {
  563.         var total = 0;
  564.         var solde = 0;
  565.         checkboxesReglement.forEach(function (checkbox) {
  566.             if (checkbox.checked) {
  567.                 total += parseFloat(checkbox.getAttribute('data-ttc'))|| 0;
  568.                 solde += parseFloat(checkbox.getAttribute('data-solde'))|| 0;
  569.             }
  570.         });
  571.         document.querySelector('.calcul-total-reglement').textContent = total.toFixed(2);
  572.         //document.querySelector('.calcul-solde-reglement').textContent = solde.toFixed(2);
  573.     }
  574. </script>