Compare commits

..

No commits in common. "master" and "0.11" have entirely different histories.
master ... 0.11

11 changed files with 805 additions and 816 deletions

View file

@ -4,7 +4,7 @@ Plugin de reçus fiscaux pour le logiciel de gestion d'association [Paheko](http
## Installation
Télécharger la [version la plus récente](https://git.roflcopter.fr/lesanges/recusfiscaux/releases) au format tar.gz, supprimer le numéro de version du nom de l'archive et la copier dans le répertoire data/plugins de Paheko
**Attention :** les archives disponibles sur ce dépôt n'ont pas un format compatible avec Paheko et ne peuvent donc être utilisées telles quelles ; il faut soit les transformer pour les rendre compatibles, soit télécharger [cette archive](https://acloud8.zaclys.com/index.php/s/n9daWAND24T2W3e), et la copier dans le dossier plugins de Paheko.
## Fonctionnalités
- Créer des reçus fiscaux pour les dons des membres

View file

@ -16,14 +16,10 @@ $_GET['_dialog'] = true;
// signature
$signature =
(null !== $config->fileURL('signature')) ?
$config->fileURL('signature') :
((null !== $plugin->getConfig('signature')) ?
\KD2\HTTP::getScheme() . '://' . \KD2\HTTP::getHost() . WWW_URI . $plugin->getConfig('signature') :
"");
(null !== $plugin->getConfig('signature')) ?
\KD2\HTTP::getScheme() . '://' . \KD2\HTTP::getHost() . WWW_URI . "/" . $plugin->getConfig('signature') :
"";
// http://test.paheko.bzh/config/cavalier.png
error_log('signature = ' . $signature);
// logo
$config = Config::getInstance();
$logo_asso =
@ -115,8 +111,7 @@ function genererRecusPDF($totalPersonnes,
$numero_sequentiel = getNumSequentiel($configNum);
foreach ($totalPersonnes as $idPersonne => $personne) {
$tpl = new UserTemplate(null);
/* $tpl->setSource(PLUGIN_ROOT . '/templates/recu.skel'); */
$tpl->setSourcePath(PLUGIN_ROOT . '/templates/recu.skel');
$tpl->setSource(PLUGIN_ROOT . '/templates/recu.skel');
$tpl->assignArray(compact('signature', 'logo_asso', 'texteArticles'));
$tpl->assign('objet_asso', $plugin->getConfig('objet_asso'));

View file

@ -34,18 +34,5 @@ div.previs_recu
font-family: Serif;
font-size: 11pt;
background-color: white;
break-after: always;
}
/* supprimer saut de page après dernier */
div.previs_recu:last-of-type
{
font-family: Serif;
font-size: 11pt;
background-color: white;
break-after: avoid;
}
#__profiler {
display: none;
page-break-after: always;
}

View file

@ -95,9 +95,3 @@ span.titre, span.libelle
{
display : inline;
}
/* Ne pas imprimer le bandeau des boutons du profiler */
#__profiler
{
display: none;
}

View file

@ -22,7 +22,7 @@ class Utils
description,
amount as montant
FROM services_fees');
return $db->getGrouped($sql);
return Utils::toAssoc($db->get($sql), 'id');
}
/**
@ -37,7 +37,7 @@ class Utils
services.label,
services.description
FROM services');
return $db->getGrouped($sql);
return Utils::toAssoc($db->get($sql), 'id');
}
/**
@ -52,7 +52,6 @@ class Utils
$sql = sprintf(
'SELECT
acc_accounts.id,
acc_years.label,
acc_accounts.code as codeCompte,
acc_accounts.label as nomCompte
FROM acc_transactions_users
@ -64,19 +63,17 @@ class Utils
ON acc_transactions_lines.id_transaction = acc_transactions.id
INNER JOIN acc_accounts
ON acc_transactions_lines.id_account = acc_accounts.id
INNER JOIN acc_years
ON acc_transactions.id_year = acc_years.id
WHERE
(strftime("%%Y", acc_transactions.date) = "%d"
AND
acc_accounts.%s
)
GROUP by acc_accounts.id
GROUP by acc_accounts.code
ORDER by acc_accounts.code',
$annee,
$db->where('code', $op, $comptes)
);
return $db->getGrouped($sql);
return Utils::toAssoc($db->get($sql), 'id');
}
/**
@ -120,6 +117,32 @@ class Utils
return $db->get($sql);
}
/**
* faire un tableau associatif avec le résultat d'une requête
*/
static function toAssoc($array, $nomCle)
{
$assoc = array();
foreach ($array as $elem)
{
$ro = new \ReflectionObject($elem);
$proprietes = $ro->getProperties();
$obj = new \stdClass();
foreach ($proprietes as $p)
{
$pname = $p->getName();
if ($pname == $nomCle) {
$key = $p->getValue($elem);
}
else {
$obj->$pname = $p->getValue($elem);
}
}
$assoc[$key] = $obj;
}
return $assoc;
}
/**
* @return versements correspondants à l'année donnée
* @param $annee

View file

@ -5,8 +5,8 @@
<nav class="tabs">
<ul>
<li{if $current_nav == 'index'} class="current"{/if}><a href="{plugin_url}">Accueil</a></li>
{if $current_nav == 'personne'} <li class="current"><a>Versements par personne</a></li>{/if}
{if $current_nav == 'activite'} <li class="current"><a>Versements par activité et tarif</a></li>{/if}
<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 == '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}

View file

@ -14,7 +14,7 @@
<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', 'menu_versements', '.menu');" />
@ -118,8 +118,7 @@
label="Activité « %s » - tarif « %s » ;"|args:$activite.label,$tarif.label
}
{/if}
<span>compte : {$elem.codeCompte} - {$compte->nomCompte}</span>
<span> ({$compte.label})</span>
<span>compte : {$elem.codeCompte} ({$compte->nomCompte})</span>
</div>
<ul class="reduction">
{foreach from=$plugin_config->reduction item="reduc"}
@ -154,8 +153,7 @@
label="Versements non rattachés à une activité ;"
}
<?php $compte = $lesComptes[$idCompte]; ?>
<span>compte : {$compte.codeCompte} - {$compte.nomCompte}</span>
<span> ({$compte.label})</span>
<span>compte : {$compte.codeCompte} ({$compte.nomCompte})</span>
</div>
<ul class="reduction">
{foreach from=$plugin_config->reduction item="reduc"}

View file

@ -1,4 +1,4 @@
{include file="_head.tpl" title="%s"|args:$plugin.label current="plugin_%s"|args:$plugin.id}
{include file="_head.tpl" title="%s"|args:$plugin.name current="plugin_%s"|args:$plugin.id}
<?php
$fmt = new \NumberFormatter('fr_FR', \NumberFormatter::SPELLOUT);

View file

@ -34,7 +34,6 @@
$tarifCourant = $versement->idTarif;
$personneCourante = $versement->idUser;
$compteCourant = $versement->idCompte;
$codeCompte = $versement->codeCompte;
?>
{afficher_debut_tarif versement=$versement}
{afficher_debut_personne user=$personneCourante idVersement="%s_%s"|args:$tarifCourant,$personneCourante}
@ -49,7 +48,6 @@
$tarifCourant = $versement->idTarif;
$personneCourante = $versement->idUser;
$compteCourant = $versement->idCompte;
$codeCompte = $versement->codeCompte;
?>
{afficher_debut_tarif versement=$versement}
{afficher_debut_personne user=$personneCourante idVersement="%s_%s"|args:$tarifCourant,$personneCourante}
@ -62,17 +60,15 @@
$pair = true;
$personneCourante = $versement->idUser;
$compteCourant = $versement->idCompte;
$codeCompte = $versement->codeCompte;
?>
{afficher_debut_personne user=$personneCourante idVersement="%s_%s"|args:$tarifCourant,$personneCourante}
{afficher_debut_compte idCompte=$compteCourant}
{elseif $versement.codeCompte != $codeCompte}
{elseif $versement.idCompte != $compteCourant}
{fin_compte}
{* changement de compte *}
<?php
$pair = true;
$compteCourant = $versement->idCompte;
$codeCompte = $versement->codeCompte;
?>
{afficher_debut_compte idCompte=$compteCourant}
{else}

View file

@ -15,7 +15,7 @@
form="versements_personnes"
formaction="generer_recus.php?type=personne&format=pdf"
onclick="return verifierChoix(this.form)"}
{button type="submit" label="Imprimer les reçus" shape="print"
{button type="submit" target="_dialog" label="Imprimer les reçus" shape="print"
form="versements_personnes"
formaction="generer_recus.php?type=personne&format=print"
onclick="return verifierChoix(this.form)"}
@ -25,14 +25,12 @@
{* Itération sur les personnes *}
{foreach from=$lesVersements key="rang" item="versement"}
{if $rang == 0}
{* 1ère personne *}
<?php
$pair = true;
$personneCourante = $versement->idUser;
$compteCourant = $versement->idCompte;
$codeCompte = $versement->codeCompte;
?>
{afficher_debut_personne user=$personneCourante idVersement=$personneCourante}
{afficher_debut_compte idCompte=$compteCourant}
@ -44,17 +42,15 @@
$pair = true;
$personneCourante = $versement->idUser;
$compteCourant = $versement->idCompte;
$codeCompte = $versement->codeCompte;
?>
{afficher_debut_personne user=$personneCourante idVersement=$personneCourante}
{afficher_debut_compte idCompte=$compteCourant}
{elseif $versement.codeCompte != $codeCompte}
{elseif $versement.idCompte != $compteCourant}
{fin_compte}
{* changement de compte *}
<?php
$pair = true;
$compteCourant = $versement->idCompte;
$codeCompte = $versement->codeCompte;
?>
{afficher_debut_compte idCompte=$compteCourant}
{else}