fusion branche dev

FossilOrigin-Name: a6a3f6587f6e2d271f439c11230a84a263b03383d2d9842472102dbd88fb2ac5
This commit is contained in:
engel 2022-05-21 08:02:48 +00:00
commit 3347ca7743
20 changed files with 924 additions and 599 deletions

View file

@ -6,7 +6,7 @@
<ul>
<li{if $current_nav == 'index'} class="current"{/if}><a href="{plugin_url}">Accueil</a></li>
<li{if $current_nav == 'personne'} class="current"{/if}><a href="{plugin_url file="action.php?action=personne"}">Versements par personne</a></li>
<li{if $current_nav == 'versements'} class="current"{/if}><a href="{plugin_url file="action.php?action=activite"}">Versements par activité et tarif</a></li>
<li{if $current_nav == 'activite'} class="current"{/if}><a href="{plugin_url file="action.php?action=activite"}">Versements par activité et tarif</a></li>
{if $session->canAccess($session::SECTION_ACCOUNTING, $session::ACCESS_WRITE)}
<li{if $current_nav == 'config'} class="current"{/if}><a href="{plugin_url file="config.php"}">Configuration</a></li>
{/if}

20
templates/choix_annee.tpl Normal file
View file

@ -0,0 +1,20 @@
{include file="admin/_head.tpl" title="Changer d'année fiscale"}
<form method="post" action="{$self_url}" data-focus="1">
<fieldset>
<legend>Changer l'année fiscale des reçus</legend>
<select id="annee_recu" name="annee_recu">
{foreach from=$anneesFiscales item="annee"}
<option value="{$annee}" {if $annee == $annee_recu} selected{/if}>{$annee}
</option>
{/foreach}
</select>
</fieldset>
<p class="submit">
{csrf_field key="acc_select_year"}
<input type="hidden" name="from" value="{$from}" />
{button type="submit" name="change" label="Changer" shape="right" class="main"}
</p>
</form>
{include file="admin/_foot.tpl"}

View file

@ -29,9 +29,9 @@
{input type="checkbox" name="articlesCGI[]" value=$key label=$article.titre}
*}
<div>
<input type="checkbox" name="articlesCGI[]" value="{$key}" class="choix"
<input type="checkbox" name="articlesCGI[]" id="article_{$key}" value="{$key}" class="choix"
{if $article.valeur == 1}checked{/if} />
<label>Article {$article.titre}</label>
<label for="article_{$key}">Article {$article.titre}</label>
</div>
{/foreach}
</dl>
@ -43,9 +43,9 @@
</dt>
{foreach from=$plugin_config->reduction key="key" item="taux"}
<div>
<input type="checkbox" name="tauxReduction[]" value="{$key}" class="choix"
<input type="checkbox" name="tauxReduction[]" id="taux_{$key}" value="{$key}" class="choix"
{if $taux.valeur == 1}checked{/if} />
<label>Taux {$taux.taux}, ligne {$taux.ligne} de la déclaration
<label for="taux_{$key}">Taux {$taux.taux}, ligne {$taux.ligne} de la déclaration
{if $taux.remarque !== ""}({$taux.remarque})</label>{/if}
</div>
{/foreach}
@ -92,10 +92,11 @@
<div>
{foreach from=$champsNom key="nom" item="champ"}
<div>
<input type="checkbox" name="champsNom[]" value={$nom} class="choix" {if $nbChamps == 1 || $champ.position != 0}checked{/if} />
<label>{$champ.titre}</label>
<div class="actions">
<div class="champnom">
<div class="actions"></div>
<div class="infos">
<input type="checkbox" name="champsNom[]" id="champ_{$nom}" value={$nom} class="choix" {if $nbChamps == 1 || $champ.position != 0}checked{/if} />
<label for="champ_{$nom}">{$champ.titre}</label>
</div>
</div>
{/foreach}

View file

@ -1,53 +1,42 @@
<!-- nav bar -->
{include file="%s/templates/_nav.tpl"|args:$plugin_root current_nav="index"}
<h2>Choisir l'année fiscale</h2>
<nav class="acc-year">
<h4>Année fiscale sélectionnée&nbsp;:</h4>
<h3>{$annee_recu}</h3>
<footer>{linkbutton label="Changer d'année fiscale" href="%s/choix_annee.php?from=%s"|args:PLUGIN_URL,rawurlencode($self_url) shape="settings"}</footer>
</nav>
<form id="formulaire_saisie" method="post" action="action.php">
<fieldset>
{* <legend>Choisir l'année fiscale</legend> *}
<select id="annee_recu" name="annee_recu">
{foreach from=$anneesFiscales item="annee"}
<option value="{$annee}" {if $annee == $anneeCourante - 1} selected{/if}>{$annee}
</option>
{/foreach}
</select>
</fieldset>
<div id="choix_methode">
<h2>Choisir une méthode de génération des reçus</h2>
<h3>Sélectionner les versements pour les reçus</h3>
<fieldset>
{* <legend>Choisir une des méthodes</legend> *}
<dl>
<dl id="menu">
<dd class="radio-btn">
<input type="radio" id="radio_versements_personne" name="choix_versements" value="personne"
onclick="choixMethodeGeneration(this.form, 'personne', '.tous', '.activites');" />
onclick="choixMethodeGeneration(this.form, 'personne', 'menu_versements', '.menu');" />
<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
Seuls les versements des personnes importent.
</h5>
<p>Choisissez cette option si vous voulez sélectionner les versements d'une, plusieurs
ou toutes les personnes</p>
<p class="help">Choisissez cette option si vous n'avez pas besoin des activités ni des tarifs</p>
</div>
</label>
</dd>
<dd class="radio-btn">
<input type="radio" id="radio_versements_activites" name="choix_versements"
value="activite" onclick="choixMethodeGeneration(this.form, 'activite', '.activites', '.tous');" />
<input type="radio" id="radio_versements_activites" name="choix_versements" value="activite"
onclick="choixMethodeGeneration(this.form, 'activite', 'menu_activites_tarifs', '.menu');" />
<label for="radio_versements_activites">
<div class="explications">
<h5>
Seuls les versements de certaines activités et tarifs font
l'objet d'un reçu
Certaines activités, certains tarifs ou certains comptes importent.
</h5>
<p>Choisissez cette option si vous voulez sélectionner :</p>
<ul>
<li>certaines activités ou certains tarifs</li>
<li>certains versements de certaines personnes</li>
</ul>
<p class="help">Choisissez cette option pour classer les versements par activités, tarifs et comptes</p>
</div>
</label>
</dd>
@ -55,109 +44,146 @@
</fieldset>
</div>
{* Toutes les personnes *}
<div id="div_taux_reduc" class="tous hidden">
<h2>Choisir le taux de réduction</h2>
{* Tous les versements *}
<div id="menu_versements" class="menu hidden">
<h3>Choisir le taux de réduction</h3>
<fieldset>
{if $nbTaux == 0}
<h3 class="warning">Vous devez d'abord sélectionner au moins un taux de réduction dans l'onglet de
configuration</h3>
<h3 class="warning">Vous devez d'abord sélectionner au moins un taux de réduction dans l'onglet de configuration</h3>
{/if}
{if $nbChamps == 0}
<h3 class="warning">Vous devez d'abord sélectionner au moins un champ pour le nom et le prénom dans l'onglet
de configuration</h3>
<h3 class="warning">Vous devez d'abord sélectionner au moins un champ pour le nom et le prénom dans l'onglet de configuration</h3>
{/if}
{if $nbTaux > 0 && $nbChamps > 0}
<ul class="reduction">
{foreach from=$plugin_config->reduction item="reduc"}
{if $reduc->valeur == 1}
<li>
<span class="radio-btn">
<input type="radio" id="{$reduc->taux}" name="taux_reduction" value="{$reduc->taux}"
{if $nbTaux == 1}checked{/if} />
<input
type="radio"
id="{$reduc->taux}"
name="taux_reduction"
value="{$reduc->taux}"
{if $nbTaux == 1}checked{/if}
/>
<label for="{$reduc->taux}">{$reduc->taux}{if $reduc->remarque != ""} - {$reduc->remarque}{/if}</label>
</span>
</li>
{/if}
{/foreach}
</ul>
{/if}
</fieldset>
</div>
<div id="generer_tous" class="tous hidden">
<p class=" submit">
<p class="submit">
{csrf_field key="generer_tous_recus"}
{button type="submit" name="generer_tous" label="Poursuivre" shape="right" class="main" onclick="return verifierRadio('div_taux_reduc');" }
{button type="submit" name="generer_tous" label="Poursuivre" shape="right" class="main" onclick="return verifierRadio('menu_versements');" }
</p>
</div>
{* Activités et tarifs *}
<div id="liste_activites_tarifs" class="activites hidden">
<h2>Choisir les activités et tarifs concernés par les reçus ainsi que le taux de réduction</h2>
{* Activités, tarifs et comptes *}
<div id="menu_activites_tarifs" class="menu hidden">
<h3>Choisir les activités, tarifs et comptes concernés ainsi que le taux de réduction</h3>
<fieldset>
{if $nbTaux == 0}
<h3 class="warning">Vous devez d'abord sélectionner au moins un taux de réduction dans l'onglet de
configuration</h3>
<h3 class="warning">Vous devez d'abord sélectionner au moins un taux de réduction dans l'onglet de configuration</h3>
{/if}
{if $nbChamps == 0}
<h3 class="warning">Vous devez d'abord sélectionner au moins un champ pour le nom et le prénom dans l'onglet
de configuration</h3 {/if} {if $nbTaux > 0 && $nbChamps > 0} <table class="list">
<thead>
<tr>
<th>Activité et Tarif</th>
<th>Cocher</th>
<th>Taux de réduction</th>
<th>Caractéristiques activité</th>
<th>N° et Compte</th>
</tr>
</thead>
<tbody>
{foreach from=$activitesTarifsComptes item="activite"}
<tr>
<td>
<span>{$activite.titreActivite} - {$activite.titreTarif}</span>
</td>
<td>
{if $nbTarifs == 1}
{input
type="checkbox"
name="tarifs[]"
value=$activite.idTarif
checked="checked"
}
{else}
{input
type="checkbox"
name="tarifs[]"
value=$activite.idTarif
}
{/if}
</td>
<td>
<h3 class="warning">Vous devez d'abord sélectionner au moins un champ pour le nom et le prénom dans l'onglet de configuration</h3>
{/if}
{if $nbTaux > 0 && $nbChamps > 0}
<ul id="liste_activites">
{foreach from=$activitesTarifsComptes item="elem"}
<li>
<?php
$tarif = $lesTarifs[$elem->idTarif];
$compte = $lesComptes[$elem->idCompte];
$activite = $lesActivites[$tarif->idActivite];
?>
<div class="activite">
{if $nbTarifs == 1}
{input
type="checkbox"
name="tarifs[]"
value="%s_%s"|args:$elem.idTarif,$elem.idCompte
label="Activité « %s » - tarif « %s » ;"|args:$activite.label,$tarif.label
checked="checked"
}
{else}
{input
type="checkbox"
name="tarifs[]"
value="%s_%s"|args:$elem.idTarif,$elem.idCompte
label="Activité « %s » - tarif « %s » ;"|args:$activite.label,$tarif.label
}
{/if}
<span>compte : {$elem.codeCompte} ({$compte->nomCompte})</span>
</div>
<ul class="reduction">
{foreach from=$plugin_config->reduction item="reduc"}
{if $reduc->valeur == 1}
<li>
<span class="radio-btn">
<input type="radio" id="taux_{$reduc->taux}_{$activite.idTarif}"
name="taux_reduction_{$activite.idTarif}" value="{$reduc->taux}"
{if $nbTarifs > 1}disabled{/if} {if $nbTaux == 1}checked{/if} />
<label
for="taux_{$reduc->taux}_{$activite.idTarif}">{$reduc->taux}{if $reduc->remarque != ""}
- {$reduc->remarque}{/if}</label>
<input
type="radio"
id="taux_{$reduc->taux}_{$elem.idTarif}_{$elem.idCompte}"
name="taux_reduction_{$elem.idTarif}_{$elem.idCompte}"
value="{$reduc->taux}"
{if $nbTarifs > 1}disabled{/if}
{if $nbTaux == 1}checked{/if}
/>
<label for="taux_{$reduc->taux}_{$elem.idTarif}_{$elem.idCompte}">
{$reduc->taux}{if $reduc->remarque != ""} - {$reduc->remarque}{/if}</label>
</span>
</li>
{/if}
{/foreach}
</td>
<td>{if $activite.descActivite != ""}{$activite.descActivite} ; {/if}{$activite.descTarif}</td>
<td>{$activite.numeroCpt} : {$activite.nomCpt}</td>
</tr>
</ul>
</li>
{/foreach}
</tbody>
</table>
{* comptes non rattachés à une activité *}
{foreach from=$comptesSansActivite item="idCompte"}
<li>
<div class="activite">
{input
type="checkbox"
name="comptes[]"
value="%s"|args:$idCompte
label="Versements non rattachés à une activité ;"
}
<?php $compte = $lesComptes[$idCompte]; ?>
<span>compte : {$compte.codeCompte} ({$compte.nomCompte})</span>
</div>
<ul class="reduction">
{foreach from=$plugin_config->reduction item="reduc"}
{if $reduc->valeur == 1}
<li>
<span class="radio-btn">
<input
type="radio"
id="taux_{$reduc->taux}_{$idCompte}"
name="taux_reduction_{$idCompte}"
value="{$reduc->taux}"
disabled
{if $nbTaux == 1}checked{/if}
/>
<label for="taux_{$reduc->taux}_{$idCompte}">
{$reduc->taux}{if $reduc->remarque != ""} - {$reduc->remarque}{/if}</label>
</span>
</li>
{/if}
{/foreach}
</ul>
</li>
{/foreach}
</ul>
{/if}
</fieldset>
</div>
<div id="generer_activites" class="activites hidden">
<p class=" submit">
<p class="submit">
{csrf_field key="generer_recus_activites"}
{button type="submit" name="generer_activites" label="Poursuivre" shape="right" class="main" onclick="return verifierCases('liste_activites_tarifs');" }
{button type="submit" name="generer_activites" label="Poursuivre" shape="right" class="main" onclick="return verifierCases('menu_activites_tarifs');" }
</p>
</div>
</form>
@ -169,8 +195,8 @@
for (var laCase of document.querySelectorAll("input[type=checkbox]")) {
laCase.addEventListener('change', (evt) => {
var idCase = evt.target;
// chercher la ligne englobante (<tr>)
var ligne = idCase.closest("tr");
// chercher la ligne englobante (<li>)
var ligne = idCase.closest("li");
// itérer sur les radio de cette ligne
var lesRadios = ligne.querySelectorAll('input[type=radio]');
for (var idRadio of lesRadios) {

View file

@ -117,7 +117,14 @@
{{if $libelle != ""}}
({{$libelle}})
{{/if}}
<br />date des versements :
{{if $dateMin == $dateMax}}
le {{$dateMin}}
{{else}}
du {{$dateMin}} au {{$dateMax}}
{{/if}}
</li>
<br />
{{/versements}}
</ul>

View file

@ -1,65 +1,78 @@
<!-- nav bar -->
{include file="%s/templates/_nav.tpl"|args:$plugin_root current_nav="versements"}
{include file="%s/templates/_nav.tpl"|args:$plugin_root current_nav="activite"}
<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->idCompte;
?>
{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;
{afficher_debut_compte idCompte=$compteCourant}
{elseif $versement.idTarif != $tarifCourant}
{* changement de tarif *}
{fin_compte}
{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->idCompte;
?>
{afficher_debut_tarif versement=$versement}
{afficher_debut_personne user=$personneCourante idVersement="%s_%s"|args:$tarifCourant,$personneCourante}
{afficher_debut_compte idCompte=$compteCourant}
{elseif $versement.idUser != $personneCourante}
{* changement de personne *}
{fin_compte}
{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->idCompte;
?>
{afficher_debut_personne user=$personneCourante idVersement="%s_%s"|args:$tarifCourant,$personneCourante}
{afficher_debut_compte idCompte=$compteCourant}
{elseif $versement.idCompte != $compteCourant}
{fin_compte}
{* changement de compte *}
<?php
$pair = true;
$compteCourant = $versement->idCompte;
?>
{afficher_debut_compte idCompte=$compteCourant}
{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_compte}
{fin_personne}
{fin_tarif}
<input type="submit" value="Générer les reçus" onclick="return verifierChoix(this.form)" />
</form>

View file

@ -14,36 +14,46 @@
onclick="return verifierChoix(this.form)" />
</fieldset>
<form method="post" id="versements_personnes" action="generer_recus.php?type=personne">
<form method="post" id="versements_personnes" class="" 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->idCompte;
?>
{afficher_debut_personne user=$personneCourante idVersement=$personneCourante}
{afficher_versement versement=$versement idVersement=$personneCourante num=$num rang=$rang}
{afficher_debut_compte idCompte=$compteCourant}
{elseif $versement.idUser != $personneCourante}
{* changement de personne *}
<?php $rang = 0; ?>
</fieldset>
</details>
{fin_compte}
{fin_personne}
<?php
$personneCourante = $versement->idUser;
$pair = true;
$personneCourante = $versement->idUser;
$compteCourant = $versement->idCompte;
?>
{afficher_debut_personne user=$personneCourante idVersement=$personneCourante}
{afficher_versement versement=$versement idVersement=$personneCourante num=$num rang=$rang}
{afficher_debut_compte idCompte=$compteCourant}
{elseif $versement.idCompte != $compteCourant}
{fin_compte}
{* changement de compte *}
<?php
$pair = true;
$compteCourant = $versement->idCompte;
?>
{afficher_debut_compte idCompte=$compteCourant}
{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_compte}
{fin_personne}
<input type="submit" value="Générer les reçus" onclick="return verifierChoix(this.form)" />
</form>