intégration comptes
FossilOrigin-Name: d81e13438cbc9ed585e76b36e2950615b8da359697f2c577673c77460b59064d
This commit is contained in:
parent
4958b88538
commit
68e6afed11
9 changed files with 609 additions and 421 deletions
|
|
@ -64,31 +64,43 @@ $tpl->register_function('afficher_debut_tarif', function ($params)
|
|||
{
|
||||
$versement = $params['versement'];
|
||||
$idTarif = $versement->idTarif;
|
||||
$tarif = $_SESSION['lesTarifs'][$idTarif];
|
||||
$idActivite = $tarif->idActivite;
|
||||
$activite = $_SESSION['lesActivites'][$idActivite];
|
||||
|
||||
|
||||
$out = sprintf('
|
||||
<details class="activite" open="open">
|
||||
<summary class="activite">
|
||||
<div class="activite">
|
||||
<input type="checkbox" id="check_%1$s"
|
||||
onclick="cocherDecocherTarif(check_%1$s)" />
|
||||
<label for="check_%1$s">
|
||||
<h3 class="activite">Activité « %2$s »</h3>',
|
||||
$idTarif,
|
||||
$activite->label);
|
||||
|
||||
if (!empty($activite->description)) {
|
||||
onclick="cocherDecocherTarif(check_%1$s)" />',
|
||||
$idTarif);
|
||||
if ($idTarif == 0) {
|
||||
// versement sur un compte non rattaché à une activité
|
||||
$out .= sprintf('
|
||||
<p class="activite">%s</p>', $activite->description);
|
||||
<label for="check_%s">
|
||||
<h3 class="activite">Versements non rattachés à une activité</h3>',
|
||||
$idTarif);
|
||||
}
|
||||
$out .= sprintf('
|
||||
else {
|
||||
$tarif = $_SESSION['lesTarifs'][$idTarif];
|
||||
$idActivite = $tarif->idActivite;
|
||||
$activite = $_SESSION['lesActivites'][$idActivite];
|
||||
|
||||
$out .= sprintf('
|
||||
<label for="check_%s">
|
||||
<h3 class="activite">Activité « %s »</h3>',
|
||||
$idTarif,
|
||||
$activite->label);
|
||||
|
||||
if (!empty($activite->description)) {
|
||||
$out .= sprintf('
|
||||
<p class="activite">%s</p>', $activite->description);
|
||||
}
|
||||
$out .= sprintf('
|
||||
<p class="activite">tarif « %s »', $tarif->label);
|
||||
if ($tarif->montant > 0) {
|
||||
$out .= sprintf(' montant : %.2f €</p>', $tarif->montant/100);
|
||||
} else {
|
||||
$out .= ' montant : libre</p>';
|
||||
if ($tarif->montant > 0) {
|
||||
$out .= sprintf(' montant : %.2f €</p>', $tarif->montant/100);
|
||||
} else {
|
||||
$out .= ' montant : libre</p>';
|
||||
}
|
||||
}
|
||||
$out .= '
|
||||
</label>
|
||||
|
|
@ -115,14 +127,25 @@ $tpl->register_function('afficher_debut_personne', function ($params)
|
|||
</label>
|
||||
</div>
|
||||
</summary>
|
||||
|
||||
<fieldset class="versements" id="versements_%1$s">',
|
||||
<div class="versements">',
|
||||
$idVersement,
|
||||
$personne->nomPrenom
|
||||
);
|
||||
return $out;
|
||||
});
|
||||
|
||||
// afficher infos compte
|
||||
$tpl->register_function('afficher_debut_compte', function ($params)
|
||||
{
|
||||
$idCompte = $params['idCompte'];
|
||||
$out = sprintf('
|
||||
<fieldset class="versements">
|
||||
<div><p>Compte N° %1$s : %2$s</p></div>',
|
||||
$_SESSION['comptes'][$idCompte]->codeCompte,
|
||||
$_SESSION['comptes'][$idCompte]->nomCompte);
|
||||
return $out;
|
||||
});
|
||||
|
||||
// afficher un versement
|
||||
$tpl->register_function('afficher_versement', function ($params)
|
||||
{
|
||||
|
|
@ -140,24 +163,34 @@ $tpl->register_function('afficher_versement', function ($params)
|
|||
name="selected[]"
|
||||
value="%2$s"
|
||||
onclick="cocherDecocherVersement(check_%1$s_%2$s, total_%1$s)" />
|
||||
<label for="check_%1$s_%2$s"><span class="montant">%3$.2f</span>
|
||||
<label for="check_%1$s_%2$s"><span class="montant">%3$s</span>
|
||||
<span>%4$s</span>
|
||||
<span>%5$s</span>
|
||||
</label>
|
||||
</div>',
|
||||
$idVersement,
|
||||
$rang,
|
||||
$versement->versement/100,
|
||||
date_format(date_create($versement->date),"d/m/Y"),
|
||||
$versement->compte
|
||||
number_format(
|
||||
$versement->versement/100,
|
||||
2,
|
||||
",",
|
||||
" "
|
||||
),
|
||||
date_format(date_create($versement->date),"d/m/Y")
|
||||
);
|
||||
return $out;
|
||||
});
|
||||
|
||||
$tpl->register_function('fin_personne', function ($params)
|
||||
$tpl->register_function('fin_compte', function ()
|
||||
{
|
||||
$out = '
|
||||
</fieldset>
|
||||
</fieldset>';
|
||||
return $out;
|
||||
});
|
||||
|
||||
$tpl->register_function('fin_personne', function ()
|
||||
{
|
||||
$out = '
|
||||
</div>
|
||||
</details>';
|
||||
return $out;
|
||||
});
|
||||
|
|
@ -175,6 +208,8 @@ $tpl->register_function('fin_tarif', function ($params)
|
|||
|
||||
if ($_GET['action'] == 'personne') {
|
||||
require('versements_personnes.php');
|
||||
} else {
|
||||
} else if ($_GET['action'] == 'compte') {
|
||||
require('versements_personnes.php');
|
||||
} else if ($_GET['action'] == 'activite') {
|
||||
require('versements_activites.php');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue