Ticket Hash: e0e31b676809fa82cfc38535a602fc63d41a7e70
Title: Écriture comptable d'une cotisation ne précise pas le membre
Status: Fixed Type: Feature_Request
Severity: Cosmetic Priority: Immediate
Subsystem: Resolution: Fixed
Last Modified: 2017-10-11 05:23:17
Version Found In: 0.6.2
User Comments:

ghostdog added on 2014-11-10 11:35:36:

La saisie d'une cotisation entraine la création d'un fruste 'Cotisation (automatique)' dans la comptabilité.

Le patch ci-dessous permet de rajouter dans le libellé de l'opération le nom/identifiant du membre:
$ diff -u include/class.cotisations_membres.php.orig include/class.cotisations_membres.php
--- include/class.cotisations_membres.php.orig  2014-11-10 12:08:00.507996513 +0100
+++ include/class.cotisations_membres.php       2014-11-10 12:27:18.814995405 +0100
@@ -99,10 +99,14 @@

                if ($co['id_categorie_compta'] && $co['montant'] > 0)
                {
+                       $champ_id = Config::getInstance()->get('champ_identite');
+                       $id_membre_detail = $db->simpleQuerySingle('select '.$champ_id.' from membres
+                                                                           WHERE id = ?;',
+                                                                           true, (int)$data['id_membre']);
                        try {
                        $id_operation = $this->addOperationCompta($id, [
                                'id_categorie'  =>      $co['id_categorie_compta'],
-                           'libelle'       =>  'Cotisation (automatique)',
+                           'libelle'       =>  'Cotisation (automatique), '.$id_membre_detail[$champ_id],
                            'montant'       =>  $data['montant'],
                            'date'          =>  $data['date'],
                            'moyen_paiement'=>  $data['moyen_paiement'],

calment added on 2014-11-13 08:50:29:

Justement ce weekend en rentrant mes cotisations j'ai réalisé la même chose et j'ai fait la modification suivante afin d'obtenir en label le nom de la cotisation suivie entre parenthèse de l'id du membre et de son nom(ex : 2014-2015 Badminton Adulte (142 - Dupont) ). J'ai modifié non seulement la class mais aussi ajout.php

/usr/share/garradin$ diff -u www/admin/membres/cotisations/ajout.php.orig www/admin/membres/cotisations/ajout.php
--- www/admin/membres/cotisations/ajout.php.orig        2014-11-08 18:15:52.370038597 +0100
+++ www/admin/membres/cotisations/ajout.php     2014-11-13 09:41:50.706723863 +0100
@@ -53,6 +53,7 @@
                 'moyen_paiement'    =>  utils::post('moyen_paiement'),
                 'numero_cheque'     =>  utils::post('numero_cheque'),
                 'banque'            =>  utils::post('banque'),
+               'libelle'           =>  $cotisations->get(utils::post('id_cotisation'))['intitule']." (".utils::post('id_membre')." - ".$membres->get((int)utils::post('id_membre'))['nom'].")",
             ];

             $m_cotisations->add($data);

/usr/share/garradin$ diff -u include/class.cotisations_membres.php.orig include/class.cotisations_membres.php
--- include/class.cotisations_membres.php.orig  2014-11-08 17:57:11.249808650 +0100
+++ include/class.cotisations_membres.php       2014-11-13 09:34:41.589149385 +0100
@@ -102,7 +102,7 @@
                        try {
                        $id_operation = $this->addOperationCompta($id, [
                                'id_categorie'  =>      $co['id_categorie_compta'],
-                           'libelle'       =>  'Cotisation (automatique)',
+                           'libelle'       =>  $data['libelle'],
                            'montant'       =>  $data['montant'],
                            'date'          =>  $data['date'],
                            'moyen_paiement'=>  $data['moyen_paiement'],

bohwaz added on 2017-10-11 03:23:17:

Corrigé [d0463fc9a5]