$choice = isset($_GET['choice']) ? $_GET['choice'] : 0; $r_jrn = isset($_GET['r_jrn']) ? $_GET['r_jrn'] : ''; echo '<form method="GET">'; echo dossier::hidden() . HtmlInput::hidden('ac', $_GET['ac']) . HtmlInput::hidden('type', 'rec'); echo _('Filtre par journal'); HtmlInput::button_choice_ledger(array('div' => '', 'type' => 'ALL', 'all_type' => 1)); echo '<br/>'; /* * Limit by date, default current exercice */ list($start, $end) = $g_user->get_limit_current_exercice(); $dstart = new IDate('p_start'); $dstart->value = isset($_REQUEST['p_start']) ? $_REQUEST['p_start'] : $start; $dend = new IDate('p_end'); $dend->value = isset($_REQUEST['p_end']) ? $_REQUEST['p_end'] : $end; echo "Opérations entre " . $dstart->input() . " jusque " . $dend->input(); echo '<ol style="list-style-type:none;">'; $radio->selected = $choice == 0 ? true : false; $radio->value = 0; echo '<li>' . $radio->input() . _('Opérations rapprochées') . '</li>'; $radio->selected = $choice == 1 ? true : false; $radio->value = 1; echo '<li>' . $radio->input() . _('Opérations rapprochées avec des montants différents') . '</li>'; $radio->selected = $choice == 2 ? true : false; $radio->value = 2; echo '<li>' . $radio->input() . _('Opérations rapprochées avec des montants identiques') . '</li>'; $radio->selected = $choice == 3 ? true : false; $radio->value = 3; echo '<li>' . $radio->input() . _('Opérations non rapprochées') . '</li>'; echo '</ol>'; echo HtmlInput::submit('vis', _('Visualisation'));
" onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'reverse_div_id')"> <?php echo _('Extourne'); ?> </a></li> </ul> <div id="modele_div_id"> <?php echo Pre_operation::save_propose(); ?> </div> <div id="reverse_div_id" style="display:none;height:185px;height:10rem"> <?php $reverse_date = new IDate('reverse_date'); $reverse_ck = new ICheckBox('reverse_ck'); echo _('Extourne opération') . " " . $reverse_ck->input() . " "; echo $reverse_date->input(); ?> </div> <div id="document_div_id" style="display:none;height:185px;height:10rem"> <?php $file = new IFile(); $file->table = 0; echo '<p class="decale">'; echo _("Ajoutez une pièce justificative "); echo $file->input("pj", ""); echo '</p>'; ?> </div> </div> <?php echo HtmlInput::submit("save", _("Confirmer"));
*/ $date_start = HtmlInput::default_value_get('p_date_start', '01.01.' . $g_user->get_exercice()); $w_date_start = new IDate('p_date_start', $date_start); $w_select = new ISelect('p_type'); $w_select->value = array(array('value' => 'C', 'label' => _('Client')), array('value' => 'F', 'label' => _('Fournisseur'))); $w_select->selected = HtmlInput::default_value_get('p_type', 'C'); $w_lettre = new ISelect('p_let'); $w_lettre->value = array(array('value' => 'let', 'label' => _('lettrées et non lettrées')), array('value' => 'unlet', 'label' => _('non lettrées'))); $w_lettre->selected = HtmlInput::default_value_get('p_let', 'unlet'); ?> <form method="GET"> <?php echo HtmlInput::request_to_hidden(array('gDossier', 'ac')); ?> <?php printf(_(' Opérations après la date %s qui sont %s '), $w_date_start->input(), $w_lettre->input()); ?> <?php echo _("Type de tiers") . " " . $w_select->input(); ?> <?php echo HtmlInput::submit("view", _('Valider')); ?> </form> <?php if (!isset($_GET['view'])) { html_page_stop(); return; }
$p_start = new IDate('p_start'); $p_start->value = $limit['p_start']; $p_end = new IDate('p_end'); $p_end->value = $limit['p_end']; $p_exercice = new INum('p_exercice'); $p_exercice->value = $per->p_exercice; $html = ''; $html .= HtmlInput::anchor_close('mod_periode'); $html .= h2info(_('Modification période')); $html .= '<p> ' . _('Modifier les dates de début et fin de période') . '</p>'; $html .= '<p class="notice">' . _('Cela pourrait avoir un impact sur les opérations déjà existantes') . '</p>'; $html .= '<form method="post" onsubmit="return save_periode(this)">'; $html .= dossier::hidden(); $html .= '<table>'; $html .= tr(td(_(' Début période : ')) . td($p_start->input())); $html .= tr(td(_(' Fin période : ')) . td($p_end->input())); $html .= tr(td(_(' Exercice : ')) . td($p_exercice->input())); $html .= '</table>'; $html .= HtmlInput::submit('sauver', _('sauver')); $html .= HtmlInput::button('close', _('fermer'), 'onclick="removeDiv(\'mod_periode\')"'); $html .= HtmlInput::hidden('p_id', $_GET['p_id']); $html .= '</form>'; break; case 'save_per': $per = new Periode($cn, $_POST['p_id']); $per->load(); if (isDate($_POST['p_start']) == null || isDate($_POST['p_end'] == null) || isNumber($_POST['p_exercice']) == 0 || $_POST['p_exercice'] > 2099 || $_POST['p_exercice'] < 2000) { $html = ''; $html .= HtmlInput::anchor_close('mod_periode'); $html .= '<h2 class="info">' . _('Modifier les dates de début et fin de période') . '</h2>'; $html .= "<div class=\"error\">" . _('Erreur date invalide') . "</div>";
} ?> <?php echo HtmlInput::hidden('whatdiv', $div) . HtmlInput::hidden('jr_id', $jr_id) . dossier::hidden(); ?> <table style="width:100%"> <tr> <td> <table> <tr> <td> <?php $date = new IDate('p_date'); $date->value = format_date($obj->det->jr_date); echo td(_('Date')) . td($date->input()); ?> </td> </tr> <tr> <td> <?php $itext = new IText('lib'); $itext->value = strip_tags($obj->det->jr_comment); $itext->size = 40; echo td(_('Libellé')) . td($itext->input()); ?> </td> </tr> <tr>
$categorie->value = $cn->make_array('select fd_id,fd_label from fiche_def order by fd_label'); $categorie->selected = isset($_GET['cat']) ? $_GET['cat'] : 0; $str_categorie = $categorie->input(); $icall = new ICheckBox("allcard", 1); $icall->selected = isset($_GET['allcard']) ? 1 : 0; $str_icall = $icall->input(); /* periode */ $exercice = $g_user->get_exercice(); $iperiode = new Periode($cn); list($first, $last) = $iperiode->get_limit($exercice); $periode_start = new IDate('start'); $periode_end = new IDate('end'); $periode_start->value = isset($_GET['start']) ? $_GET['start'] : $first->first_day(); $periode_end->value = isset($_GET['end']) ? $_GET['end'] : $last->last_day(); $str_start = $periode_start->input(); $str_end = $periode_end->input(); /* histo ou summary */ $histo = new ISelect('histo'); $histo->value = array(array('value' => -1, 'label' => _('Liste')), array('value' => 0, 'label' => _('Historique')), array('value' => 1, 'label' => _('Historique Lettré')), array('value' => 6, 'label' => _('Historique Lettré et montants différents')), array('value' => 2, 'label' => _('Historique non Lettré')), array('value' => 3, 'label' => _('Résumé')), array('value' => 4, 'label' => _('Balance')), array('value' => 6, 'label' => _('Balance âgée')), array('value' => 7, 'label' => _('Balance âgée en-cours')), array('value' => 5, 'label' => _('Balance non soldée'))); $histo->javascript = 'onchange="if (this.value==3 || this.value==-1) { g("trstart").style.display="none";g("trend").style.display="none";g("allcard").style.display="none";} else {g("trstart").style.display="";g("trend").style.display="";g("allcard").style.display="";}"'; $histo->selected = isset($_GET['histo']) ? $_GET['histo'] : -1; $str_histo = $histo->input(); echo '<div class="content">'; echo '<FORM method="GET">'; echo dossier::hidden(); echo HtmlInput::hidden('ac', $_GET['ac']); require_once NOALYSS_INCLUDE . '/template/impress_cat_card.php'; echo HtmlInput::submit('cat_display', _('Recherche')); echo '</FORM>';
</div> <div id="add_todo_list" class="box" style="display:none"> <script charset="utf-8" type="text/javascript" language="javascript"> new Draggable($('add_todo_list'),{}); </script> <form method="post"> <?php $wDate = new IDate('p_date_todo'); $wDate->id = 'p_date_todo'; $wTitle = new IText('p_title'); $wDesc = new ITextArea('p_desc'); $wDesc->heigh = 5; $wDesc->width = 40; echo HtmlInput::title_box("Note", "add_todo_list", "hide"); echo _("Date") . " " . $wDate->input() . '<br>'; echo _("Titre") . " " . $wTitle->input() . '<br>'; echo _("Description") . "<br>" . $wDesc->input() . '<br>'; echo dossier::hidden(); echo HtmlInput::hidden('tl_id', 0); echo HtmlInput::submit('save_todo_list', _('Sauve'), 'onClick="Effect.Fold(\'add_todo_list\');return true;"'); echo HtmlInput::button('hide', _('Annuler'), 'onClick="Effect.Fold(\'add_todo_list\');return true;"'); ?> </form> </div> <script type="text/javascript" language="javascript" charset="utf-8"> function display_detail(div) { $(div).style.display="block"; // $(div).style.top=calcy('150')+'px'; //Effect.Grow(div,{});
function display_form_periode() { $str_dossier = dossier::get(); if ($this->jrn_def_id == 0) { $Res = $this->cn->exec_sql("select p_id,to_char(p_start,'DD.MM.YYYY') as date_start,to_char(p_end,'DD.MM.YYYY') as date_end,p_central,p_closed,p_exercice,\n (select count(jr_id) as count_op from jrn where jr_tech_per = p_id) as count_op\n from parm_periode\n order by p_start,p_end"); $Max = Database::num_row($Res); echo '<form id="periode_frm" method="POST" onsubmit="return confirm_box(this,\'Confirmez-vous la fermeture des périodes choisies ?\')" >'; echo HtmlInput::array_to_hidden(array('ac', 'gDossier', 'jrn_def_id', 'choose'), $_REQUEST); echo '<TABLE ALIGN="CENTER">'; echo "</TR>"; echo '<th>' . ICheckBox::toggle_checkbox("per_toggle", "periode_frm") . "</th>"; echo '<TH> Date début </TH>'; echo '<TH> Date fin </TH>'; echo '<TH> Exercice </TH>'; echo "</TR>"; for ($i = 0; $i < $Max; $i++) { $l_line = Database::fetch_array($Res, $i); $class = "even"; if ($i % 2 == 0) { $class = "odd"; } $style = ''; if ($l_line['p_closed'] == 't') { $style = "color:red"; } echo '<TR class="' . $class . '" style="' . $style . '">'; echo '<td>'; if ($l_line['p_closed'] == 'f') { $per_to_close = new ICheckBox('sel_per_close[]'); $per_to_close->value = $l_line['p_id']; echo $per_to_close->input(); } echo '</td>'; echo '<TD ALIGN="CENTER"> ' . $l_line['date_start'] . '</TD>'; echo '<TD ALIGN="CENTER"> ' . $l_line['date_end'] . '</TD>'; echo '<TD ALIGN="CENTER"> ' . $l_line['p_exercice'] . '</TD>'; if ($l_line['p_closed'] == 't') { $closed = $l_line['p_central'] == 't' ? '<TD>Centralisée</TD>' : '<TD>Fermée</TD>'; $change = '<TD></TD>'; $remove = sprintf(_('Nombre opérations %d'), $l_line['count_op']); $remove = td($remove, ' class="mtitle" '); $change = td('<A class="mtitle" HREF="javascript:void(0)"' . ' onclick="return confirm_box(null,\'' . _('Confirmez Réouverture') . ' ?\',function() {window.location=\'do.php?ac=' . $_REQUEST['ac'] . '&action=reopen&p_per=' . $l_line['p_id'] . '&' . $str_dossier . '\';} )"> Réouverture</A>', ' class="mtitle"'); } else { if ($l_line['count_op'] == 0) { $change = HtmlInput::display_periode($l_line['p_id']); } else { $change = "Non modifiable"; } $change = td($change, ' class="mtitle" '); $reopen = td(""); $remove = '<TD class="mtitle">'; if ($l_line['count_op'] == 0) { $go = 'do.php?' . http_build_query(array('ac' => $_REQUEST['ac'], 'action' => 'delete_per', 'p_per' => $l_line['p_id'], 'gDossier' => Dossier::id())); $remove .= '<A class="mtitle" HREF="javascript:void(0)" ' . 'onclick="return confirm_box (null,\'' . _('Confirmez effacement ?') . '\',function() { window.location=\'' . $go . '\'});" >' . ' Efface</A>'; } else { $remove .= sprintf(_('Nombre opérations %d'), $l_line['count_op']); } $remove .= '</td>'; } echo $change; echo $remove; echo '</TR>'; } echo '</table>'; echo '<p style="text-align:center">'; echo HtmlInput::hidden("close_per", 1); echo HtmlInput::submit('close_per_bt', 'Fermeture des périodes sélectionnées'); echo '</p>'; echo '</form>'; $but = new IButton('show_per_add', 'Ajout d\'une période'); $but->javascript = "\$('periode_add_div').show();"; echo $but->input(); echo '<div class="inner_box" style="width:40%;" id="periode_add_div">'; echo HtmlInput::title_box("Ajout d'une période", "periode_add_div", "hide"); echo '<FORM METHOD="POST">'; echo dossier::hidden(); $istart = new IDate('p_date_start'); $iend = new IDate('p_date_end'); $iexercice = new INum('p_exercice'); $iexercice->size = 5; echo '<table>'; echo '<TR> '; echo td('Date de début'); echo td($istart->input()); echo '</tr><tr>'; echo td('Date de fin'); echo td($iend->input()); echo '</tr><tr>'; echo td('Exercice'); echo td($iexercice->input()); echo '</TABLE>'; echo HtmlInput::submit('add_per', 'Valider'); echo '</FORM>'; echo '</div>'; echo create_script("\$('periode_add_div').hide();new Draggable('periode_add_div',{starteffect:function()\n {\n new Effect.Highlight(obj.id,{scroll:window,queue:'end'});\n }}\n );"); } else { $Res = $this->cn->exec_sql("select p_id,to_char(p_start,'DD.MM.YYYY') as date_start,to_char(p_end,'DD.MM.YYYY') as date_end,status,p_exercice\n from parm_periode join jrn_periode using (p_id) where jrn_def_id=" . $this->jrn_def_id . "\n order by p_start,p_end"); $Max = Database::num_row($Res); $r = $this->cn->exec_sql('select jrn_Def_name from jrn_Def where jrn_Def_id=' . $this->jrn_def_id); $jrn_name = Database::fetch_result($r, 0, 0); echo '<h2> Journal ' . $jrn_name . '</h2>'; echo '<form id="periode_frm" method="POST" onsubmit="return confirm_box(this,\'Confirmez-vous la fermeture des périodes choisies ?\')" >'; echo HtmlInput::array_to_hidden(array('ac', 'gDossier', 'jrn_def_id', 'choose'), $_REQUEST); echo '<TABLE ALIGN="CENTER">'; echo "</TR>"; echo '<th>' . ICheckBox::toggle_checkbox("per_toggle", "periode_frm") . "</th>"; echo '<TH> Date début </TH>'; echo '<TH> Date fin </TH>'; echo '<TH> Exercice </TH>'; echo "</TR>"; for ($i = 0; $i < $Max; $i++) { $l_line = Database::fetch_array($Res, $i); if ($l_line['status'] != 'OP') { echo '<TR style="COLOR:RED">'; } else { echo '<TR>'; } echo '<td>'; if ($l_line['status'] == 'OP') { $per_to_close = new ICheckBox('sel_per_close[]'); $per_to_close->value = $l_line['p_id']; echo $per_to_close->input(); } echo '</td>'; echo '<TD ALIGN="CENTER"> ' . $l_line['date_start'] . '</TD>'; echo '<TD ALIGN="CENTER"> ' . $l_line['date_end'] . '</TD>'; echo '<TD ALIGN="CENTER"> ' . $l_line['p_exercice'] . '</TD>'; $closed = ""; if ($l_line['status'] != 'OP') { $go = 'do.php?' . http_build_query(array('ac' => $_REQUEST['ac'], 'action' => 'reopen', 'p_per' => $l_line['p_id'], 'gDossier' => Dossier::id(), 'jrn_def_id' => $this->jrn_def_id)); $closed = td('<A class="mtitle" HREF="javascript:void(0)" ' . 'onclick="return confirm_box(null,\'' . _('Confirmez Réouverture') . ' ?\',function() {window.location=\'' . $go . '\';} );"> Réouverture</A>', ' class="mtitle"'); } echo "{$closed}"; echo '</TR>'; } echo '</TABLE>'; echo '<p style="text-align:center">'; echo HtmlInput::submit('close_per', 'Fermeture des périodes sélectionnées'); echo '</p>'; echo '</form>'; } }
function form($p_readonly = 0) { $wDate = new IDate("pdate", $this->date); $wDate->table = 1; $wDate->size = 10; $wDate->readonly = $p_readonly; $wDescription = new IText("pdesc"); $wDescription->table = 0; $wDescription->size = 80; $wDescription->readonly = $p_readonly; // Show an existing operation // if (isset($this->a_operation[0])) { $wDate->value = $this->a_operation[0]->oa_date; $wDescription->value = $this->a_operation[0]->oa_description; } $ret = ""; $ret .= '<table style="result" >'; $ret .= "<TR>" . $wDate->input() . "</tr>"; $ret .= '<tr><td>Description</td>' . '<td colspan="3">' . $wDescription->input() . "</td></tr>"; $Plan = new Anc_Plan($this->db); $aPlan = $Plan->get_list(); $max = count($this->a_operation) < $this->nMaxRow ? $this->nMaxRow : count($this->a_operation); $ret .= '</table><table id="ago" style="width: 100%;">'; /* show 10 rows */ $ret .= "<tr>"; foreach ($aPlan as $d) { $idx = $d['id']; /* array of possible value for the select */ $aPoste[$idx] = $this->db->make_array("select po_id as value," . " po_name||':'||coalesce(po_description,'-') as label " . " from poste_analytique " . " where pa_id = " . $idx . " order by po_name "); $ret .= "<th> Poste </th>"; } $ret .= "<th></th>" . "<th> Montant</th>" . "<th>Débit</th>" . "</tr>"; for ($i = 0; $i < $max; $i++) { $ret .= "<tr>"; foreach ($aPlan as $d) { $idx = $d['id']; // init variable $wSelect = new ISelect("pop" . $i . "plan" . $idx); $wSelect->value = $aPoste[$idx]; $wSelect->size = 12; $wSelect->readOnly = $p_readonly; if (isset($this->a_operation[$i])) { $wSelect->selected = $this->a_operation[$i]->po_id; } $ret .= td($wSelect->input()); } $wAmount = new INum("pamount{$i}", 0.0); $wAmount->size = 12; $wAmount->table = 1; $wAmount->javascript = " onChange=format_number(this);caod_checkTotal()"; $wAmount->readOnly = $p_readonly; $wDebit = new ICheckBox("pdeb{$i}"); $wDebit->readOnly = $p_readonly; $wDebit->javascript = " onChange=caod_checkTotal()"; if (isset($this->a_operation[$i])) { $wSelect->selected = $this->a_operation[$i]->po_id; $wAmount->value = $this->a_operation[$i]->oa_amount; $wDebit->value = $this->a_operation[$i]->oa_debit; if ($wDebit->value == 't') { $wDebit->selected = true; } } // build the table $ret .= "<TD></TD>"; $ret .= $wAmount->input(); $ret .= td($wDebit->input()); $ret .= "</tr>"; } $ret .= "</table>"; if ($p_readonly == false) { $add_row = new IButton('Ajouter'); $add_row->label = _('Ajouter une ligne'); $add_row->javascript = 'anc_add_row(\'ago\');'; $ret .= HtmlInput::hidden('nbrow', $max); $ret .= $add_row->input(); } return $ret; }
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 "</TR>"; echo '<tr>'; //--- 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 '</tr>'; $aStep = array(array('value' => 0, 'label' => _('Pas d\'étape')), array('value' => 1, 'label' => _('1 mois'))); echo '<tr>'; echo td(_('Par étape de')); $w->id = 'p_step'; echo $w->input('p_step', $aStep); echo '</TR>'; echo '</TABLE>'; echo '<span class="notice"> ' . _('Attention : vous ne pouvez pas utiliser les étapes avec les dates calendriers.') . '</span>'; echo '<br>'; echo '<span class="notice">' . _('Les clauses FROM sont ignorés avec les dates calendriers') . '</span>'; echo '<br>'; print HtmlInput::submit('bt_html', _('Visualisation')); echo '</FORM>'; echo '<script>enable_type_periode()</script>';
$dest->extra = $list_recipient; $dest->set_attribute('typecard', $list_recipient); $dest->set_dblclick("fill_ipopcard(this);"); $dest->set_attribute('ipopup', 'ipopcard'); $dest->style = ' style="vertical-align:0%"'; echo HtmlInput::title_box(_('Nouvel événement'), 'action_add_div'); ?> <span class="notice" style="float:right" id="action_add_frm_info"></span> <form method="get" id="action_add_frm" onsubmit="action_save_short(<?php echo Dossier::id(); ?> );return false"> <p> <span> Date<?php echo $date->input(); ?> </span> <span> Type évenement <?php echo $type->input(); ?> </span> Priorité <?php echo $priority->input(); ?> groupe <?php echo $profile->input();
$rec = new Acc_Reconciliation($cn); $rec->set_jr_id($jr_id); $rec->remove($_GET['jr_id2']); } break; //////////////////////////////////////////////////////////////////////////// // ask for a date for reversing the operation //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// // ask for a date for reversing the operation //////////////////////////////////////////////////////////////////////////// case 'ask_extdate': $date = new IDate('p_date'); $html .= "<form id=\"form_" . $div . "\" onsubmit=\"return reverseOperation(this);\">"; $html .= HtmlInput::hidden('jr_id', $_REQUEST['jr_id']) . HtmlInput::hidden('div', $div) . dossier::hidden() . HtmlInput::hidden('act', 'reverseop'); $html .= '<h2 class="info">' . _('entrez une date') . ' </H2>' . $date->input(); $html .= HtmlInput::submit('x', 'accepter'); $html .= HtmlInput::button_close($div); $html .= '</form>'; break; //////////////////////////////////////////////////////////////////////////// // Reverse an operation //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// // Reverse an operation //////////////////////////////////////////////////////////////////////////// case 'reverseop': if ($access == 'W') { ob_start(); try { $cn->start();
function input($p_array = null, $p_readonly = 0) { global $g_parameter, $g_user; if ($p_array != null) { extract($p_array); } $flag_tva = $g_parameter->MY_TVA_USE; /* Add button */ $f_add_button = new IButton('add_card'); $f_add_button->tabindex = -1; $f_add_button->label = _('Créer une nouvelle fiche'); $f_add_button->set_attribute('ipopup', 'ipop_newcard'); $f_add_button->set_attribute('jrn', $this->id); $f_add_button->javascript = "this.jrn=\$('p_jrn').value; select_card_type(this);"; $f_add_button2 = new IButton('add_card2'); $f_add_button2->tabindex = -1; $f_add_button2->label = _('Créer une nouvelle fiche'); $f_add_button2->set_attribute('ipopup', 'ipop_newcard'); $f_add_button2->set_attribute('filter', $this->get_all_fiche_def()); // $f_add_button2->set_attribute('jrn',$this->id); $f_add_button2->javascript = " this.jrn=\$('p_jrn').value;select_card_type(this);"; $str_add_button = ""; $str_add_button2 = ""; if ($g_user->check_action(FICADD) == 1) { $str_add_button = $f_add_button->input(); $str_add_button2 = $f_add_button2->input(); } // The first day of the periode $oPeriode = new Periode($this->db); list($l_date_start, $l_date_end) = $oPeriode->get_date_limit($g_user->get_periode()); if ($g_parameter->MY_DATE_SUGGEST == 'Y') { $op_date = !isset($e_date) ? $l_date_start : $e_date; } else { $op_date = !isset($e_date) ? '' : $e_date; } $e_ech = isset($e_ech) ? $e_ech : ""; $e_comm = isset($e_comm) ? $e_comm : ""; $r = ''; $r .= dossier::hidden(); $f_legend = _('Client'); $Echeance = new IDate(); $Echeance->setReadOnly(false); $Echeance->tabindex = 2; $label = HtmlInput::infobulle(4); $f_echeance = $Echeance->input('e_ech', $e_ech, _('Echéance') . $label); $Date = new IDate(); $Date->setReadOnly(false); $f_date = $Date->input("e_date", $op_date); $f_periode = ''; // Periode //-- if ($this->check_periode() == true) { $l_user_per = $g_user->get_periode(); $def = isset($periode) ? $periode : $l_user_per; $period = new IPeriod("period"); $period->user = $g_user; $period->cn = $this->db; $period->value = $def; $period->type = OPEN; try { $l_form_per = $period->input(); } catch (Exception $e) { if ($e->getCode() == 1) { throw new Exception(_("Aucune période ouverte")); } } $label = HtmlInput::infobulle(3); $f_periode = '<td>' . _("Période comptable") . "</td> <td> {$label} " . $l_form_per . '</td>'; } /* if we suggest the next pj, then we need a javascript */ $add_js = ""; if ($g_parameter->MY_PJ_SUGGEST == 'Y') { $add_js = "update_pj();"; } if ($g_parameter->MY_DATE_SUGGEST == 'Y') { $add_js .= 'get_last_date();'; } $add_js .= 'update_name();'; $add_js .= 'update_pay_method();'; $add_js .= 'update_row("sold_item");'; $wLedger = $this->select_ledger('VEN', 2); if ($wLedger == null) { throw new Exception(_('Pas de journal disponible')); } $wLedger->table = 1; $wLedger->javascript = "onChange='update_predef(\"ven\",\"f\",\"" . $_REQUEST['ac'] . "\");{$add_js}'"; $wLedger->label = " Journal " . HtmlInput::infobulle(2); $f_jrn = $wLedger->input(); $Commentaire = new IText(); $Commentaire->table = 0; $Commentaire->setReadOnly(false); $Commentaire->size = 60; $Commentaire->tabindex = 3; $label = HtmlInput::infobulle(1); $f_desc = $Commentaire->input("e_comm", h($e_comm)); // PJ //-- /* suggest PJ ? */ $default_pj = ''; if ($g_parameter->MY_PJ_SUGGEST == 'Y') { $default_pj = $this->guess_pj(); } $pj = new IText(); $pj->table = 0; $pj->name = "e_pj"; $pj->size = 10; $pj->value = isset($e_pj) ? $e_pj : $default_pj; $f_pj = $pj->input() . HtmlInput::hidden('e_pj_suggest', $default_pj); // Display the customer //-- $fiche = 'deb'; // Save old value and set a new one //-- $e_client = isset($e_client) ? $e_client : ""; $e_client_label = " "; //str_pad("",100,"."); // retrieve e_client_label //-- if (strlen(trim($e_client)) != 0) { $fClient = new Fiche($this->db); $fClient->get_by_qcode($e_client); $e_client_label = $fClient->strAttribut(ATTR_DEF_NAME) . ' ' . ' Adresse : ' . $fClient->strAttribut(ATTR_DEF_ADRESS) . ' ' . $fClient->strAttribut(ATTR_DEF_CP) . ' ' . $fClient->strAttribut(ATTR_DEF_CITY) . ' '; } $W1 = new ICard(); $W1->label = "Client " . HtmlInput::infobulle(0); $W1->name = "e_client"; $W1->tabindex = 3; $W1->value = $e_client; $W1->table = 0; $W1->set_dblclick("fill_ipopcard(this);"); $W1->set_attribute('ipopup', 'ipopcard'); // name of the field to update with the name of the card $W1->set_attribute('label', 'e_client_label'); // name of the field to update with the name of the card $W1->set_attribute('typecard', 'deb'); // Add the callback function to filter the card on the jrn $W1->set_callback('filter_card'); $W1->set_function('fill_data'); $W1->javascript = sprintf(' onchange="fill_data_onchange(\'%s\');" ', $W1->name); $f_client_qcode = $W1->input(); $client_label = new ISpan(); $client_label->table = 0; $f_client = $client_label->input("e_client_label", $e_client_label); $f_client_bt = $W1->search(); // Record the current number of article $Hid = new IHidden(); $p_article = isset($nb_item) ? $nb_item : $this->get_min_row(); $r .= $Hid->input("nb_item", $p_article); $max = $p_article < $this->get_min_row() ? $this->get_min_row() : $p_article; $f_legend_detail = _("Détail articles vendus"); // For each article //-- for ($i = 0; $i < $max; $i++) { // Code id, price & vat code //-- $march = isset(${"e_march{$i}"}) ? ${"e_march{$i}"} : ""; $march_price = isset(${"e_march" . $i . "_price"}) ? ${"e_march" . $i . "_price"} : ""; if ($flag_tva == 'Y') { $march_tva_id = isset(${"e_march{$i}" . "_tva_id"}) ? ${"e_march{$i}" . "_tva_id"} : ""; $march_tva_amount = isset(${"e_march{$i}" . "_tva_amount"}) ? ${"e_march{$i}" . "_tva_amount"} : ""; } $march_label = isset(${"e_march" . $i . "_label"}) ? ${"e_march" . $i . "_label"} : ""; // retrieve the tva label and name //-- if (strlen(trim($march)) != 0 && strlen(trim($march_label)) == 0) { $fMarch = new Fiche($this->db); $fMarch->get_by_qcode($march); $march_label = $fMarch->strAttribut(ATTR_DEF_NAME); if ($flag_tva == 'Y') { if (!isset(${"e_march{$i}" . "_tva_id"})) { $march_tva_id = $fMarch->strAttribut(ATTR_DEF_TVA); } } } // Show input //-- $W1 = new ICard(); $W1->label = ""; $W1->name = "e_march" . $i; $W1->value = $march; $W1->table = 1; $W1->set_attribute('typecard', 'cred'); $W1->set_dblclick("fill_ipopcard(this);"); $W1->set_attribute('ipopup', 'ipopcard'); // name of the field to update with the name of the card $W1->set_attribute('label', 'e_march' . $i . '_label'); // name of the field with the price $W1->set_attribute('price', 'e_march' . $i . '_price'); // name of the field with the TVA_ID $W1->set_attribute('tvaid', 'e_march' . $i . '_tva_id'); // Add the callback function to filter the card on the jrn $W1->set_callback('filter_card'); $W1->set_function('fill_data'); $W1->javascript = sprintf(' onchange="fill_data_onchange(\'%s\');" ', $W1->name); $W1->readonly = false; $array[$i]['quick_code'] = $W1->input(); $array[$i]['bt'] = $W1->search(); // For computing we need some hidden field for holding the value $array[$i]['hidden'] = ''; if ($flag_tva == 'Y') { $array[$i]['hidden'] .= HtmlInput::hidden('tva_march' . $i, 0); } $htva = new INum('htva_march' . $i); $htva->readOnly = 1; $htva->value = 0; $array[$i]['htva'] = $htva->input(); if ($g_parameter->MY_TVA_USE == 'Y') { $tvac = new INum('tvac_march' . $i); } else { $tvac = new IHidden('tvac_march' . $i); } $tvac->readOnly = 1; $tvac->value = 0; $array[$i]['tvac'] = $tvac->input(); if ($g_parameter->MY_UPDLAB == 'Y') { $Span = new IText("e_march" . $i . "_label"); $Span->css_size = "100%"; } else { $Span = new ISpan("e_march" . $i . "_label"); } $Span->value = $march_label; $Span->setReadOnly(false); // card's name, price //-- $array[$i]['denom'] = $Span->input("e_march" . $i . "_label", $march_label); // price $Price = new INum(); $Price->setReadOnly(false); $Price->size = 9; $Price->javascript = "onBlur='format_number(this);clean_tva({$i});compute_ledger({$i})'"; $array[$i]['pu'] = $Price->input("e_march" . $i . "_price", $march_price); $array[$i]['tva'] = ''; $array[$i]['amount_tva'] = ''; // if tva is not needed then no tva field if ($flag_tva == 'Y') { // vat label //-- $Tva = new ITva_Popup($this->db); $Tva->in_table = true; $Tva->set_attribute('compute', $i); $Tva->js = 'onblur="format_number(this);clean_tva(' . $i . ');compute_ledger(' . $i . ')"'; $Tva->value = $march_tva_id; $array[$i]['tva'] = $Tva->input("e_march{$i}" . "_tva_id"); // vat amount //-- $wTva_amount = new INum(); $wTva_amount->readOnly = false; $wTva_amount->size = 6; $wTva_amount->javascript = "onBlur='format_number(this);compute_ledger({$i})'"; $array[$i]['amount_tva'] = $wTva_amount->input("e_march" . $i . "_tva_amount", $march_tva_amount); } // quantity //-- $quant = isset(${"e_quant{$i}"}) ? ${"e_quant{$i}"} : "1"; $Quantity = new INum(); $Quantity->setReadOnly(false); $Quantity->size = 8; $Quantity->javascript = "onChange='format_number(this);clean_tva({$i});compute_ledger({$i})'"; $array[$i]['quantity'] = $Quantity->input("e_quant" . $i, $quant); } // foreach article $f_type = _('Client'); ob_start(); require_once NOALYSS_INCLUDE . '/template/form_ledger_detail.php'; $r .= ob_get_contents(); ob_end_clean(); // Set correctly the REQUEST param for jrn_type $r .= HtmlInput::hidden('jrn_type', 'VEN'); $r .= HtmlInput::button('add_item', _('Ajout article'), ' onClick="ledger_add_row()"'); $r .= create_script("\$('" . $Date->id . "').focus()"); return $r; }
function input($p_array = null, $notused = 0) { global $g_parameter, $g_user; if ($p_array != null) { extract($p_array); } $pview_only = false; $min_article = $this->get_min_row(); $f_add_button = new IButton('add_card'); $f_add_button->label = _('Créer une nouvelle fiche'); $f_add_button->set_attribute('ipopup', 'ipop_newcard'); $f_add_button->set_attribute('jrn', $this->id); $f_add_button->javascript = " this.jrn=\$('p_jrn').value;select_card_type(this);"; $str_add_button = $g_user->check_action(FICADD) == 1 ? $f_add_button->input() : ""; // The first day of the periode $pPeriode = new Periode($this->db); list($l_date_start, $l_date_end) = $pPeriode->get_date_limit($g_user->get_periode()); if ($g_parameter->MY_DATE_SUGGEST == 'Y') { $op_date = !isset($e_date) ? $l_date_start : $e_date; } else { $op_date = !isset($e_date) ? '' : $e_date; } $r = ""; $r .= dossier::hidden(); $f_legend = 'Banque, caisse'; // Date //-- $Date = new IDate("e_date", $op_date); $Date->setReadOnly($pview_only); $f_date = $Date->input(); $f_period = ''; if ($this->check_periode() == true) { // Periode //-- $l_user_per = isset($periode) ? $periode : $g_user->get_periode(); $period = new IPeriod(); $period->cn = $this->db; $period->type = OPEN; $period->value = $l_user_per; $period->user = $g_user; $period->name = 'periode'; try { $l_form_per = $period->input(); } catch (Exception $e) { if ($e->getCode() == 1) { throw new Exception(_("Aucune période ouverte")); } } $label = HtmlInput::infobulle(3); $f_period = "Période comptable {$label}" . $l_form_per; } // Ledger (p_jrn) //-- $onchange = "update_bank();ajax_saldo('first_sold');update_name();update_row('fin_item');"; if ($g_parameter->MY_DATE_SUGGEST == 'Y') { $onchange .= 'get_last_date();'; } if ($g_parameter->MY_PJ_SUGGEST == 'Y') { $onchange .= 'update_pj();'; } $add_js = 'onchange="' . $onchange . '"'; $wLedger = $this->select_ledger('FIN', 2); if ($wLedger == null) { throw new Exception(_('Pas de journal disponible')); } $wLedger->javascript = $add_js; $label = " Journal " . HtmlInput::infobulle(2); $f_jrn = $label . $wLedger->input(); // retrieve bank name, code and account from the jrn_def.jrn_def_bank $f_bank = '<span id="bkname">' . $this->get_bank_name() . '</span>'; if ($this->bank_id == "") { echo h2("Journal de banque non configuré " . $this->get_name(), ' class="error"'); echo '<span class="error"> vous devez donner à ce journal un compte en banque (fiche), modifiez dans CFGLED</span>'; alert("Journal de banque non configuré " . $this->get_name()); } $f_legend_detail = 'Opérations financières'; //-------------------------------------------------- // Saldo begin end //------------------------------------------------- // Extrait $default_pj = ''; if ($g_parameter->MY_PJ_SUGGEST == 'Y') { $default_pj = $this->guess_pj(); } $wPJ = new IText('e_pj'); $wPJ->readonly = false; $wPJ->size = 10; $wPJ->value = isset($e_pj) ? $e_pj : $default_pj; $f_extrait = $wPJ->input() . HtmlInput::hidden('e_pj_suggest', $default_pj); $label = HtmlInput::infobulle(7); $first_sold = isset($first_sold) ? $first_sold : ""; $wFirst = new INum('first_sold', $first_sold); $last_sold = isset($last_sold) ? $last_sold : ""; $wLast = new INum('last_sold', $last_sold); $max = isset($nb_item) ? $nb_item : $min_article; $r .= HtmlInput::hidden('nb_item', $max); //-------------------------------------------------- // financial operation //------------------------------------------------- $array = array(); // Parse each " tiers" for ($i = 0; $i < $max; $i++) { $tiers = isset(${"e_other" . $i}) ? ${"e_other" . $i} : ""; $tiers_amount = isset(${"e_other{$i}" . "_amount"}) ? round(${"e_other{$i}" . "_amount"}, 2) : 0; $tiers_comment = isset(${"e_other{$i}" . "_comment"}) ? ${"e_other{$i}" . "_comment"} : ""; $operation_date = new IDate("dateop" . $i); $operation_date->value = isset(${'dateop' . $i}) ? ${'dateop' . $i} : ""; $array[$i]['dateop'] = $operation_date->input(); ${"e_other{$i}" . "_amount"} = isset(${"e_other{$i}" . "_amount"}) ? ${"e_other{$i}" . "_amount"} : 0; $W1 = new ICard(); $W1->label = ""; $W1->name = "e_other" . $i; $W1->id = "e_other" . $i; $W1->value = $tiers; $W1->extra = 'deb'; // credits $W1->typecard = 'deb'; $W1->style = ' style = "vertical-align:65%"'; $W1->set_dblclick("fill_ipopcard(this);"); $W1->set_attribute('ipopup', 'ipopcard'); // name of the field to update with the name of the card $W1->set_attribute('label', 'e_other_name' . $i); // name of the field to update with the name of the card $W1->set_attribute('typecard', 'filter'); // Add the callback function to filter the card on the jrn $W1->set_callback('filter_card'); $W1->set_function('fill_data'); $W1->javascript = sprintf(' onchange="fill_data_onchange(\'%s\');" ', $W1->name); $W1->readonly = $pview_only; $array[$i]['qcode'] = $W1->input(); $array[$i]['search'] = $W1->search(); // Card name // $card_name = ""; if ($tiers != "") { $fiche = new Fiche($this->db); $fiche->get_by_qcode($tiers); $card_name = $this->db->get_value("Select ad_value from fiche_detail where ad_id=\$1 and f_id=\$2", array(ATTR_DEF_NAME, $fiche->id)); } $wcard_name = new IText("e_other_name" . $i, $card_name); $wcard_name->id = $wcard_name->name; $wcard_name->readOnly = true; $array[$i]['cname'] = $wcard_name->input(); // Comment $wComment = new IText("e_other{$i}" . "_comment", $tiers_comment); $wComment->size = 35; $wComment->setReadOnly($pview_only); $array[$i]['comment'] = $wComment->input(); // amount $wAmount = new INum("e_other{$i}" . "_amount", $tiers_amount); $wAmount->size = 7; $wAmount->setReadOnly($pview_only); $array[$i]['amount'] = $wAmount->input(); // concerned ${"e_concerned" . $i} = isset(${"e_concerned" . $i}) ? ${"e_concerned" . $i} : ""; $wConcerned = new IConcerned("e_concerned" . $i, ${"e_concerned" . $i}); $wConcerned->tiers = "e_other" . $i; $wConcerned->setReadOnly($pview_only); $wConcerned->amount_id = "e_other" . $i . "_amount"; $wConcerned->paid = 'paid'; $array[$i]['concerned'] = $wConcerned->input(); } ob_start(); require_once NOALYSS_INCLUDE . '/template/form_ledger_fin.php'; $r .= ob_get_contents(); ob_end_clean(); $r .= create_script("\$('" . $Date->id . "').focus()"); return $r; }
echo dossier::hidden(); echo '<TABLE><TR>'; $cn = new Database(dossier::id()); $periode = new Periode($cn); $a = $periode->get_limit($g_user->get_exercice()); // $a is an array $first_day = $a[0]->first_day(); $last_day = $a[1]->last_day(); // filter on period $date_from = new IDate('from_periode'); $date_to = new IDate('to_periode'); $year = $g_user->get_exercice(); $date_from->value = isset($_REQUEST['from_periode']) && isDate($_REQUEST['from_periode']) != 0 ? $_REQUEST['from_periode'] : $first_day; $date_to->value = isset($_REQUEST['to_periode']) && isDate($_REQUEST['to_periode']) != 0 ? $_REQUEST['to_periode'] : $last_day; echo td(_('Depuis') . $date_from->input()); echo td(_('Jusque ') . $date_to->input()); $letter = new ICheckbox('letter'); $letter->selected = isset($_REQUEST['letter']) ? true : false; $from_poste = new IPoste('from_poste'); $from_poste->value = HtmlInput::default_value('from_poste', '', $_REQUEST); $from_poste->set_attribute('account', 'from_poste'); $to_poste = new IPoste('to_poste'); $to_poste->value = HtmlInput::default_value('to_poste', '', $_REQUEST); $to_poste->set_attribute('account', 'to_poste'); $solded = new ICheckbox('solded'); $solded->selected = isset($_REQUEST['solded']) ? true : false; echo '<tr>'; echo td(_('Depuis le poste')) . td($from_poste->input()); echo '</tr>'; echo '<tr>'; echo td(_("Jusqu'au poste")) . td($to_poste->input());
$search_start = $first_per->first_day(); } $start->value = isset($search_start) ? $search_start : $first_per->first_day(); $line = td('Date Debut') . td($start->input()); // end date $end = new IDate('search_end'); /* check if date are valid */ if (isset($search_end) && isDate($search_end) == null) { ob_start(); alert(_('Date malformée')); $date_error = ob_get_contents(); ob_end_clean(); $search_end = $last_per->last_day(); } $end->value = isset($search_end) ? $search_end : $last_per->last_day(); $line .= td(_('Date Fin')) . td($end->input()); $r .= tr($line); // Side $line = td(_('Debit / Credit')); $iside = new ISelect('side'); $iside->value = array(array('label' => _('Debit'), 'value' => 0), array('label' => _('Credit'), 'value' => 1), array('label' => _('Les 2'), 'value' => 3)); /** * * if $side is not then * - if jl_id exist and is > 0 show by default all the operation (=3) * - if jl_id does not exist or is < 0 then show by default the opposite * side */ if (!isset($side)) { // find the jl_id of the j_id $jl_id = $cn->get_value('select comptaproc.get_letter_jnt($1)', array($j_id));
function display_form($p_hidden = "") { /* if there is no analytic plan return */ $pa = new Anc_Plan($this->db); if ($pa->count() == 0) { echo '<div class="content">'; echo '<h2 class="error">' . _('Aucun plan défini') . '</h2>'; echo '</div>'; return; } $from = new IDate('from', 'from'); $from->size = 10; $from->value = $this->from; $to = new IDate('to', 'to'); $to->value = $this->to; $to->size = 10; $from_poste = new IAncCard('from_poste', 'from_poste'); $from_poste->size = 10; $from_poste->plan_ctl = 'pa_id'; $from_poste->value = $this->from_poste; $to_poste = new IAncCard('to_poste', 'to_poste'); $to_poste->value = $this->to_poste; $to_poste->size = 10; $hidden = new IHidden(); $r = dossier::hidden(); $r .= $hidden->input("result", "1"); $r .= HtmlInput::request_to_hidden(array('ac')); $r .= $p_hidden; $plan = new Anc_Plan($this->db); $plan_id = new ISelect("pa_id"); $plan_id->value = $this->db->make_array("select pa_id, pa_name from plan_analytique order by pa_name"); $plan_id->selected = $this->pa_id; $choose_from = new IButton(); $choose_from->name = _("Choix Poste"); $choose_from->label = _("Recherche"); $choose_from->javascript = "onClick=search_ca(" . dossier::id() . ",'from_poste','pa_id')"; $choose_to = new IButton(); $choose_to->name = _("Choix Poste"); $choose_to->label = _("Recherche"); $choose_to->javascript = "onClick=search_ca(" . dossier::id() . ",'to_poste','pa_id')"; $r .= HtmlInput::request_to_hidden(array('ac')); ob_start(); ?> <table> <tr> <td> <?php echo _('Depuis'); echo HtmlInput::infobulle(37); ?> </td> <td> <?php echo $from->input(); ?> </td> </tr> <tr> <td> <?php echo _('Jusque'); echo HtmlInput::infobulle(37); ?> </td> <td> <?php echo $to->input(); ?> </td> </tr> </table> <span style="padding:5px;margin:5px;display:block;"> <?php echo _("Plan Analytique :") . $plan_id->input(); echo HtmlInput::infobulle(42); ?> </span> <?php $r .= ob_get_clean(); $r .= _("Entre l'activité ") . $from_poste->input(); $r .= $choose_from->input(); $r .= _(" et l'activité ") . $to_poste->input(); $r .= $choose_to->input(); $r .= '</span>'; return $r; }
echo HtmlInput::hidden('sc', $_REQUEST['sc']); echo HtmlInput::hidden('f_id', $_REQUEST['f_id']); echo '<table width="50%">'; // limit of the year $exercice = $g_user->get_exercice(); $periode = new Periode($cn); list($first_per, $last_per) = $periode->get_limit($exercice); $start = new IDate('start'); $start->value = isset($_GET['start']) ? $_GET['start'] : $first_per->first_day(); $r = td(_('Date début')); $r .= td($start->input()); echo tr($r); $end = new IDate('end'); $end->value = isset($_GET['end']) ? $_GET['end'] : $last_per->last_day(); $r = td(_('Date fin')); $r .= td($end->input()); echo tr($r); // type of lettering : all, lettered, not lettered $sel = new ISelect('type_let'); $sel->value = array(array('value' => 0, 'label' => _('Toutes opérations')), array('value' => 1, 'label' => _('Opérations lettrées')), array('value' => 2, 'label' => _('Opérations NON lettrées'))); if (isset($_GET['type_let'])) { $sel->selected = $_GET['type_let']; } else { $sel->selected = 1; } $r = td("Filtre ") . td($sel->input()); echo tr($r); echo '</table>'; echo '<br>'; echo HtmlInput::submit("seek", _('Recherche')); echo '</FORM>';
$date_ech->value = format_date($obj->det->jr_ech); echo td(_('Echeance')) . td($date_ech->input()); ?> </tr> <tr> <td></td> <td> <?php echo _("Date paiement"); ?> </td> <td> <?php $date_paid = new IDate('p_date_paid'); $date_paid->value = format_date($obj->det->jr_date_paid); echo $date_paid->input(); ?> </td> </tr> <tr><td> <?php $bk = new Fiche($cn, $obj->det->array[0]['qp_supplier']); echo td(_('Fournisseur')); $view_card_detail = HtmlInput::card_detail($bk->get_quick_code(), h($bk->getName()), ' class="line" '); echo td($view_card_detail); ?> </td> </tr> <tr> <td>
/** * @brief Show the form to encode your operation * @param$p_array if you correct or use a predef operation (default = null) * @param$p_readonly 1 for readonly 0 for writable (default 0) *@exception if ledger not found * \return a string containing the form */ function input($p_array = null, $p_readonly = 0) { global $g_parameter, $g_user; $this->nb = $this->get_min_row(); if ($p_readonly == 1) { return $this->confirm($p_array); } if ($p_array != null) { extract($p_array); } $add_js = ""; if ($g_parameter->MY_PJ_SUGGEST == 'Y') { $add_js = "update_pj();"; } if ($g_parameter->MY_DATE_SUGGEST == 'Y') { $add_js .= 'get_last_date();'; } $add_js .= 'update_row("quick_item");'; $ret = ""; if ($g_user->check_action(FICADD) == 1) { /* Add button */ $f_add_button = new IButton('add_card'); $f_add_button->label = _('Créer une nouvelle fiche'); $f_add_button->set_attribute('ipopup', 'ipop_newcard'); $f_add_button->set_attribute('jrn', $this->id); $f_add_button->javascript = " this.jrn=\$('p_jrn').value;select_card_type(this);"; $f_add_button->input(); } $wLedger = $this->select_ledger('ODS', 2); if ($wLedger == null) { throw new Exception(_('Pas de journal disponible')); } $wLedger->javascript = "onChange='update_name();update_predef(\"ods\",\"t\",\"" . $_REQUEST['ac'] . "\");{$add_js}'"; $label = " Journal " . HtmlInput::infobulle(2); $ret .= $label . $wLedger->input(); // Load the javascript // $ret .= "<table>"; $ret .= '<tr ><td colspan="2" style="width:auto">'; $wDate = new IDate('e_date'); $wDate->readonly = $p_readonly; $e_date = isset($e_date) && trim($e_date) != '' ? $e_date : ''; $wDate->value = $e_date; $ret .= _("Date") . ' : ' . $wDate->input(); $ret .= '</td>'; /* insert periode if needed */ // Periode //-- if ($this->check_periode() == true) { $l_user_per = $g_user->get_periode(); $def = isset($periode) ? $periode : $l_user_per; $period = new IPeriod("period"); $period->user = $g_user; $period->cn = $this->db; $period->value = $def; $period->type = OPEN; try { $l_form_per = $period->input(); } catch (Exception $e) { if ($e->getCode() == 1) { echo _("Aucune période ouverte"); exit; } } $label = HtmlInput::infobulle(3); $f_periode = _("Période comptable") . " {$label} " . $l_form_per; $ret .= td($f_periode); } $wPJ = new IText('e_pj'); $wPJ->readonly = false; $wPJ->size = 10; /* suggest PJ ? */ $default_pj = ''; if ($g_parameter->MY_PJ_SUGGEST == 'Y') { $default_pj = $this->guess_pj(); } $wPJ->value = isset($e_pj) ? $e_pj : $default_pj; $ret .= '</tr>'; $ret .= '<tr >'; $ret .= '<td colspan="2" style="width:auto"> ' . _('Pièce') . ' : ' . $wPJ->input(); $ret .= HtmlInput::hidden('e_pj_suggest', $default_pj); $ret .= '</tr>'; $ret .= '</td>'; $ret .= '<tr>'; $ret .= '<td colspan="2" style="width:auto">'; $ret .= _('Libellé'); $wDescription = new IText('desc'); $wDescription->readonly = $p_readonly; $wDescription->size = "50"; $wDescription->value = isset($desc) ? $desc : ''; $ret .= $wDescription->input(); $ret .= '</td>'; $ret .= '</tr>'; $ret .= '</table>'; $nb_row = isset($nb_item) ? $nb_item : $this->nb; $ret .= HtmlInput::hidden('nb_item', $nb_row); $ret .= dossier::hidden(); $ret .= dossier::hidden(); $ret .= HtmlInput::hidden('jrn_type', $this->get_type()); $info = HtmlInput::infobulle(0); $info_poste = HtmlInput::infobulle(9); if ($g_user->check_action(FICADD) == 1) { $ret .= $f_add_button->input(); } $ret .= '<table id="quick_item" style="position:float;width:100%">'; $ret .= '<tr>' . '<th style="text-align:left">Quickcode' . $info . '</th>' . '<th style="text-align:left">' . _('Poste') . $info_poste . '</th>' . '<th style="text-align:left">' . _('Libellé') . '</th>' . '<th style="text-align:left">' . _('Montant') . '</th>' . '<th style="text-align:left">' . _('Débit') . '</th>' . '</tr>'; for ($i = 0; $i < $nb_row; $i++) { // Quick Code $quick_code = new ICard('qc_' . $i); $quick_code->set_dblclick("fill_ipopcard(this);"); $quick_code->set_attribute('ipopup', 'ipopcard'); // name of the field to update with the name of the card $quick_code->set_attribute('label', "ld" . $i); // name of the field to update with the name of the card $quick_code->set_attribute('typecard', 'filter'); // Add the callback function to filter the card on the jrn $quick_code->set_callback('filter_card'); $quick_code->set_function('fill_data'); $quick_code->javascript = sprintf(' onchange="fill_data_onchange(\'%s\');" ', $quick_code->name); $quick_code->value = isset(${'qc_' . $i}) ? ${'qc_' . $i} : ""; $quick_code->readonly = $p_readonly; $label = ''; if ($quick_code->value != '') { $Fiche = new Fiche($this->db); $Fiche->get_by_qcode($quick_code->value); $label = $Fiche->strAttribut(ATTR_DEF_NAME); } // Account $poste = new IPoste(); $poste->name = 'poste' . $i; $poste->set_attribute('jrn', $this->id); $poste->set_attribute('ipopup', 'ipop_account'); $poste->set_attribute('label', 'ld' . $i); $poste->set_attribute('account', 'poste' . $i); $poste->set_attribute('dossier', Dossier::id()); $poste->value = isset(${'poste' . $i}) ? ${"poste" . $i} : ''; $poste->dbl_click_history(); $poste->readonly = $p_readonly; if ($poste->value != '') { $Poste = new Acc_Account($this->db); $Poste->set_parameter('value', $poste->value); $label = $Poste->get_lib(); } // Description of the line $line_desc = new IText(); $line_desc->name = 'ld' . $i; $line_desc->size = 30; $line_desc->value = isset(${"ld" . $i}) ? ${"ld" . $i} : $label; // Amount $amount = new INum(); $amount->size = 10; $amount->name = 'amount' . $i; $amount->value = isset(${'amount' . $i}) ? ${"amount" . $i} : ''; $amount->readonly = $p_readonly; $amount->javascript = ' onChange="format_number(this);checkTotalDirect()"'; // D/C $deb = new ICheckBox(); $deb->name = 'ck' . $i; $deb->selected = isset(${'ck' . $i}) ? true : false; $deb->readonly = $p_readonly; $deb->javascript = ' onChange="checkTotalDirect()"'; $ret .= '<tr>'; $ret .= '<td>' . $quick_code->input() . $quick_code->search() . '</td>'; $ret .= '<td>' . $poste->input() . '<script> document.getElementById(\'poste' . $i . '\').onblur=function(){ if (trim(this.value) !=\'\') {document.getElementById(\'qc_' . $i . '\').value="";}}</script>' . '</td>'; $ret .= '<td>' . $line_desc->input() . '</td>'; $ret .= '<td>' . $amount->input() . '</td>'; $ret .= '<td>' . $deb->input() . '</td>'; $ret .= '</tr>'; // If readonly == 1 then show CA } $ret .= '</table>'; if (isset($this->with_concerned) && $this->with_concerned == true) { $oRapt = new Acc_Reconciliation($this->db); $w = $oRapt->widget(); $w->name = 'jrn_concerned'; $w->value = isset($jrn_concerned) ? $jrn_concerned : ""; $ret .= "Réconciliation/rapprochements : " . $w->input(); } $ret .= create_script("\$('" . $wDate->id . "').focus()"); return $ret; }
$per = new Periode($cn, $obj->det->jr_tech_per); if ($per->is_closed() == 0 && $owner->MY_STRICT == 'N' && $g_user->check_action(RMOPER) == 1) { $remove = new IButton('Effacer'); $remove->label = _('Effacer'); $remove->javascript = "return confirm_box(null,'Vous confirmez effacement ?',function () {removeOperation('" . $obj->det->jr_id . "'," . dossier::id() . ",'" . $div . "')})"; echo $remove->input(); } $reverse = new IButton('bext' . $div); $reverse->label = _('Extourner'); $reverse->javascript = "g('ext" . $div . "').style.display='block'"; echo $reverse->input(); echo '</p>'; echo '</form>'; echo '<div id="ext' . $div . '" class="inner_box" style="position:relative;top:-150px;display:none">'; $date = new IDate('ext_date'); $r = "<form id=\"form_" . $div . "\" onsubmit=\"return false;\">"; $r .= HtmlInput::hidden('jr_id', $_REQUEST['jr_id']) . HtmlInput::hidden('div', $div) . dossier::hidden() . HtmlInput::hidden('act', 'reverseop'); $r .= HtmlInput::title_box(_('Extourner'), 'ext' . $div, 'hide'); $r .= "<p>"; $r .= _("Extourner une opération vous permet de l'annuler par son écriture inverse"); $r .= "</p>"; $r .= _("entrez une date") . " :" . $date->input(); $r .= '<p style="text-align:center">'; $r .= HtmlInput::submit('x', 'accepter', 'onclick="confirm_box($(\'form_' . $div . '\'),\'Vous confirmez ? \',function () {$(\'form_' . $div . '\').divname=\'' . $div . '\';reverseOperation($(\'form_' . $div . '\'))}); return false"'); $r .= "</p>"; $r .= '</form>'; echo $r; echo '</div>'; } else { echo '</p>'; }
?> " onsubmit="todo_list_save(<?php echo $this->tl_id; ?> );return false"> <table> <tr> <td> <?php echo _("Date"); ?> </td> <td> <?php echo $wDate->input(); ?> </td> </tr> <tr> <td> <?php echo _("Titre"); ?> </td> <td> <?php echo h($wTitle->input()); ?>