get('form_id',"number")); $Form->get_name(); $type_periode=$http->get("type_periode", "number", -1); if ($type_periode==1) { $from_date=$http->get("from_date", "date"); $to_date=$http->get("to_date", "date"); $array=$Form->get_row( $from_date, $to_date, $type_periode); } // Printing asked by range of date if ($type_periode==0) { $from_periode=$http->get("from_periode"); $to_periode=$http->get("to_periode"); $p_step=$http->get('p_step'); if ( $http->get("p_step","number")==1) { // step are asked //-- for ($e=$from_periode; $e<=$to_periode; $e+=$p_step) { $periode=getPeriodeName($cn, $e); if ($periode==null) continue; $array[]=$Form->get_row($e, $e, $type_periode); $periode_name[]=$periode; } } else { $array=$Form->get_row( $http->get('from_periode',"number"), $http->get('to_periode',"number"), $type_periode); } } } catch (Exception $ex) { alert($ex->getMessage());; } $rep=""; $hid=new IHidden(); echo '
'; if ($type_periode == 0) { $t=($from_periode==$to_periode)?"":" -> ".getPeriodeName($cn,$to_periode,'p_end'); echo '

'.$Form->id." ".$Form->name. " - ".getPeriodeName($cn,$from_periode,'p_start'). " ".$t. '

'; } else { echo '

'.$Form->id." ".$Form->name. ' Date :'. $from_date. " au ". $to_date. '

'; } echo ''; echo ''; echo '"; echo '"; echo '"; echo ""; echo "
'. dossier::hidden(). HtmlInput::submit('bt_other',"Autre Rapport"). $hid->input("type","rapport").$hid->input("ac",$_GET['ac'])."
'. HtmlInput::submit('bt_pdf',"Export PDF"). HtmlInput::hidden('act','PDF:report'). dossier::hidden(). $hid->input("type","rapport"). $hid->input("ac",$_GET['ac']). $hid->input("form_id",$Form->id); if ( isset($from_periode)) echo $hid->input("from_periode",$from_periode); if ( isset($to_periode)) echo $hid->input("to_periode",$to_periode); if (isset($p_step)) echo $hid->input("p_step",$p_step); if ( isset($from_date)) echo $hid->input("from_date",$from_date); if ( isset($to_date)) echo $hid->input("to_date",$to_date); echo $hid->input("type_periode",$type_periode); echo "
'. HtmlInput::hidden('act','CSV:report'). HtmlInput::submit('bt_csv',"Export CSV"). dossier::hidden(). $hid->input("type","form"). $hid->input("ac",$_GET['ac']). $hid->input("form_id",$Form->id); if ( isset($from_periode)) echo $hid->input("from_periode",$from_periode); if ( isset($to_periode)) echo $hid->input("to_periode",$to_periode); if (isset($p_step)) echo $hid->input("p_step",$p_step); if ( isset($from_date)) echo $hid->input("from_date",$from_date); if ( isset($to_date)) echo $hid->input("to_date",$to_date); echo $hid->input("type_periode",$_GET['type_periode']); echo "
"; if ( count($Form->row ) == 0 ) exit; if ( $type_periode== 0 ) { if ( $p_step == 0) { // check the step // show tables ShowReportResult($Form->row); } else { $a=0; foreach ( $array as $e) { echo '

Periode : '.$periode_name[$a]."

"; $a++; ShowReportResult($e); } } } else { ShowReportResult($Form->row); } echo "
"; exit; } //----------------------------------------------------- // Show the jrn and date //----------------------------------------------------- require_once NOALYSS_INCLUDE.'/lib/database.class.php'; $ret=$cn->make_array("select fr_id,fr_label from formdef order by fr_label"); if ( sizeof($ret) == 0 ) { echo "Aucun Rapport"; return; } //----------------------------------------------------- // Form //----------------------------------------------------- echo '
'; $exercice=(isset($_GET['exercice']))?$_GET['exercice']:$g_user->get_exercice(); /* * Let you change the exercice */ echo '
'._('Exercice').'';; echo '
'; echo 'Choisissez un autre exercice :'; $ex=new Exercice($cn); $wex=$ex->select('exercice',$exercice,' onchange="submit(this)"'); echo $wex->input(); echo dossier::hidden(); echo HtmlInput::get_to_hidden(array('ac','type')); echo '
'; echo '
'; echo '
'; $hidden=new IHidden(); echo $hidden->input("ac",$_GET['ac']); echo $hidden->input("type","rapport"); echo dossier::hidden(); echo ''; $w=new ISelect(); $w->table=1; print td(_("Choisissez le rapport")); print $w->input("form_id",$ret); print ''; //-- calendrier ou periode comptable $aCal=array( array('value'=>0,'label'=>_('Période comptable')), array('value'=>1,'label'=>_('Calendrier')) ); $w->javascript=' onchange=enable_type_periode();'; $w->id='type_periode'; echo ''; print td('Type de date : '); echo $w->input('type_periode',$aCal); echo ''; $w->javascript=''; print ''; // filter on the current year $filter_year=" where p_exercice='".sql_string($exercice)."'"; $periode_start_select=new ISelect(); $periode_start_select->table=1; $periode_end_select=new ISelect(); $periode_end_select->table=1; $periode_start=$cn->make_array("select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end"); print td("Période comptable : Depuis"); echo $periode_start_select->input('from_periode',$periode_start); print td(" jusqu'à "); $periode_end=$cn->make_array("select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end"); print $periode_end_select->input('to_periode',$periode_end); print ""; echo ''; //--- by date $date_from=new IDate('from_date'); $date_from->id='from_date'; $date_to=new IDate('to_date'); $date_to->id='to_date'; echo td(_("Calendrier depuis :")); echo td($date_from->input('from_date')); echo td(_("jusque")); echo td($date_to->input('to_date')); echo ''; $aStep=array( array('value'=>0,'label'=>_('Pas d\'étape')), array('value'=>1,'label'=>_('1 mois')) ); echo ''; echo td(_('Par étape de')); $w->id='p_step'; echo $w->input('p_step',$aStep); echo ''; echo '
'; echo ' '._('Attention : vous ne pouvez pas utiliser les étapes avec les dates calendriers.').''; echo '
'; echo ''._('Les clauses FROM sont ignorés avec les dates calendriers').''; echo '
'; print HtmlInput::submit('bt_html',_('Visualisation')); echo '
'; echo ''; echo '
'; echo '
'; //----------------------------------------------------- // Function //----------------------------------------------------- function ShowReportResult($p_array) { echo ''; echo "". "". "". ""; $i=0; foreach ( $p_array as $op ) { $i++; $class= ( $i % 2 == 0 )?' class="odd"':' class="even"'; echo "". "". "". ""; } echo "
Description montant
".h($op['desc'])."".nbm($op['montant'])."
"; } ?>