From 2e8eb26e5a56c51478268de661902bdd21307c9d Mon Sep 17 00:00:00 2001 From: engel <> Date: Thu, 24 Mar 2022 17:58:36 +0000 Subject: [PATCH 01/16] simplification gestion logo FossilOrigin-Name: 91a2a75c24b4c340d69c6c80c9779b8e1454a8708181c92db13115a843e06281 --- install.php | 6 ------ uninstall.php | 6 ------ upgrade.php | 5 ----- 3 files changed, 17 deletions(-) diff --git a/install.php b/install.php index a5bedd9..1117fa6 100644 --- a/install.php +++ b/install.php @@ -8,9 +8,3 @@ $default_signature_file = (new File)->createAndStore('skel/plugin/recusfiscaux', 'default_signature.png', $path, null); -// « logo » par défaut -$path = __DIR__ . '/data/default_logo.png'; -$default_logo_file = (new File)->createAndStore('skel/plugin/recusfiscaux', - 'default_logo.png', - $path, - null); diff --git a/uninstall.php b/uninstall.php index 84fda2a..86e35bf 100644 --- a/uninstall.php +++ b/uninstall.php @@ -10,12 +10,6 @@ if (null !== $default_signature_file) { $default_signature_file->delete(); } -// logo par défaut -$default_logo_file = \Garradin\Files\Files::get('skel/plugin/recusfiscaux/default_logo.png'); -if (null !== $default_logo_file) { - $default_logo_file->delete(); -} - // signature réelle $signature = $plugin->getConfig('signature'); if (null !== $signature) { diff --git a/upgrade.php b/upgrade.php index cece83e..a0a8751 100644 --- a/upgrade.php +++ b/upgrade.php @@ -10,9 +10,4 @@ $old_version = $plugin->getInfos('version'); if (version_compare($old_version, '0.6.0', '<')) { - $path = __DIR__ . '/data/default_logo.png'; - $default_logo_file = (new File)->createAndStore('skel/plugin/recusfiscaux', - 'default_logo.png', - $path, - null); } From af7816d97fff220a66e2082a7f11997ea27bafeb Mon Sep 17 00:00:00 2001 From: engel <> Date: Thu, 24 Mar 2022 18:00:39 +0000 Subject: [PATCH 02/16] =?UTF-8?q?d=C3=A9but=20refonte=20gestion=20versemen?= =?UTF-8?q?ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FossilOrigin-Name: 1be54b8a985d3fb24895bae4cc5481743edf0a68dbb0eb4278580df3ce7f530d --- lib/Personne.php | 2 +- lib/Utils.php | 67 +++++++++++++++++++++++ templates/_nav.tpl | 2 +- templates/versements_personnes.tpl | 67 ++++++++++------------- www/admin/config.php | 5 +- www/admin/generer_activites.php | 62 ++++++++++++--------- www/admin/generer_personnes.php | 88 ++++++++++++++++++++++++++---- www/admin/script.js | 67 +++++++++++++++-------- www/admin/style.css | 4 ++ www/admin/versements_activites.php | 4 +- www/admin/versements_personnes.php | 66 ++++++++++++++++++++-- 11 files changed, 322 insertions(+), 112 deletions(-) diff --git a/lib/Personne.php b/lib/Personne.php index 118aca1..2f695f6 100644 --- a/lib/Personne.php +++ b/lib/Personne.php @@ -35,7 +35,6 @@ class Personne /** * return copie d'une personne - */ public function clone() { return new Personne( @@ -46,6 +45,7 @@ class Personne $this->ville, $this->courriel); } + */ /** * ajouter un versement diff --git a/lib/Utils.php b/lib/Utils.php index f6bed5b..e29e92a 100644 --- a/lib/Utils.php +++ b/lib/Utils.php @@ -39,6 +39,37 @@ class Utils return $db->get($sql); } + /** + * @return versements correspondants à l'année donnée + * @param $annee + * @param array $champsNom : liste non vide des champs de nom/prénom + */ + public static function getVersementsPersonnes($annee, $champsNom) + { + $db = DB::getInstance(); + $tri = Utils::combinerTri($champsNom); + $sql = sprintf( + 'SELECT + membres.id as idUser, + acc_transactions_lines.credit as versement, + acc_transactions.date + FROM acc_transactions_users + INNER JOIN membres on acc_transactions_users.id_user = membres.id + INNER JOIN acc_transactions on acc_transactions_users.id_transaction = acc_transactions.id + INNER JOIN services_users on acc_transactions_users.id_service_user = services_users.id + INNER JOIN acc_transactions_lines on acc_transactions_lines.id_transaction = acc_transactions.id + WHERE + (strftime(%s, acc_transactions.date) = "%d" + AND + acc_transactions_lines.credit > 0) + ORDER by %s, acc_transactions.date', + '"%Y"', + $annee, + $tri + ); + return $db->get($sql); + } + /** * @return versements correspondants à l'année et aux tarifs donnés * @param $annee @@ -76,6 +107,42 @@ class Utils return $db->get($sql); } + /** + * @return versements correspondants à l'année et aux comptes donnés + * @param $annee + * @param array $comptes + * @param array $champsNom : liste non vide des champs de nom/prénom + */ + public static function getVersementsComptes($annee, $comptes, $champsNom) + { + $db = DB::getInstance(); + $tri = Utils::combinerTri($champsNom); + $sql = sprintf( + 'SELECT + acc_accounts.code as compte, + membres.id as idUser, + acc_transactions_lines.credit as versement, + acc_transactions.date + FROM acc_transactions_users + INNER JOIN membres on acc_transactions_users.id_user = membres.id + INNER JOIN acc_transactions on acc_transactions_users.id_transaction = acc_transactions.id + INNER JOIN services_users on acc_transactions_users.id_service_user = services_users.id + INNER JOIN acc_transactions_lines on acc_transactions_lines.id_transaction = acc_transactions.id + WHERE + (strftime(%s, acc_transactions.date) = "%d" + AND + acc_accounts.%s + AND + acc_transactions_lines.credit > 0) + ORDER by acc_accounts.code, %s, acc_transactions.date', + '"%Y"', + $annee, + $db->where('code', $comptes), + $tri + ); + return $db->get($sql); + } + /** * Versements totaux par personne pour une année donnée * @param année diff --git a/templates/_nav.tpl b/templates/_nav.tpl index 6ab82c4..140e031 100644 --- a/templates/_nav.tpl +++ b/templates/_nav.tpl @@ -5,7 +5,7 @@