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 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00024 require_once('class_dossier.php');
00025 include_once("ac_common.php");
00026 require_once('class_acc_ledger.php');
00027
00028
00029 $gDossier=dossier::id();
00030
00031 require_once('class_database.php');
00032
00033
00034 $cn=new Database($gDossier);
00035 include_once ('class_user.php');
00036
00037
00038
00039 $base=basename($_SERVER['SCRIPT_NAME']);
00040 $inside=false;
00041 $ledger=new Acc_Ledger($cn,0);
00042 $ledger->type='ALL';
00043 if (isset($_GET['amount_id']))
00044 {
00045 put_global(array(
00046 array("key"=>'amount_min','value'=>$_GET['amount_id']),
00047 array("key"=>'amount_max','value'=>$_GET['amount_id'])
00048 ));
00049 }
00050
00051 $search_box=$ledger->search_form('ALL',1,'search_op');
00052
00053 if ($base == 'recherche.php' || $base == 'do.php')
00054 {
00055 echo '<div class="content" >';
00056 echo '<form method="GET">';
00057 }
00058 else
00059 {
00060 $div='search_op';
00061 $action="";
00062 $callback="";
00063 require 'template/search_top.php';
00064 echo '<form name="search_form_ajx" id="search_form_ajx" onsubmit="search_operation(this);return false">';
00065 echo HtmlInput::get_to_hidden(array('ctlc','ledger'));
00066 $inside=true;
00067 }
00068
00069 echo $search_box;
00070 echo HtmlInput::submit("viewsearch",_("Recherche"));
00071 echo HtmlInput::button_close('search_op');
00072 echo '</form>';
00073
00074 if ( isset ($_GET['amount_min'])&& isset($_GET['amount_max'])&& ($_GET['amount_max']!=0 ||$_GET['amount_min']!=0 ))
00075 {
00076 $_GET['viewsearch']=1;
00077 put_global(
00078 array
00079 (
00080 array('key'=>'ledger_type','value'=>'ALL')
00081 )
00082
00083 );
00084
00085 }
00086
00087
00088
00089 if ( isset ($_GET['viewsearch']) )
00090 {
00091
00092
00093 $step=MAX_RECONCILE;
00094 $page=(isset($_GET['offset']))?$_GET['page']:1;
00095 $offset=(isset($_GET['offset']))?$_GET['offset']:0;
00096 if (count ($_GET) == 0)
00097 $array=null;
00098 else
00099 $array=$_GET;
00100 $array['p_action']='ALL';
00101 if ( ! isset ($array['date_start']) || ! isset ($array['date_end']))
00102 {
00103
00104 list($array['date_start'],$array['date_end'])=$g_user->get_limit_current_exercice();
00105 }
00106
00107 list($sql,$where)=$ledger->build_search_sql($array);
00108
00109 $max_line=$cn->count_sql($sql);
00110 list($count,$content)=$ledger->list_operation_to_reconcile($sql);
00111 $bar=navigation_bar($offset,$max_line,$step,$page);
00112
00113 if (! $inside ) {
00114 echo $bar;
00115
00116 } else
00117 {
00118 if ($step<$max_line ) echo '<h2 class="notice">Liste limitée à '.$step.' enregistrements. Le nombre d\'enregistrements trouvés est de ' .$max_line.'</h2>';
00119 }
00120 echo '<form method="get" onsubmit="set_reconcile(this);return false">';
00121 echo HtmlInput::submit("upd_rec","Mettre à jour");
00122 echo HtmlInput::get_to_hidden(array('ctlc','amount_id','ledger'));
00123 echo HtmlInput::get_to_hidden(array('l','date_start','date_end','desc','amount_min','amount_max','qcodesearch_op','accounting','unpaid','gDossier','ledger_type'));
00124 echo $content;
00125 echo HtmlInput::submit("upd_rec","Mettre à jour");
00126 if (! $inside )echo $bar;
00127
00128 if (isset($_GET[$op.'r_jrn'])) {
00129 foreach ($_GET[$op.'r_jrn'] as $k=>$v)
00130 echo HtmlInput::hidden($op.'r_jrn['.$k.']',$v);
00131 }
00132 echo '</form>';
00133 }
00134 echo '</div>';
00135 ?>