Compare commits
18 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8b5c08c12d | ||
![]() |
ec0702e48c | ||
![]() |
27168d0f0b | ||
![]() |
1dc7969f0d | ||
![]() |
4fd56bf12d | ||
![]() |
e097e0c836 | ||
![]() |
3f3baa01d9 | ||
![]() |
d8af7ce6e7 | ||
![]() |
86bc9c8ae1 | ||
![]() |
a5ba3c52ba | ||
![]() |
83020af56e | ||
![]() |
a132bec27d | ||
![]() |
977046b657 | ||
![]() |
1df94237e6 | ||
![]() |
674157c925 | ||
![]() |
2b2c2ebcc9 | ||
![]() |
f524ebdc0f | ||
![]() |
e6470bd2e9 |
11 changed files with 816 additions and 805 deletions
|
@ -4,7 +4,7 @@ Plugin de reçus fiscaux pour le logiciel de gestion d'association [Paheko](http
|
|||
|
||||
## Installation
|
||||
|
||||
**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.
|
||||
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
|
||||
|
||||
## Fonctionnalités
|
||||
- Créer des reçus fiscaux pour les dons des membres
|
||||
|
|
|
@ -16,10 +16,14 @@ $_GET['_dialog'] = true;
|
|||
|
||||
// signature
|
||||
$signature =
|
||||
(null !== $plugin->getConfig('signature')) ?
|
||||
\KD2\HTTP::getScheme() . '://' . \KD2\HTTP::getHost() . WWW_URI . "/" . $plugin->getConfig('signature') :
|
||||
"";
|
||||
(null !== $config->fileURL('signature')) ?
|
||||
$config->fileURL('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 =
|
||||
|
@ -111,7 +115,8 @@ function genererRecusPDF($totalPersonnes,
|
|||
$numero_sequentiel = getNumSequentiel($configNum);
|
||||
foreach ($totalPersonnes as $idPersonne => $personne) {
|
||||
$tpl = new UserTemplate(null);
|
||||
$tpl->setSource(PLUGIN_ROOT . '/templates/recu.skel');
|
||||
/* $tpl->setSource(PLUGIN_ROOT . '/templates/recu.skel'); */
|
||||
$tpl->setSourcePath(PLUGIN_ROOT . '/templates/recu.skel');
|
||||
|
||||
$tpl->assignArray(compact('signature', 'logo_asso', 'texteArticles'));
|
||||
$tpl->assign('objet_asso', $plugin->getConfig('objet_asso'));
|
||||
|
|
|
@ -34,5 +34,18 @@ div.previs_recu
|
|||
font-family: Serif;
|
||||
font-size: 11pt;
|
||||
background-color: white;
|
||||
page-break-after: always;
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -95,3 +95,9 @@ span.titre, span.libelle
|
|||
{
|
||||
display : inline;
|
||||
}
|
||||
|
||||
/* Ne pas imprimer le bandeau des boutons du profiler */
|
||||
#__profiler
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ class Utils
|
|||
description,
|
||||
amount as montant
|
||||
FROM services_fees');
|
||||
return Utils::toAssoc($db->get($sql), 'id');
|
||||
return $db->getGrouped($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,7 +37,7 @@ class Utils
|
|||
services.label,
|
||||
services.description
|
||||
FROM services');
|
||||
return Utils::toAssoc($db->get($sql), 'id');
|
||||
return $db->getGrouped($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -52,6 +52,7 @@ 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
|
||||
|
@ -63,17 +64,19 @@ 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.code
|
||||
GROUP by acc_accounts.id
|
||||
ORDER by acc_accounts.code',
|
||||
$annee,
|
||||
$db->where('code', $op, $comptes)
|
||||
);
|
||||
return Utils::toAssoc($db->get($sql), 'id');
|
||||
return $db->getGrouped($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -117,32 +120,6 @@ 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
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
<nav class="tabs">
|
||||
<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 == 'activite'} class="current"{/if}><a href="{plugin_url file="action.php?action=activite"}">Versements par activité et tarif</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}
|
||||
{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}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
<fieldset>
|
||||
{* <legend>Choisir une des méthodes</legend> *}
|
||||
<dl id="menu">
|
||||
<dl>
|
||||
<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,7 +118,8 @@
|
|||
label="Activité « %s » - tarif « %s » ;"|args:$activite.label,$tarif.label
|
||||
}
|
||||
{/if}
|
||||
<span>compte : {$elem.codeCompte} ({$compte->nomCompte})</span>
|
||||
<span>compte : {$elem.codeCompte} - {$compte->nomCompte}</span>
|
||||
<span> ({$compte.label})</span>
|
||||
</div>
|
||||
<ul class="reduction">
|
||||
{foreach from=$plugin_config->reduction item="reduc"}
|
||||
|
@ -153,7 +154,8 @@
|
|||
label="Versements non rattachés à une activité ;"
|
||||
}
|
||||
<?php $compte = $lesComptes[$idCompte]; ?>
|
||||
<span>compte : {$compte.codeCompte} ({$compte.nomCompte})</span>
|
||||
<span>compte : {$compte.codeCompte} - {$compte.nomCompte}</span>
|
||||
<span> ({$compte.label})</span>
|
||||
</div>
|
||||
<ul class="reduction">
|
||||
{foreach from=$plugin_config->reduction item="reduc"}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{include file="_head.tpl" title="%s"|args:$plugin.name current="plugin_%s"|args:$plugin.id}
|
||||
{include file="_head.tpl" title="%s"|args:$plugin.label current="plugin_%s"|args:$plugin.id}
|
||||
|
||||
<?php
|
||||
$fmt = new \NumberFormatter('fr_FR', \NumberFormatter::SPELLOUT);
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
$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}
|
||||
|
@ -48,6 +49,7 @@
|
|||
$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}
|
||||
|
@ -60,15 +62,17 @@
|
|||
$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.idCompte != $compteCourant}
|
||||
{elseif $versement.codeCompte != $codeCompte}
|
||||
{fin_compte}
|
||||
{* changement de compte *}
|
||||
<?php
|
||||
$pair = true;
|
||||
$compteCourant = $versement->idCompte;
|
||||
$codeCompte = $versement->codeCompte;
|
||||
?>
|
||||
{afficher_debut_compte idCompte=$compteCourant}
|
||||
{else}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
form="versements_personnes"
|
||||
formaction="generer_recus.php?type=personne&format=pdf"
|
||||
onclick="return verifierChoix(this.form)"}
|
||||
{button type="submit" target="_dialog" label="Imprimer les reçus" shape="print"
|
||||
{button type="submit" label="Imprimer les reçus" shape="print"
|
||||
form="versements_personnes"
|
||||
formaction="generer_recus.php?type=personne&format=print"
|
||||
onclick="return verifierChoix(this.form)"}
|
||||
|
@ -25,12 +25,14 @@
|
|||
|
||||
{* 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}
|
||||
|
@ -42,15 +44,17 @@
|
|||
$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.idCompte != $compteCourant}
|
||||
{elseif $versement.codeCompte != $codeCompte}
|
||||
{fin_compte}
|
||||
{* changement de compte *}
|
||||
<?php
|
||||
$pair = true;
|
||||
$compteCourant = $versement->idCompte;
|
||||
$codeCompte = $versement->codeCompte;
|
||||
?>
|
||||
{afficher_debut_compte idCompte=$compteCourant}
|
||||
{else}
|
||||
|
|
Loading…
Add table
Reference in a new issue