Ajout du support des écritures ventilées.
[garradin.git] / www / admin / compta / operations / voir.php
index 57d2ca3..ea02e7f 100644 (file)
@@ -15,11 +15,13 @@ $exercices = new Compta_Exercices;
 
 $tpl->assign('operation', $operation);
 
-$credit = $comptes->get($operation['compte_credit']);
-$tpl->assign('nom_compte_credit', $credit['libelle']);
-
-$debit = $comptes->get($operation['compte_debit']);
-$tpl->assign('nom_compte_debit', $debit['libelle']);
+foreach ($operation['fluxs'] as $key => &$flux)
+{
+    $compte = $comptes->get($flux['compte']);
+    $flux['compte_libelle'] = $compte['libelle'];
+    $flux['montant_oppose'] = - $flux['montant'];
+}
+$tpl->assign('fluxs', $operation['fluxs']);
 
 $tpl->assign('exercice', $exercices->get($operation['id_exercice']));
 
@@ -50,4 +52,4 @@ if ($operation['id_auteur'])
 
 $tpl->display('admin/compta/operations/voir.tpl');
 
-?>
\ No newline at end of file
+?>