Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00030 require_once ('class_acc_parm_code.php');
00031 echo '<div class="content">';
00032 $fiche=new Fiche($cn);
00033
00034 $array=$fiche->get_bk_account();
00035
00036 echo '<div class="content">';
00037 echo dossier::hidden();
00038 echo _('Filtre :').HtmlInput::filter_table("fin_saldo_tb", '0,1,2,3', '1');
00039 echo '<table class="sortable" style="margin-left:10%;width:60%" class="result" id="fin_saldo_tb">';
00040 echo tr(th('Quick Code',' class=" sorttable_sorted_reverse"',HtmlInput::infobulle(17).'<span id="sorttable_sortrevind"> ▴</span>')
00041 .th('Compte en banque',' style="text-align:left"')
00042 .th('Journal',' style="text-align:center"')
00043 .th('Description',' style="text-align:center"')
00044 .th('solde opération',' style="text-align:right" class="sorttable_numeric"')
00045 .th('solde extrait/relevé',' style="text-align:right" class="sorttable_numeric"')
00046 .th('différence',' style="text-align:right" class="sorttable_numeric"')
00047 );
00048
00049
00050 $filter_year=" j_tech_per in (select p_id from parm_periode where p_exercice='".$g_user->get_exercice()."')";
00051
00052 $idx=0;
00053 bcscale(2);
00054 $tot_extrait=0;$tot_diff=0;$tot_operation=0;
00055
00056 for ( $i = 0; $i < count($array);$i++)
00057 {
00058 if ( $array[$i]->id==0) {
00059 echo '<tr >';
00060 echo td(h2("Journal mal configuré",' class="error" '),' colspan="5" style="width:auto" ');
00061 echo '</tr>';
00062 continue;
00063 }
00064
00065 $m=$array[$i]->get_solde_detail($filter_year);
00066
00067 $solde=$m['debit']-$m['credit'];
00068
00069
00070 if ( $m['debit'] != 0.0 || $m['credit'] != 0.0)
00071 {
00072
00073 $saldo_not_reconcilied=$array[$i]->get_bk_balance($filter_year." and (trim(jr_pj_number) ='' or jr_pj_number is null)" );
00074
00075
00076
00077 $saldo_reconcilied=$array[$i]->get_bk_balance($filter_year." and ( trim(jr_pj_number) != '' and jr_pj_number is not null)" );
00078
00079 if ( $idx%2 != 0 )
00080 $odd="odd";
00081 else
00082 $odd="even";
00083
00084 $idx++;
00085 echo "<tr class=\"$odd\">";
00086 echo "<TD >".
00087 IButton::history_card($array[$i]->id,$array[$i]->strAttribut(ATTR_DEF_QUICKCODE)).
00088 "</TD>";
00089
00090 $saldo_rec=bcsub($saldo_reconcilied['debit'],$saldo_reconcilied['credit']);
00091 $diff=bcsub($saldo_not_reconcilied['debit'],$saldo_not_reconcilied['credit']);
00092 echo "<TD >".
00093 $array[$i]->strAttribut(ATTR_DEF_NAME).
00094 "</TD>".
00095 td(h($array[$i]->ledger_name)).
00096 td(h($array[$i]->ledger_description)).
00097 '<TD class="sorttable_numeric" sorttable_customkey="'.$solde.'" style="text-align:right">'.
00098 nbm($solde).
00099 "</TD>".
00100 '<TD class="sorttable_numeric" sorttable_customkey="'.$saldo_rec.'" style="text-align:right">'.
00101 nbm($saldo_rec).
00102 "</TD>".
00103 '<TD class="sorttable_numeric" sorttable_customkey="'.$diff.'" style="text-align:right">'.
00104 nbm($diff).
00105 "</TD>".
00106 "</TR>";
00107 $tot_extrait=bcadd($tot_extrait,$solde);
00108 $tot_operation=bcadd($tot_operation,$saldo_rec);
00109 $tot_diff=bcadd($tot_diff,$diff);
00110 }
00111 }
00112 echo '<tfoot>';
00113 echo '<tr>';
00114 echo td('');
00115 echo td('');
00116 echo td('');
00117 echo td(' TOTAUX ','style="font-weight:bold"');
00118 echo td(nbm($tot_extrait),'style="font-weight:bold" class="num"');
00119 echo td(nbm($tot_operation),' style="font-weight:bold" class="num"');
00120 echo td(nbm($tot_diff),' style="font-weight:bold" class="num"');
00121 echo '</tr>';
00122
00123 echo '</tfoot>';
00124 echo "</table>";
00125 echo "</div>";
00126 exit();
00127 ?>