57d2ca336cde9fbdc810b95f6043cd8009e5e6b2
4 require_once __DIR__
. '/../_inc.php';
6 $journal = new Compta_Journal
;
8 $operation = $journal->get(utils
::get('id'));
12 throw new UserException("L'opération demandée n'existe pas.");
14 $exercices = new Compta_Exercices
;
16 $tpl->assign('operation', $operation);
18 $credit = $comptes->get($operation['compte_credit']);
19 $tpl->assign('nom_compte_credit', $credit['libelle']);
21 $debit = $comptes->get($operation['compte_debit']);
22 $tpl->assign('nom_compte_debit', $debit['libelle']);
24 $tpl->assign('exercice', $exercices->get($operation['id_exercice']));
26 if ($operation['id_categorie'])
28 $cats = new Compta_Categories
;
30 $categorie = $cats->get($operation['id_categorie']);
31 $tpl->assign('categorie', $categorie);
33 if ($categorie['type'] == Compta_Categories
::RECETTES
)
35 $tpl->assign('compte', $debit['libelle']);
39 $tpl->assign('compte', $credit['libelle']);
42 $tpl->assign('moyen_paiement', $cats->getMoyenPaiement($operation['moyen_paiement']));
45 if ($operation['id_auteur'])
47 $auteur = $membres->get($operation['id_auteur']);
48 $tpl->assign('nom_auteur', $auteur['identite']);
51 $tpl->display('admin/compta/operations/voir.tpl');