request("jrn","string", -1); $request_ac=$http->request("ac","string", ""); $request_sa=$http->request("sa","string", ""); $get_jrn=$http->get('jrn',"string",-1); echo '
'; echo '
'; $sel=new ISelect(); $sel->name="jrn"; $sel->value=$cn->make_array("select jrn_def_id,jrn_def_name from ". " jrn_def where jrn_def_type in ('VEN','ACH','ODS') order by jrn_def_name"); // Show a list of ledger $sel->selected=$request_jrn; echo 'Choisissez un journal '.$sel->input(); echo dossier::hidden(); $hid=new IHidden(); echo $hid->input("sa","jrn"); echo $hid->input("ac",$request_ac); echo '
'; echo HtmlInput::submit('Accepter','Accepter'); echo '
'; // if $_REQUEST[sa] == del delete the predefined operation if ( $request_sa == 'del') { $op=new Pre_operation($cn); $http=new HttpInput(); $op->od_id=$http->request('od_id',"string",-1); if (isNumber($op->od_id)==1 && $op->od_id != -1 ) { $op->delete(); } $request_sa='jrn'; } // if $_REQUEST[sa] == jrn show the predefined operation for this // ledger if ( $request_sa== 'jrn' ) { $op=new Pre_operation($cn); $op->set_jrn($get_jrn); $is_ods = $cn->get_value("select count(*) from jrn_def where jrn_def_id=$1 and jrn_def_type='ODS'", array($get_jrn)); $op->od_direct = ($is_ods > 0) ? 't' : 'f'; $array = $op->get_list_ledger(); if (empty($array) == true) { echo _("Aucun enregistrement"); return; } echo HtmlInput::filter_table('preod_table', '0', 0); echo ''; $count=0; foreach ($array as $row ) { if ( $count %2 == 0 ) echo ''; else echo ''; $count++; echo ''; echo ''; echo ''; $b=HtmlInput::button('mod'.$row['od_id'],"Modifier","onclick=\"mod_predf_op('".dossier::id()."','".$row['od_id']."');\""); echo td($b); echo ''; } echo '
'.h($row['od_name']).''.h($row['od_description']).''; echo '
'; echo dossier::hidden(); echo HtmlInput::hidden("sa","del"); echo HtmlInput::hidden("ac",$request_ac); echo HtmlInput::hidden("del",""); echo HtmlInput::hidden("od_id",$row['od_id']); echo HtmlInput::hidden("jrn",$get_jrn); $b=''; echo $b; echo '
'; echo '
'; } echo '
'; ?>