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 foreach ($operation['fluxs'] as $key => &$flux)
20 $compte = $comptes->get($flux['compte']);
21 $flux['compte_libelle'] = $compte['libelle'];
22 $flux['montant_oppose'] = - $flux['montant'];
24 $tpl->assign('fluxs', $operation['fluxs']);
26 $tpl->assign('exercice', $exercices->get($operation['id_exercice']));
28 if ($operation['id_categorie'])
30 $cats = new Compta_Categories
;
32 $categorie = $cats->get($operation['id_categorie']);
33 $tpl->assign('categorie', $categorie);
35 if ($categorie['type'] == Compta_Categories
::RECETTES
)
37 $tpl->assign('compte', $debit['libelle']);
41 $tpl->assign('compte', $credit['libelle']);
44 $tpl->assign('moyen_paiement', $cats->getMoyenPaiement($operation['moyen_paiement']));
47 if ($operation['id_auteur'])
49 $auteur = $membres->get($operation['id_auteur']);
50 $tpl->assign('nom_auteur', $auteur['identite']);
53 $tpl->display('admin/compta/operations/voir.tpl');