get_first('ODS'); $ledger->id = ($ledger->id == -1) ? $first_ledger['jrn_def_id'] : $id_ledger; // check if we can write in the ledger if ( $g_user->check_jrn($ledger->id)=='X') { alert(_("Vous ne pouvez pas écrire dans ce journal, contacter votre administrateur")); return; } echo '
'; echo '
'; echo HtmlInput::hidden('p_jrn_predef', $ledger->id); $op = new Pre_op_ods($cn); $op->set('ledger', $ledger->id); $op->set('ledger_type', "ODS"); $op->set('direct', 't'); $url=http_build_query(array('action'=>'use_opd','p_jrn_predef'=>$ledger->id,'ac'=>$_REQUEST['ac'],'gDossier'=>dossier::id())); echo $op->form_get('do.php?'.$url); echo '
'; echo '
'; echo '

' . $ledger->get_name() . '

'; echo '
'; // Show the predef operation // Don't forget the p_jrn $p_post=$_POST; if ( isset ($_GET['action']) && ! isset($_POST['correct'])) { if ( $_GET['action']=='use_opd') { // get data from predef. operation $op=new Pre_op_advanced($cn); $p_post=null; if ( isset($_REQUEST['pre_def']) && $_REQUEST['pre_def'] != '') { $op->set_od_id($_REQUEST['pre_def']); $p_post=$op->compute_array(); } } } $p_msg=(isset($p_msg))?$p_msg:""; print '

'.$p_msg.'

'; echo '
'; echo dossier::hidden(); echo HtmlInput::request_to_hidden(array('ac')); echo $ledger->input($p_post); echo '
'; echo ''. ''.td(_('Débit')) . '' . td(_('Crédit')) . ' ' . td(_('Difference')) . ' '; echo '
'; echo '
'; $iconcerned=new IConcerned('jrn_concerned'); $iconcerned->amount_id="totalDeb"; echo "Opération rapprochée : ".$iconcerned->input(); echo '

'; echo HtmlInput::button('add', _('Ajout d\'une ligne'), 'onClick="quick_writing_add_row()"'); echo HtmlInput::submit('summary', _('Sauvez')); echo '

'; echo '
'; echo ""; echo create_script(" update_name()"); if ($g_parameter->MY_DATE_SUGGEST=='Y') { echo create_script(" get_last_date()"); } echo '
'; ?>