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

@ -22,8 +22,7 @@
<label for="radio_versements_personne">
<div class="explications">
<h5>
Tous les versements des membres font l'objet d'un reçu, sans
tenir compte des activités et tarifs
Tous les versements des membres font l'objet d'un reçu, quels que soient les activités, tarifs et les comptes du plan comptable
</h5>
<p>Choisissez cette option si vous voulez sélectionner les versements d'une, plusieurs
ou toutes les personnes</p>
@ -31,6 +30,24 @@
</label>
</dd>
<dd class="radio-btn">
<input type="radio" id="radio_versements_personne_compte" name="choix_versements" value="personne_compte"
onclick="choixMethodeGeneration(this.form, 'personne', '.tous', '.activites');" />
<label for="radio_versements_personne_compte">
<div class="explications">
<h5>
Seuls les versements sur certains comptes du plan comptable font l'objet d'un reçu
</h5>
<p>Choisissez cette option si vous voulez sélectionner :</p>
<ul>
<li>certains comptes du plan comptable</li>
<li>certains versements de certaines personnes</li>
</ul>
</div>
</label>
</dd>
<dd class="radio-btn">
<dd class="radio-btn">
<input type="radio" id="radio_versements_activites" name="choix_versements"
value="activite" onclick="choixMethodeGeneration(this.form, 'activite', '.activites', '.tous');" />

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>

View file

@ -17,33 +17,35 @@
<form method="post" id="versements_personnes" action="generer_recus.php?type=personne">
{* Itération sur les personnes *}
<?php $rang = 0; ?>
{foreach from=$lesVersements key="num" item="versement"}
{foreach from=$lesVersements key="rang" item="versement"}
{if $rang == 0}
{* 1ère personne *}
<?php
$personneCourante = $versement->idUser;
$pair = true;
$personneCourante = $versement->idUser;
$compteCourant = $versement->compte;
?>
{afficher_debut_personne user=$personneCourante idVersement=$personneCourante}
{afficher_versement versement=$versement idVersement=$personneCourante num=$num rang=$rang}
{elseif $versement.idUser != $personneCourante}
{* changement de personne *}
<?php $rang = 0; ?>
</fieldset>
</details>
{fin_personne}
<?php
$personneCourante = $versement->idUser;
$pair = true;
$personneCourante = $versement->idUser;
$compteCourant = $versement->compte;
?>
{afficher_debut_personne user=$personneCourante idVersement=$personneCourante}
{afficher_versement versement=$versement idVersement=$personneCourante num=$num rang=$rang}
{elseif $versement.compte != $compteCourant}
{* même personne mais changement de compte *}
<?php $compteCourant = $versement->compte; ?>
<hr />
{else}
{* même personne *}
{afficher_versement versement=$versement idVersement=$personneCourante num=$num rang=$rang}
{* même personne, même compte *}
{/if}
<?php ++$rang; ?>
{afficher_versement versement=$versement idVersement=$personneCourante rang=$rang pair=$pair}
<?php $pair = ! $pair; ?>
{/foreach} {* Itération sur les personnes *}
</fieldset>
</details>
{fin_personne}
<input type="submit" value="Générer les reçus" onclick="return verifierChoix(this.form)" />
</form>