Пример #1
0
$periode_fin = $listPeriode[$id_periode - 1]['date_fin'];
if ($action == 'lister') {
    $debit = $compta->obtenirBilan(1, $periode_debut, $periode_fin);
    $smarty->assign('debit', $debit);
    $credit = $compta->obtenirBilan(2, $periode_debut, $periode_fin);
    $smarty->assign('credit', $credit);
    //	$journal = $compta->obtenirBilan();
    //	$smarty->assign('bilan', $journal);
    $totalDepense = $compta->obtenirTotalBilan(1, $periode_debut, $periode_fin);
    $smarty->assign('totalDepense', $totalDepense);
    $totalRecette = $compta->obtenirTotalBilan(2, $periode_debut, $periode_fin);
    $smarty->assign('totalRecette', $totalRecette);
    $difMontant = $totalRecette - $totalDepense;
    $smarty->assign('difMontant', $difMontant);
    if ($details != '') {
        $dataDetailsDebit = $compta->obtenirBilanDetails(1, $periode_debut, $periode_fin, $details);
        $smarty->assign('dataDetailsDebit', $dataDetailsDebit);
        $dataDetailsCredit = $compta->obtenirBilanDetails(2, $periode_debut, $periode_fin, $details);
        $smarty->assign('dataDetailsCredit', $dataDetailsCredit);
    }
} elseif ($action == 'view' && $details) {
    $dataDetailsDebit = $compta->obtenirBilanDetails(1, $periode_debut, $periode_fin, $details);
    $smarty->assign('dataDetailsDebit', $dataDetailsDebit);
    $dataDetailsCredit = $compta->obtenirBilanDetails(2, $periode_debut, $periode_fin, $details);
    $smarty->assign('dataDetailsCredit', $dataDetailsCredit);
    $sousTotalDebit = $compta->obtenirSousTotalBilan(1, $periode_debut, $periode_fin, $details);
    $smarty->assign('sousTotalDebit', $sousTotalDebit);
    $sousTotalCredit = $compta->obtenirSousTotalBilan(2, $periode_debut, $periode_fin, $details);
    $smarty->assign('sousTotalCredit', $sousTotalCredit);
    $difMontant = $sousTotalCredit - $sousTotalDebit;
    $smarty->assign('difMontant', $difMontant);