templates/adherent/show.html.twig line 1

Open in your IDE?
  1. {% extends "Global/layout.html.twig" %}
  2. {% block title %}Adherent show{% endblock %}
  3. {% set pageTitle = 'Adherent: '~adherent.nom~' '~adherent.prenom %}
  4. {% block navigation %}
  5.     {% set navigation = [{'current': pageTitle}] %}
  6.     {% include 'Global/navigation.html.twig' with {navigation: navigation} %}
  7. {% endblock %}
  8. {% block content %}
  9.     {% for label, messages in app.flashes %}
  10.         {% for message in messages %}
  11.             <div class="flash-{{ label }}">
  12.                 {{ message }}
  13.             </div>
  14.         {% endfor %}
  15.     {% endfor %}
  16.     <div class="card">
  17.         <header class="card-header">
  18.             <div class="card-actions">
  19.                 <a href="#" class="card-action card-action-toggle" data-card-toggle=""></a>
  20.                 <a href="#" class="card-action card-action-dismiss" data-card-dismiss=""></a>
  21.             </div>
  22.             {% if is_granted('ROLE_ADMIN') %}
  23.                 <a class="btn btn-primary" href="{{ path('app_adherent_edit', {'id': adherent.id}) }}">Modifier</a>
  24.             {% endif %}
  25.         </header>
  26.         <div class="card-body" >
  27.             <table class="table table-striped">
  28.                 <tbody>
  29.                     <tr>
  30.                         <th>Id</th>
  31.                         <td>{{ adherent.id }}</td>
  32.                     </tr>
  33.                     <tr>
  34.                         <th>Nom</th>
  35.                         <td>{{ adherent.nom }}</td>
  36.                     </tr>
  37.                     <tr>
  38.                         <th>Prenom</th>
  39.                         <td>{{ adherent.prenom }}</td>
  40.                     </tr>
  41.                     <tr>
  42.                         <th>NumeroAdhesion</th>
  43.                         <td>{{ adherent.numeroAdhesion }}</td>
  44.                     </tr>
  45.                     <tr>
  46.                         <th>Email</th>
  47.                         <td>{{ adherent.email }}</td>
  48.                     </tr>
  49.                     <tr>
  50.                         <th>RIB</th>
  51.                         <td>{{ adherent.rip }}</td>
  52.                     </tr>
  53.                
  54.                     <tr>
  55.                         <th>Forfait télécom</th>
  56.                         <td>{{ adherent.forfaitTelecom }}</td>
  57.                     </tr>
  58.                     <tr>
  59.                         <th>Salaire brute</th>
  60.                         <td>{{ adherent.salaireBrute }}</td>
  61.                     </tr>
  62.                      <tr>
  63.                         <th>Plafond Restant</th>
  64.                             <td>{{ services.getPlafand({'id':adherent.id})|number_format(2,'.','') }}</td>
  65.                     </tr>
  66.                 </tbody>
  67.             </table>
  68.         </div>
  69.         </br>
  70.         <section class="card mb-3">
  71.             <header class="card-header">
  72.                 <div class="card-actions">
  73.                     <a href="#" class="card-action card-action-toggle" data-card-toggle=""></a>
  74.                     <a href="#" class="card-action card-action-dismiss" data-card-dismiss=""></a>
  75.                 </div>
  76.                 <h2 class="card-title">Somme des prestations par type</h2>
  77.                 <div class="card-body">
  78.                     <table class="table table-striped" id="type">
  79.                         <thead>
  80.                             <tr>
  81.                                 <th>Type Prestation</th>
  82.                                 <th>Montant des prestations</th>
  83.                                 <th>Montant payé par l'adherent</th>
  84.                                 <th>montant pris en charge par l'amicale </th>
  85.                                     {# <th>Taux</th>#}
  86.                             </tr>
  87.                         </thead>
  88.                         <tbody>
  89.                             {% for p in type %}
  90.                                 <tr>
  91.                                     <th>{{ p['lib'] }}</th>
  92.                                     <td>{{ p['valeurTotal'] }}</td>
  93.                                     <td>{{  p['valeurAgeherent'] }}</td>
  94.                                     <td>{{ p['valeurPayerCga'] }}</td>
  95.                                     {#                                    <td>{{ (p['valeurPayerCga']/ p['valeurTotal'])|format_number(style='percent')  }}</td>#}
  96.                                 </tr>
  97.                             {% endfor %}
  98.                     </table>
  99.                 </div>
  100.         </section> 
  101.         </br>
  102.         <section class="card mb-3">
  103.             <header class="card-header">
  104.                 <div class="card-actions">
  105.                     <a href="#" class="card-action card-action-toggle" data-card-toggle=""></a>
  106.                     <a href="#" class="card-action card-action-dismiss" data-card-dismiss=""></a>
  107.                 </div>     <h2 class="card-title">Liste des prestations</h2>
  108.                 <a class="btn btn-primary btn-icon-split btn-sm no-print"" href="{{ path('app_prestation_new',{'id': adherent.id,'type' :'cc'}) }}">
  109.                     <span class="icon text-white-50">
  110.                         <i class="bx bx-plus"></i>
  111.                     </span>
  112.                     Ajouter une nouvelle prestation
  113.                 </a>                
  114.             </header>
  115.             <div class="card-body">
  116.                 <table class="table table-striped" id="prestations">
  117.                     <thead>
  118.                         <tr>
  119.                             <th>Id</th>
  120.                             <th>Adhérent</th>
  121.                             <th>Type Prestation</th>
  122.                             <th>Annee</th>
  123.                             <th>montant des prestations </th>
  124.                             <th>Amicale</th>
  125.                             <th>adhérent</th>
  126.                             <th>Etat</th>
  127.                             <th>Action</th>
  128.                         </tr>
  129.                     </thead>
  130.                     <tbody>
  131.                         {% for prestation in adherent.typePrestation %}
  132.                             {% if prestation.typePrestation.id !='7' %}
  133.                                 {% if is_granted('ROLE_ADMIN') %}
  134.                                 {% if  prestation.etat !='Bloquer' %}
  135.                                     <tr>
  136.                                         <td>{{ prestation.id }}</td>
  137.                                         <td>{{ prestation.adherent.nom }} {{ prestation.adherent.prenom }}</td>
  138.                                         <td>{{ prestation.typePrestation.lib }}</td>
  139.                                         <td>{{ prestation.anneeExercice.annee }}</td>
  140.                                         <td>{{ prestation.valeur }}</td>
  141.                                         <td>{{ prestation.valeurPayer }}</td>
  142.                                         <td>{{ prestation.valeur -prestation.valeurPayer }}</td>
  143.                                         <td>{{ prestation.etat }}</td>
  144.                                         <td>
  145.                                             <a class="btn btn-success" href="{{ path('app_prestation_edit_etat', {'id': prestation.id,'etat':'Valider'}) }}">Valider</a>
  146.                                             <a class="btn btn-dark" href="{{ path('app_prestation_edit_etat', {'id': prestation.id,'etat':'Payer'}) }}">Payer</a>
  147.                                             <a class="btn btn-danger" href="{{ path('app_prestation_edit_etat', {'id': prestation.id,'etat':'Bloquer'}) }}">Bloquer</a>
  148.                                             <a class="btn btn-warning" href="{{ path('app_prestation_edit_etat', {'id': prestation.id,'etat':'Cour'}) }}">Cour</a>
  149.                                             <a class="btn btn-primary" href="{{ path('app_prestation_edit', {'id': prestation.id}) }}">Modifier</a>
  150.                                             <a class="btn btn-dark" href="{{ path('app_prestation_show', {'id': prestation.id}) }}">Detail</a>
  151.                                         </td>
  152.                                     </tr>  {% endif %}
  153.                                 {% elseif prestation.anneeExercice.annee =='2024' %}
  154.                                     <tr>
  155.                                         <td>{{ prestation.id }}</td>
  156.                                         <td>{{ prestation.adherent.nom }} {{ prestation.adherent.prenom }}</td>
  157.                                         <td>{{ prestation.typePrestation.lib }}</td>
  158.                                         <td>{{ prestation.anneeExercice.annee }}</td>
  159.                                         <td>{{ prestation.valeur }}</td>
  160.                                         <td>{{ prestation.valeurPayer }}</td>
  161.                                         <td>{{ prestation.valeur -prestation.valeurPayer }}</td>
  162.                                         <td>{{ prestation.etat }}</td>
  163.                                         <td>
  164.                                             <a class="btn btn-danger" href="{{ path('app_prestation_edit_etat', {'id': prestation.id,'etat':'Bloquer'}) }}">Bloquer</a>
  165.                                         </td>
  166.                                     </tr>
  167.                                 {% endif %}
  168.                             {% endif %}
  169.                         {% endfor %}
  170.                     </tbody>
  171.                     <tfoot>
  172.                         <tr>
  173.                             <th colspan="8" style="text-align:right">Total:</th>
  174.                             <th></th>
  175.                         </tr>
  176.                     </tfoot>
  177.                 </table>
  178.             </div>
  179.         </section>
  180.         <section class="card mb-3">
  181.             <header class="card-header">
  182.                 <div class="card-actions">
  183.                     <a href="#" class="card-action card-action-toggle" data-card-toggle=""></a>
  184.                     <a href="#" class="card-action card-action-dismiss" data-card-dismiss=""></a>
  185.                 </div>
  186.                  <h2 class="card-title">Liste des enfants</h2>
  187.                 <a class="btn btn-primary btn-icon-split btn-sm no-print"" href="{{ path('app_enfant_new',{'idadr': adherent.id}) }}">
  188.                     <span class="icon text-white-50">
  189.                         <i class="bx bx-plus"></i>
  190.                     </span>
  191.                     Ajouter un enfant
  192.                 </a>                
  193.                 <div class="card-body">
  194.                     <table class="table table-striped" id="enfant">
  195.                         <thead>
  196.                             <tr>
  197.                                 <th>Id</th>
  198.                                 <th>Nom</th>
  199.                                 <th>Prenom</th>
  200.                                 <th>Date naissance</th>
  201.                                 <th>Classe</th>
  202.                                 <th>Action</th>
  203.                             </tr>
  204.                         </thead>
  205.                         <tbody>
  206.                             {% for en in adherent.enfants %}
  207.                                 <tr>
  208.                                     <td>{{ en.id }}</td>
  209.                                     <td>{{ en.nom }}</td>
  210.                                     <td>{{ en.prenom }}</td>
  211.                                     <td>{{ en.dateNaissance|date("Y-m-d")  }}</td>
  212.                                     {% if en.classEtude %}
  213.                                         <td>{{ en.classEtude.lib }}</td>
  214.                                     {% else %}
  215.                                         <td>-</td>
  216.                                     {% endif %}
  217.                                     <td><a class="btn btn-primary" href="{{ path('app_enfant_edit', {'id': en.id}) }}">Modifier</a>
  218.                                         <a class="btn btn-primary" href="{{ path('app_prestation_new', {'id': en.id,'type':'en'}) }}">Ajouter une prestation</a>
  219.                                 </tr>
  220.                             {% endfor %}
  221.                     </table>
  222.                 </div>
  223.         </section>             
  224.         <section class="card mb-3">
  225.             <header class="card-header">
  226.                 <div class="card-actions">
  227.                     <a href="#" class="card-action card-action-toggle" data-card-toggle=""></a>
  228.                     <a href="#" class="card-action card-action-dismiss" data-card-dismiss=""></a>
  229.                 </div> <h2 class="card-title">caractéristiques du véhicule</h2>
  230.                 {% if is_granted('ROLE_ADMIN') %}
  231.                     <a class="btn btn-primary btn-icon-split btn-sm no-print"" href="{{ path('app_vehicule_new',{'idadr': adherent.id}) }}">
  232.                         <span class="icon text-white-50">
  233.                             <i class="bx bx-plus"></i>
  234.                         </span>
  235.                         Ajouter un véhicule
  236.                     </a>                
  237.                 {% endif %}
  238.                 <div class="card-body">
  239.                     <table class="table table-striped" id="vehicule">
  240.                         <thead>
  241.                             <tr>
  242.                                 <th>Id</th>
  243.                                 <th>Immatriculation</th>
  244.                                 <th>Marque</th>
  245.                                 <th>Modele</th>
  246.                                 <th>Couleur</th>
  247.                                 <th>Action</th>
  248.                             </tr>
  249.                         </thead>
  250.                         <tbody>
  251.                             {% if adherent.vehicule %}
  252.                                 <tr>
  253.                                     <td>{{ adherent.vehicule.id }}</td>
  254.                                     <td>{{ adherent.vehicule.immatriculation }}</td>
  255.                                     <td>{{ adherent.vehicule.marque }}</td>
  256.                                     <td>{{ adherent.vehicule.modele  }}</td>
  257.                                     <td>{{ adherent.vehicule.couleur  }}</td>
  258.                                          {% if is_granted('ROLE_ADMIN') %}
  259.                                     <td><a class="btn btn-primary" href="{{ path('app_vehicule_edit', {'id': adherent.vehicule.id}) }}">Modifier</a></td>
  260.                                          {% else %} 
  261.                                              <td>-</td>
  262.                                          {% endif %}
  263.                                 </tr>
  264.                             {% endif %}
  265.                         </tbody>
  266.                     </table>
  267.                 </div>
  268.         </section>    
  269.     </div>
  270.     <section class="card">
  271.         <header class="card-header">
  272.             <div class="card-actions">
  273.                 <a href="#" class="card-action card-action-toggle" data-card-toggle></a>
  274.                 <a href="#" class="card-action card-action-dismiss" data-card-dismiss></a>
  275.             </div>
  276.             <h2 class="card-title">Liste des créances</h2>
  277.             {% if is_granted('ROLE_ADMIN') %}
  278.                     <a class="btn btn-primary btn-icon-split btn-sm no-print"" href="{{ path('app_rempoursement_dette_new',{'id': adherent.id}) }}">
  279.                         <span class="icon text-white-50">
  280.                             <i class="bx bx-plus"></i>
  281.                         </span>
  282.                         Ajouter un Rempoursement
  283.                     </a>                
  284.                 {% endif %}
  285.         </header>
  286.         <div class="card-body">
  287.             <table class="display" id="datatable-tabletools">
  288.                 <thead>
  289.                     <tr>
  290.                         <th>Id</th>
  291.                         <th>Date</th>
  292.                         <th>Facture</th>
  293.                         <th>Prestation</th>
  294.                         <th>Montant</th>
  295.                         <th>Valeur restante</th>
  296.                         <th>Etat</th>
  297.                     </tr>
  298.                 </thead>
  299.                 <tbody>
  300. {% for dette in adherent.dettes %}
  301.      <tr>
  302. <td>{{ dette.id }}</td>
  303.                             <td>{{ dette.date ? dette.date|date('Y-m-d') : '' }}</td>
  304.                             {% if dette.facture%}
  305.                                <td>{{ dette.facture.lib }}</td>
  306.                                {% else %}
  307.                                 <td>-</td>
  308.                                {% endif %}
  309.                             {% if dette.typePrestation%}
  310.                                <td>{{ dette.typePrestation.lib }}</td>
  311.                                {% else %}
  312.                                 <td>-</td>
  313.                                {% endif %}
  314.                                  <td>{{ dette.valeur }}</td>
  315.                             <td>{{ dette.valeurRestante }}</td>
  316.                              <td>{{ dette.etat }}</td>
  317.                              
  318.                              </tr>
  319. {% endfor %}
  320.                 </tbody>
  321.                 <tfoot>
  322.                     <tr>
  323.                         <th colspan="6" style="text-align:right">Total:</th>
  324.                         <th></th>
  325.                     </tr>
  326.                 </tfoot>
  327.             </table>
  328.         </div>
  329.     </section>
  330. {% endblock %}
  331. {% block script %}
  332.     <script>
  333.         function myFunction(id, etat) {
  334.             var url = "{{ path('app_prestation_edit_etat', {'id':'idPrestation','etat':'etatPrestation'}) }}";
  335.             url = url.replace("idPrestation", id);
  336.             url = url.replace("etatPrestation", etat);
  337.             $.ajax({
  338.                 url: url,
  339.             }).done(function () {
  340.                 // $('#prestations').DataTable().ajax.reload();
  341.             });
  342.         }
  343.         $(document).ready(function () {
  344.             $("#datatable-tabletools").DataTable({
  345.                 language: {
  346.                     url: '//cdn.datatables.net/plug-ins/1.13.7/i18n/fr-FR.json',
  347.                 },
  348.                 responsive: true,
  349.                 footerCallback: function (row, data, start, end, display) {
  350.                     let api = this.api();
  351.                     // Remove the formatting to get integer data for summation
  352.                     let intVal = function (i) {
  353.                         return typeof i === 'string'
  354.                                 ? i.replace(/[\$,]/g, '') * 1
  355.                                 : typeof i === 'number'
  356.                                 ? i
  357.                                 : 0;
  358.                     };
  359.                     // Total over all pages
  360.                     // Total over this page
  361.                     pageTotal = api
  362.                             .column(5, {page: 'current'})
  363.                             .data()
  364.                             .reduce((a, b) => intVal(a) + intVal(b), 0);
  365.                     // Update footer
  366.                     api.column(5).footer().innerHTML =
  367.                             'Total: $' + pageTotal;
  368.                 }
  369.             });
  370.             $("#vehicule").DataTable({
  371.                 language: {
  372.                     url: '//cdn.datatables.net/plug-ins/1.13.7/i18n/fr-FR.json',
  373.                 },
  374.                 responsive: true
  375.             });
  376.             $("#enfant").DataTable({
  377.                 language: {
  378.                     url: '//cdn.datatables.net/plug-ins/1.13.7/i18n/fr-FR.json',
  379.                 },
  380.                 responsive: true
  381.             });
  382.             $("#prestations").DataTable({
  383.                 language: {
  384.                     url: '//cdn.datatables.net/plug-ins/1.13.7/i18n/fr-FR.json',
  385.                 },
  386.                 responsive: true,
  387.                 footerCallback: function (row, data, start, end, display) {
  388.                     let api = this.api();
  389.                     // Remove the formatting to get integer data for summation
  390.                     let intVal = function (i) {
  391.                         return typeof i === 'string'
  392.                                 ? i.replace(/[\$,]/g, '') * 1
  393.                                 : typeof i === 'number'
  394.                                 ? i
  395.                                 : 0;
  396.                     };
  397.                     // Total over all pages
  398.                     // Total over this page
  399.                     pageTotal = api
  400.                             .column(5, {page: 'current'})
  401.                             .data()
  402.                             .reduce((a, b) => intVal(a) + intVal(b), 0);
  403.                     // Update footer
  404.                     api.column(5).footer().innerHTML =
  405.                             'Total: $' + pageTotal;
  406.                 }
  407.             });
  408.         });
  409.     </script>
  410. {% endblock %}