ajout case tarif ; réorganisation code

FossilOrigin-Name: 80c6f13938d5f02786155717bf1ab8b89c6ade3c58bba572bf8c471b54886666
This commit is contained in:
engel 2022-05-04 11:53:12 +00:00
parent 7ca41ea6b7
commit 6165ff531e
6 changed files with 177 additions and 126 deletions

View file

@ -4,62 +4,65 @@
<h2>Versements par activité et tarif</h2>
<fieldset class="noprint">
<input type="checkbox" class="check_global" id="check_global" onclick="cocherDecocherTout(check_global)" />
<label for="check_global">Cliquer pour cocher toutes les lignes</label>
<button type="button" data-icon="↑" class="icn-btn" id="close_details_activite" onclick="montrerMasquerDetails(this.id, 'details.activite', 'toutes les activités')">Replier toutes les activités</button>
<button type="button" data-icon="↑" class="icn-btn" id="close_details_personne" onclick="montrerMasquerDetails(this.id, 'details.personne', 'toutes les personnes')">Replier toutes les personnes</button>
<input type="submit" value="Générer les reçus" form="versements_activites" onclick="return verifierChoix(this.form)" />
<input type="checkbox" class="check_global" id="check_global" onclick="cocherDecocherTout(check_global)" />
<label for="check_global">Cliquer pour cocher toutes les lignes</label>
<button type="button" data-icon="↑" class="icn-btn" id="close_details_activite"
onclick="montrerMasquerDetails(this.id, 'details.activite', 'toutes les activités')">Replier toutes les
activités</button>
<button type="button" data-icon="↑" class="icn-btn" id="close_details_personne"
onclick="montrerMasquerDetails(this.id, 'details.personne', 'toutes les personnes')">Replier toutes les
personnes</button>
<input type="submit" value="Générer les reçus" form="versements_activites"
onclick="return verifierChoix(this.form)" />
</fieldset>
<form method="post" id="versements_activites" action="generer_recus.php?type=activite">
{* Itération sur les versements *}
<?php $rang = 0; ?>
{foreach from=$lesVersements key="num" item="versement"}
{foreach from=$lesVersements key="rang" item="versement"}
{if $rang == 0}
{* premier versement *}
<?php
$tarifCourant = $versement->idTarif;
$personneCourante = $versement->idUser;
$pair = true;
$tarifCourant = $versement->idTarif;
$personneCourante = $versement->idUser;
$compteCourant = $versement->compte;
?>
{afficher_debut_tarif versement=$versement}
{afficher_debut_personne user=$personneCourante idVersement="%s_%s"|args:$tarifCourant,$personneCourante}
{afficher_versement versement=$versement idVersement="%s_%s"|args:$tarifCourant,$personneCourante num=$num rang=$rang}
{else}
{* autre versement *}
{if $versement.idTarif != $tarifCourant}
{* changement de tarif *}
</fieldset> {* fin versements d'une personne *}
</details> {* fin versements d'une personne *}
</details> {* fin tarif *}
<?php
$rang=0;
{elseif $versement.idTarif != $tarifCourant}
{* changement de tarif *}
{fin_personne}
{fin_tarif}
<?php
$pair = true;
$tarifCourant = $versement->idTarif;
$personneCourante = $versement->idUser;
?>
{afficher_debut_tarif versement=$versement}
{afficher_debut_personne user=$personneCourante idVersement="%s_%s"|args:$tarifCourant,$personneCourante}
{afficher_versement versement=$versement idVersement="%s_%s"|args:$tarifCourant,$personneCourante num=$num rang=$rang}
{elseif $versement.idUser != $personneCourante}
{* changement de personne *}
<?php $rang = 0; ?>
</fieldset>
</details>
<?php
$compteCourant = $versement->compte;
?>
{afficher_debut_tarif versement=$versement}
{afficher_debut_personne user=$personneCourante idVersement="%s_%s"|args:$tarifCourant,$personneCourante}
{elseif $versement.idUser != $personneCourante}
{* changement de personne *}
{fin_personne}
<?php
$pair = true;
$personneCourante = $versement->idUser;
?>
{afficher_debut_personne user=$personneCourante idVersement="%s_%s"|args:$tarifCourant,$personneCourante}
{afficher_versement versement=$versement idVersement="%s_%s"|args:$tarifCourant,$personneCourante num=$num rang=$rang}
{else}
{* même personne *}
{afficher_versement versement=$versement idVersement="%s_%s"|args:$tarifCourant,$personneCourante num=$num rang=$rang}
{/if}
$compteCourant = $versement->compte;
?>
{afficher_debut_personne user=$personneCourante idVersement="%s_%s"|args:$tarifCourant,$personneCourante}
{elseif $versement.compte != $compteCourant}
{* même personne mais changement de compte *}
<?php $compteCourant = $versement->compte; ?>
<hr />
{else}
{* même personne, même compte *}
{/if}
<?php ++$rang; ?>
{/foreach} {* Itération sur les versements *}
</fieldset> {* fin versements d'une personne *}
</details> {* fin versements d'une personne *}
</details> {* fin tarif *}
{afficher_versement versement=$versement idVersement="%s_%s"|args:$tarifCourant,$personneCourante rang=$rang pair=$pair}
<?php $pair = ! $pair; ?>
{/foreach} {* Itération sur les versements *}
{fin_personne}
{fin_tarif}
<input type="submit" value="Générer les reçus" onclick="return verifierChoix(this.form)" />
</form>