apa: allow columns selection in apa-droits table (#36297)

To enable this feature, add a "columns" parameter in
JSON_CELL_TYPES['apa-droits'] configuration, like this:

    "apa-droits" : {
       ...
       "form": [
         {
           "varname": "solis",
           "label": "Slug du connecteur Solis",
           "required": false
         },
         {
           "varname": "columns",
           "label": "Colonnes (ex: periode prestation quantite montant participation mode versement destinataire)",
           "required": false
         }
       ],
       ...
This commit is contained in:
Thomas NOËL 2019-09-23 23:34:44 +02:00
parent bb65a9411f
commit c973949d8e
1 changed files with 34 additions and 18 deletions

View File

@ -80,29 +80,45 @@
<table class="pk-data-table pk-table-headers pk-table-zebra">
<thead>
<tr>
<th>Période</th>
<th>Prestation</th>
<th>Quantité</th>
<th>Montant accordé</th>
<th>Participation du bénéficiaire</th>
<th>Versement</th>
<th>Destinataire du paiement</th>
{% for column in columns|default:"periode prestation quantite montant participation versement destinataire"|split %}
{% if column == "periode" %}<th>Période</th>
{% elif column == "prestation" %}<th>Prestation</th>
{% elif column == "quantite" %}<th>Quantité</th>
{% elif column == "montant" %}<th>Montant accordé</th>
{% elif column == "participation" %}<th>Participation du bénéficiaire</th>
{% elif column == "versement" %}<th>Versement</th>
{% elif column == "mode" %}<th>Mode de règlement</th>
{% elif column == "destinataire" %}<th>Destinataire du paiement</th>
{% endif %}
{% endfor %}
</tr>
</thead>
<tbody>
{% for presta in dossier.prestationAccordeeAsg %}
<tr>
  <td>
{% if presta.periode.dateEffet %}{% if presta.periode.dateFin %}du {%endif %}{{ presta.periode.dateEffet|parse_date|date:"j/n/Y" }}{% endif %}
{% if presta.periode.dateFin %}{% if not presta.periode.dateEffet %}jusqu'{% endif %}au {{ presta.periode.dateFin|parse_date|date:"j/n/Y" }}{% endif %}
</td>
  <td nowrap>{{ presta.prestation }}</td>
  <td>{{ presta.quantite|default:"non renseigné" }}</td>
  <td>{{ presta.montant.accorde|default:"0"|floatformat:2 }} €</td>
  <td>{{ presta.montant.participation|default:"0"|floatformat:2 }} €</td>
  <td>{{ presta.montant.verse|default:"0"|floatformat:2 }} €</td>
  <td>{{ presta.attributaire.identite|default:"non renseigné" }}
{% if presta.attributaire.type %}({{ presta.attributaire.type }}){% endif %}</td>
{% for column in columns|default:"periode prestation quantite montant participation versement destinataire"|split %}
{% if column == "periode" %}
<td>
{% if presta.periode.dateEffet %}{% if presta.periode.dateFin %}du {%endif %}{{ presta.periode.dateEffet|parse_date|date:"j/n/Y" }}{% endif %}
{% if presta.periode.dateFin %}{% if not presta.periode.dateEffet %}jusqu'{% endif %}au {{ presta.periode.dateFin|parse_date|date:"j/n/Y" }}{% endif %}
</td>
{% elif column == "prestation" %}
<td nowrap>{{ presta.prestation }}{% if presta.tiers.type %}<br/>({{ presta.tiers.type }}){% endif %}</td>
{% elif column == "quantite" %}
<td>{{ presta.quantite|default:"non renseigné" }}</td>
{% elif column == "montant" %}
<td>{{ presta.montant.accorde|default:"0"|floatformat:2 }} €</td>
{% elif column == "participation" %}
<td>{{ presta.montant.participation|default:"0"|floatformat:2 }} €</td>
{% elif column == "versement" %}
<td>{{ presta.montant.verse|default:"0"|floatformat:2 }} €</td>
{% elif column == "mode" %}
<td>{{ presta.attributaire.tiersComptable.modeReglement|default:"non renseigné" }}</td>
{% elif column == "destinataire" %}
<td>{{ presta.attributaire.identite|default:"non renseigné" }}
{% if presta.attributaire.type %}({{ presta.attributaire.type }}){% endif %}</td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</tbody>