4 require_once __DIR__
. '/../_inc.php';
6 $cats = new Compta_Categories
;
11 $cat = $cats->get(utils
::get('cat'));
15 throw new UserException("La catégorie demandée n'existe pas.");
22 if (isset($_GET['autres']))
23 $type = Compta_Categories
::AUTRES
;
24 elseif (isset($_GET['depenses']))
25 $type = Compta_Categories
::DEPENSES
;
27 $type = Compta_Categories
::RECETTES
;
30 $journal = new Compta_Journal
;
32 $list = $journal->getListForCategory($type === Compta_Categories
::AUTRES ?
null : $type, $cat ?
$cat['id'] : null);
34 $tpl->assign('categorie', $cat);
35 $tpl->assign('journal', $list);
36 $tpl->assign('type', $type);
38 if ($type !== Compta_Categories
::AUTRES
)
40 $tpl->assign('liste_cats', $cats->getList($type));
45 foreach ($list as $row)
47 $total +
= (float) $row['montant'];
50 $tpl->assign('total', $total);
52 $tpl->display('admin/compta/operations/index.tpl');