diff --git a/config.json b/config.json index 2c63c08..bbc1ecc 100644 --- a/config.json +++ b/config.json @@ -1,2 +1,8 @@ { + "auteur" : "jce", + "articlesCGI" : [ + "Article 200", + "Article 228 bis", + "Article 978" + ] } diff --git a/garradin_plugin.ini b/garradin_plugin.ini index eb0a5f2..1660303 100644 --- a/garradin_plugin.ini +++ b/garradin_plugin.ini @@ -1,8 +1,8 @@ nom="Reçus fiscaux" description="Génération de reçus fiscaux pour les dons des membres" auteur="jce" -url="" +url="https://git.roflcopter.fr/lesanges/recus-fiscaux-garradin" version="0.1" menu=1 -config=0 +config=1 min_version="1.1" diff --git a/lib/Utils.php b/lib/Utils.php index a964576..22cf619 100644 --- a/lib/Utils.php +++ b/lib/Utils.php @@ -14,7 +14,7 @@ class Utils { return DB::getInstance()->get( "SELECT - id, + id as idActivite, label, description FROM services @@ -47,9 +47,9 @@ class Utils { return DB::getInstance()->get( "SELECT - services.id as idService, - services.label as titreService, - services.description as descService, + services.id as idActivite, + services.label as titreActivite, + services.description as descActivite, services_fees.id as idTarif, services_fees.label as titreTarif, services_fees.description as descTarif @@ -66,13 +66,14 @@ class Utils { return DB::getInstance()->get( "SELECT - services.id as Id, - services.label, - services.description as descService, - services_fees.label as tarif, + services.id as idActivite, + services.label as titreActivite, + services.description as descActivite, + services_fees.id as idTarif, + services_fees.label as titreTarif, services_fees.description as descTarif, - acc_accounts.code as numero_cpt, - acc_accounts.label as nom_cpt + acc_accounts.code as numeroCpt, + acc_accounts.label as nomCpt FROM services LEFT JOIN services_fees ON services_fees.id_service = services.id LEFT JOIN acc_accounts ON services_fees.id_account = acc_accounts.id @@ -164,7 +165,7 @@ class Utils public static function getVersementsTotaux($annee) { $sql = "SELECT - acc_transactions_users.id_user as id, + acc_transactions_users.id_user as idUser, membres.nom as nom, sum(acc_transactions_lines.credit) AS montant, membres.adresse as adresse, @@ -195,43 +196,54 @@ class Utils * @return nom de l'association */ public static function getNomAsso() { - return DB::getInstance()->get( + return DB::getInstance()->first( "SELECT value FROM config WHERE key = 'nom_asso'" - )[0]->value; + )->value; } /** * @return adresse de l'association */ public static function getAdresseAsso() { - return DB::getInstance()->get( + return DB::getInstance()->first( "SELECT value FROM config WHERE key = 'adresse_asso'" - )[0]->value; + )->value; } /** - * récupérer l'année du premier exercice + * @return liste des années fiscales */ - public static function getPremiereAnnee() { - return DB::getInstance()->get( + public static function getAnneesFiscales() { + $rows = DB::getInstance()->get( "SELECT strftime('%Y', start_date) as annee FROM acc_years - ORDER by start_date" - )[0]->value; + ORDER by start_date DESC" + ); + $anneesFiscales = array(); + foreach ($rows as $row) { + $anneesFiscales[] = $row->annee; + } + return $anneesFiscales; } // ------------------------------------------------------------------------ // zip archive creation // ------------------------------------------------------------------------ + /** + * enregistrer les fichiers dans une archive zip + * @param $fileList : liste des fichiers à archiver + * @param $year : pour générer le nom de l'archive + * @param $archiveDir : ne sert plus + */ static function makeArchive( $fileList, $year, - $archiveDir) + $archiveDir = null) { $zipFilename = "recus_dons" . $year . ".zip"; header('Content-type: application/zip'); diff --git a/templates/_nav.tpl b/templates/_nav.tpl index ed9bae6..5908a88 100644 --- a/templates/_nav.tpl +++ b/templates/_nav.tpl @@ -7,5 +7,8 @@
Nom | -Description | -Tarif | -Description | -N° Compte | -Nom Compte | -
---|---|---|---|---|---|
{$activite.label} | -{$activite.descService} | -{$activite.tarif} | -{$activite.descTarif} | -{$activite.numero_cpt} | -{$activite.nom_cpt} | -