';
echo dossier::hidden();
global $g_user;
// Get exercice user
$exercice=$g_user->get_exercice();
// display exercice user
echo h1(_("Exercice")." ".$exercice);
echo _('Cherche').' : '.HtmlInput::filter_table("fin_saldo_tb", '0,1,2,3', '1');
echo '
';
echo tr(th('Quick Code', ' class=" sorttable_sorted"',
Icon_Action::infobulle(17))
.th(_('Compte en banque'), ' style="text-align:left"')
.th(_('Journal'), ' style="text-align:center"')
.th(_('Description'), ' style="text-align:center"')
.th(_('solde opération'),
' style="text-align:right" class="sorttable_numeric"')
.th(_('solde extrait/relevé'),
' style="text-align:right" class="sorttable_numeric"')
.th(_('différence'),
' style="text-align:right" class="sorttable_numeric"')
);
// Filter the saldo
// on the current year
$filter_year=" j_tech_per in (select p_id from parm_periode where p_exercice='".$g_user->get_exercice()."')";
// for highligting tje line
$idx=0;
bcscale(2);
$tot_extrait=0; $tot_diff=0; $tot_operation=0;
// for each account
for ($i=0; $iid==0)
{
echo '';
echo td(h2(_("Journal mal configuré"), ' class="error" '),
' colspan="5" style="width:auto" ');
echo '
';
continue;
}
// get the saldo
$m=$array[$i]->get_solde_detail($filter_year);
$solde=$m['debit']-$m['credit'];
// print the result if the saldo is not equal to 0
if ($m['debit']!=0.0||$m['credit']!=0.0)
{
/* get saldo for not reconcilied operations */
$saldo_not_reconcilied=$array[$i]->get_bk_balance($filter_year." and (trim(jr_pj_number) ='' or jr_pj_number is null)");
/* get saldo for reconcilied operation */
$saldo_reconcilied=$array[$i]->get_bk_balance($filter_year." and ( trim(jr_pj_number) != '' and jr_pj_number is not null)");
if ($idx%2!=0)
$odd="odd";
else
$odd="even";
$idx++;
echo "";
echo "".
IButton::history_card($array[$i]->id,
$array[$i]->strAttribut(ATTR_DEF_QUICKCODE)).
" | ";
$saldo_rec=bcsub($saldo_reconcilied['debit'],
$saldo_reconcilied['credit']);
$diff=bcsub($saldo_not_reconcilied['debit'],
$saldo_not_reconcilied['credit']);
echo "".
$array[$i]->strAttribut(ATTR_DEF_NAME).
" | ".
td(h($array[$i]->ledger_name)).
td(h($array[$i]->ledger_description)).
''.
nbm($solde).
" | ".
''.
nbm($saldo_rec).
" | ".
''.
nbm($diff).
" | ".
"
";
$tot_extrait=bcadd($tot_extrait, $solde);
$tot_operation=bcadd($tot_operation, $saldo_rec);
$tot_diff=bcadd($tot_diff, $diff);
}
}// for
echo '';
echo '';
echo td('');
echo td('');
echo td('');
echo td(_('TOTAUX'), 'style="font-weight:bold;text-align:center"');
echo td(nbm($tot_extrait), 'style="font-weight:bold" class="num"');
echo td(nbm($tot_operation), ' style="font-weight:bold" class="num"');
echo td(nbm($tot_diff), ' style="font-weight:bold" class="num"');
echo '
';
echo '';
echo "
";
echo "
";
return;
?>