4 require_once __DIR__
. '/../_inc.php';
6 $banques = new Compta_Comptes_Bancaires
;
7 $journal = new Compta_Journal
;
9 $liste = $banques->getList();
11 foreach ($liste as &$banque)
13 $banque['solde'] = $journal->getSolde($banque['id']);
16 $tpl->assign('liste', $liste);
18 function tpl_format_iban($iban)
20 return implode(' ', str_split($iban, 4));
23 function tpl_format_rib($iban)
25 if (substr($iban, 0, 2) != 'FR')
28 $rib = utils
::IBAN_RIB($iban);
29 $rib = explode(' ', $rib);
31 $out = '<table class="rib"><thead><tr><th>Banque</th><th>Guichet</th><th>Compte</th><th>Clé</th></tr></thead>';
32 $out.= '<tbody><tr><td>'.$rib[0].'</td><td>'.$rib[1].'</td><td>'.$rib[2].'</td><td>'.$rib[3].'</td></tr></tbody></table>';
36 $tpl->register_modifier('format_iban', 'Garradin\tpl_format_iban');
37 $tpl->register_modifier('format_rib', 'Garradin\tpl_format_rib');
39 $tpl->display('admin/compta/banques/index.tpl');