Ajout du support des écritures ventilées.
[garradin.git] / include / class.cotisations_membres.php
index a895ee2..1dc9029 100644 (file)
@@ -193,12 +193,12 @@ class Cotisations_Membres
 
         $id_operation = $journal->add([
             'libelle'       =>  $data['libelle'],
-            'montant'       =>  $data['montant'],
             'date'          =>  $data['date'],
+            'fluxs'      =>
+              [ ['compte'=>$credit, 'montant' => - $data['montant'] ]
+              , ['compte'=>$debit,  'montant' =>   $data['montant'] ] ],
             'moyen_paiement'=>  $data['moyen_paiement'],
             'numero_cheque' =>  isset($data['numero_cheque']) ? $data['numero_cheque'] : null,
-            'compte_debit'  =>  $debit,
-            'compte_credit' =>  $credit,
             'id_categorie'  =>  (int)$data['id_categorie'],
             'id_auteur'     =>  (int)$data['id_auteur'],
         ]);
@@ -333,4 +333,4 @@ class Cotisations_Membres
                return $db->simpleQuerySingle('SELECT COUNT(DISTINCT id_cotisation) FROM cotisations_membres 
                        WHERE id_membre = ?;', false, (int)$id);
        }
-}
\ No newline at end of file
+}