Exemplo n.º 1
0
  * Efface po
  */
 if ($sa == "po_delete") {
     $po = new Anc_Account($cn, $_REQUEST['po_id']);
     $po->delete();
     $sa = "pa_detail";
 }
 // show the detail
 if ($sa == "pa_detail") {
     $new = new Anc_Plan($cn, $_GET['pa_id']);
     $wSa = HtmlInput::hidden("sa", "pa_update");
     $new->get();
     $ret .= '<div class="content">';
     $ret .= '<h2 class="info">' . _("Mise à jour") . '</h2>';
     $ret .= '<form method="post">';
     $ret .= dossier::hidden();
     $ret .= $new->form();
     $ret .= $wSa;
     $ret .= HtmlInput::submit("submit", _("Enregistre"));
     $ret .= HtmlInput::button_anchor(_('Efface'), '', 'remove_analytic_plan', 'onclick="return confirm_box(\'remove_analytic_plan\',\'Effacer ?\',function () {window.location=\'do.php?ac=' . $_REQUEST['ac'] . '&pa_id=' . $_GET['pa_id'] . '&sa=pa_delete&' . $str_dossier . '\';})"', 'smallbutton');
     $ret .= '</form>';
     /**
      * Detail now
      */
     $count = 0;
     $new = new Anc_Plan($cn, $_REQUEST['pa_id']);
     $new->get();
     $array = $new->get_poste_analytique(" order by po_name");
     $ret .= '<div class="content">';
     $ret .= '<table class="table_large">';
     $ret .= "<tr>";
Exemplo n.º 2
0
 function form($p_table = true)
 {
     $wType = new ISelect();
     $wType->name = 'p_type';
     $wType->value = self::$type;
     if (!$p_table) {
         $ret = '    <TR>
              <TD>
              <INPUT TYPE="TEXT" NAME="p_val" SIZE=7>
              </TD>
              <TD>
              <INPUT TYPE="TEXT" NAME="p_lib" size=50>
              </TD>
              <TD>
              <INPUT TYPE="TEXT" NAME="p_parent" size=5>
              </TD>
              <TD>';
         $ret .= $wType->input() . '</TD>';
         return $ret;
     } else {
         $ret = '<TABLE><TR>';
         $ret .= sprintf('<TD>' . _('Numéro de classe') . ' </TD><TD><INPUT TYPE="TEXT" name="p_val" value="%s"></TD>', $this->pcm_val);
         $ret .= "</TR><TR>";
         $ret .= sprintf('<TD>' . _('Libellé') . ' </TD><TD><INPUT TYPE="TEXT" size="70" NAME="p_lib" value="%s"></TD>', h($this->pcm_lib));
         $ret .= "</TR><TR>";
         $ret .= sprintf('<TD>' . _('Classe Parent') . '</TD><TD><INPUT TYPE="TEXT" name="p_parent" value="%s"></TD>', $this->pcm_val_parent);
         $ret .= '</tr><tr>';
         $wType->selected = $this->pcm_type;
         $ret .= "<td> Type de poste </td>";
         $ret .= '<td>' . $wType->input() . '</td>';
         $ret .= "</TR> </TABLE>";
         $ret .= dossier::hidden();
         return $ret;
     }
 }
Exemplo n.º 3
0
 function form($p_line = 0)
 {
     $r = "";
     if ($p_line == 0) {
         $p_line = count($this->aAcc_Report_row);
     }
     $r .= dossier::hidden();
     $r .= HtmlInput::hidden('line', $p_line);
     $r .= HtmlInput::hidden('fr_id', $this->id);
     $wForm = new IText();
     $r .= "Nom du rapport : ";
     $r .= $wForm->input('form_nom', $this->name);
     $r .= '<TABLE id="rap1" width="100%">';
     $r .= "<TR>";
     $r .= "<TH> Position </TH>";
     $r .= "<TH> Texte </TH>";
     $r .= "<TH> Formule</TH>";
     $r .= '</TR>';
     $wName = new IText();
     $wName->size = 40;
     $wPos = new IText();
     $wPos->size = 3;
     $wForm = new IText();
     $wForm->size = 35;
     for ($i = 0; $i < $p_line; $i++) {
         $r .= "<TR>";
         $r .= "<TD>";
         $wPos->value = isset($this->aAcc_Report_row[$i]->fo_pos) ? $this->aAcc_Report_row[$i]->fo_pos : $i + 1;
         $r .= $wPos->input("pos" . $i);
         $r .= '</TD>';
         $r .= "<TD>";
         $wName->value = isset($this->aAcc_Report_row[$i]->fo_label) ? $this->aAcc_Report_row[$i]->fo_label : "";
         $r .= $wName->input("text" . $i);
         $r .= '</TD>';
         $r .= '<td>';
         $search = new IPoste("form" . $i);
         $search->size = 50;
         $search->value = isset($this->aAcc_Report_row[$i]->fo_formula) ? $this->aAcc_Report_row[$i]->fo_formula : "";
         $search->label = _("Recherche poste");
         $search->set_attribute('gDossier', dossier::id());
         $search->set_attribute('bracket', 1);
         $search->set_attribute('no_overwrite', 1);
         $search->set_attribute('noquery', 1);
         $search->set_attribute('account', $search->name);
         $search->set_attribute('ipopup', 'ipop_card');
         $r .= $search->input();
         $r .= '</td>';
         $r .= "</TR>";
     }
     $r .= "</TABLE>";
     $wButton = new IButton();
     $wButton->javascript = " rapport_add_row('" . dossier::id() . "')";
     $wButton->label = "Ajout d'une ligne";
     $r .= $wButton->input();
     return $r;
 }
 function show_button($p_string = "")
 {
     $r = "";
     $r .= '<form method="GET" action="export.php" style="display:inline">';
     $r .= $p_string;
     $r .= HtmlInput::hidden("to", $this->to);
     $r .= HtmlInput::hidden("act", "PDF:AncBalDouble");
     $r .= HtmlInput::hidden("from", $this->from);
     $r .= HtmlInput::hidden("pa_id", $this->pa_id);
     $r .= HtmlInput::hidden("from_poste", $this->from_poste);
     $r .= HtmlInput::hidden("to_poste", $this->to_poste);
     $r .= HtmlInput::hidden("pa_id2", $this->pa_id2);
     $r .= HtmlInput::hidden("from_poste2", $this->from_poste2);
     $r .= HtmlInput::hidden("to_poste2", $this->to_poste2);
     $r .= dossier::hidden();
     $r .= HtmlInput::submit('bt_pdf', "Export en PDF");
     $r .= '</form>';
     $r .= '<form method="GET" action="export.php"  style="display:inline">';
     $r .= HtmlInput::hidden("to", $this->to);
     $r .= HtmlInput::hidden("act", "CSV:AncBalDouble");
     $r .= HtmlInput::hidden("from", $this->from);
     $r .= HtmlInput::hidden("pa_id", $this->pa_id);
     $r .= HtmlInput::hidden("from_poste", $this->from_poste);
     $r .= HtmlInput::hidden("to_poste", $this->to_poste);
     $r .= HtmlInput::hidden("pa_id2", $this->pa_id2);
     $r .= HtmlInput::hidden("from_poste2", $this->from_poste2);
     $r .= HtmlInput::hidden("to_poste2", $this->to_poste2);
     $r .= $p_string;
     $r .= dossier::hidden();
     $r .= HtmlInput::submit('bt_csv', "Export en CSV");
     $r .= '</form>';
     return $r;
 }
Exemplo n.º 5
0
echo HtmlInput::anchor_close('mod_predf_op');
echo h2(_('Modification du nom'), ' class="title"');
echo '
    <form method="POST" onsubmit="save_predf_op(this);return false;">';
$name = new IText('opd_name');
$name->value = $op->od_name;
$name->size = 60;
echo "Nom =" . $name->input();
$opd_description = new ITextarea('od_description');
$opd_description->style = ' class="itextarea" style="width:30em;height:4em;vertical-align:top"';
$opd_description->value = $op->od_description;
echo '<p>';
echo _("Description (max 50 car.)");
echo $opd_description->input();
echo '</p>';
echo dossier::hidden() . HtmlInput::hidden('od_id', $_GET['id']);
echo "<hr>";
//////////////////////////////////////////////////////////////////////////////
// Detail operation
//////////////////////////////////////////////////////////////////////////////
echo $op->display();
echo HtmlInput::submit('save', _('Sauve'));
echo HtmlInput::button('close', _('Annuler'), 'onclick="removeDiv(\'mod_predf_op\')"');
echo '</form>';
$html1 = ob_get_contents();
ob_end_clean();
$html = escape_xml($html1);
if (headers_sent()) {
    echo $html1;
} else {
    header('Content-type: text/xml; charset=UTF-8');
Exemplo n.º 6
0
 function input_new()
 {
     $single = new Tool_Uos("dup");
     echo '<form method="post" style="display:inline">';
     echo $single->hidden();
     echo HtmlInput::hidden("p_action", "fiche");
     echo dossier::hidden();
     echo $this->input();
     //    CreateCategory($cn,$search);
     echo HtmlInput::submit("add_modele", _("Sauve"));
     echo '</FORM>';
 }
Exemplo n.º 7
0
$export_pdf .= HtmlInput::hidden('act', "PDF:fiche_balance") . ($export_pdf .= HtmlInput::hidden('start', $_GET['start']));
$export_pdf .= HtmlInput::hidden('end', $_GET['end']);
$export_pdf .= HtmlInput::hidden('histo', $_GET['histo']);
$export_pdf .= HtmlInput::request_to_hidden(array('allcard'));
$export_pdf .= dossier::hidden();
$export_pdf .= HtmlInput::submit('pdf', 'Export en PDF');
$export_pdf .= '</FORM>';
$export_print = HtmlInput::print_window();
$export_csv = '<FORM METHOD="get" ACTION="export.php" style="display:inline">';
$export_csv .= HtmlInput::hidden('cat', $_GET['cat']);
$export_csv .= HtmlInput::hidden('act', 'CSV:fiche_balance');
$export_csv .= HtmlInput::hidden('start', $_GET['start']);
$export_csv .= HtmlInput::hidden('end', $_GET['end']);
$export_csv .= HtmlInput::hidden('histo', $_GET['histo']);
$export_csv .= HtmlInput::request_to_hidden(array('allcard'));
$export_csv .= dossier::hidden();
$export_csv .= HtmlInput::submit('CSV', 'Export en CSV');
$export_csv .= '</FORM>';
/*
 * Date is important is requested balance
 */
if (isDate($_REQUEST['start']) == null || isDate($_REQUEST['end']) == null) {
    echo h2('Date invalide !', 'class="error"');
    alert('Date invalide !');
    return;
}
/*************************************************************************************************************************
 * Balance agée tous
/*************************************************************************************************************************/
if ($_GET['histo'] == 6) {
    require_once NOALYSS_INCLUDE . '/class_balance_age.php';
Exemplo n.º 8
0
 function display($p_array)
 {
     global $g_parameter, $g_user;
     require_once NOALYSS_INCLUDE . '/class_acc_ledger.php';
     $legder = new Acc_Ledger($this->db, $this->jrn_def_id);
     $legder->nb = $legder->get_min_row();
     if ($p_array != null) {
         extract($p_array);
     }
     $add_js = "";
     $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', $legder->id);
         $f_add_button->javascript = " this.jrn=\$('p_jrn').value;select_card_type(this);";
         $f_add_button->input();
     }
     $nb_row = isset($nb_item) ? $nb_item : $legder->nb;
     $ret .= HtmlInput::hidden('nb_item', $nb_row);
     $ret .= HtmlInput::hidden('p_jrn', $this->jrn_def_id);
     $ret .= dossier::hidden();
     $ret .= dossier::hidden();
     $ret .= HtmlInput::hidden('jrn_type', $legder->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="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);
         $quick_code->set_attribute('jrn', $legder->id);
         // 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->jrn = $legder->id;
         $quick_code->value = isset(${'qc_' . $i}) ? ${'qc_' . $i} : "";
         $label = '';
         if ($quick_code->value != '') {
             $Fiche = new Fiche($legder->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', $legder->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();
         if ($poste->value != '') {
             $Poste = new Acc_Account($legder->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->javascript = ' onChange="format_number(this);checkTotalDirect()"';
         // D/C
         $deb = new ICheckBox();
         $deb->name = 'ck' . $i;
         $deb->selected = isset(${'ck' . $i}) ? true : false;
         $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>';
     return $ret;
 }
Exemplo n.º 9
0
 /*----------------------------------------------------------------------
  * Search a card
  *
  *----------------------------------------------------------------------*/
 case 'fs':
     require_once NOALYSS_INCLUDE . '/class_acc_ledger.php';
     $r = HtmlInput::title_box(_("Détail fiche"), 'search_card');
     $r .= '<form method="GET" onsubmit="this.ctl=\'ipop_card\';search_get_card(this);return false;">';
     $q = new IText('query');
     $q->value = isset($query) ? $query : '';
     $r .= '<span style="margin-left:50px">';
     $r .= _('Fiche contenant') . HtmlInput::infobulle(19);
     $r .= $q->input();
     $r .= HtmlInput::submit('fs', _('Recherche'), "", "smallbutton");
     $r .= '</span>';
     $r .= dossier::hidden() . HtmlInput::hidden('op', 'fs');
     $array = array();
     foreach (array('query', 'inp', 'jrn', 'label', 'typecard', 'price', 'tvaid') as $i) {
         if (isset(${$i})) {
             $r .= HtmlInput::hidden($i, ${$i});
             $sql_array[$i] = ${$i};
         }
     }
     /* what is the type of the ledger */
     $type = "GL";
     if (isset($jrn) && $jrn > 1) {
         $ledger = new Acc_Ledger($cn, $jrn);
         $type = $ledger->get_type();
     }
     $fiche = new Fiche($cn);
     /* Build the SQL and show result */
Exemplo n.º 10
0
 $attr = sprintf('this.ctl=\'%s\';', $ipopup);
 $ctl .= '_content';
 $it = new IText('acc_query');
 $it->size = 30;
 $it->value = isset($q) ? $q : '';
 $str_poste = $it->input();
 $str_submit = HtmlInput::submit('sf', _('Recherche'), "", "smallbutton");
 $r = '';
 $r = HtmlInput::anchor_close('search_account');
 $r .= '<div> ' . h2(_('Poste Comptable'), ' class="title"') . '</div>';
 $r .= '<form id="sp" method="get" onsubmit="' . $attr . 'search_get_poste(this);return false;">';
 ob_start();
 require_once NOALYSS_INCLUDE . '/template/account_search.php';
 $r .= ob_get_contents();
 ob_end_clean();
 $r .= dossier::hidden();
 $r .= isset($c) ? HtmlInput::hidden('account', $c) : "";
 $r .= isset($l) ? HtmlInput::hidden('label', $l) : "";
 $r .= isset($j) ? HtmlInput::hidden('jrn', $j) : "";
 $r .= isset($nover) ? HtmlInput::hidden('nover', '1') : "";
 $r .= isset($nosearch) ? HtmlInput::hidden('nosearch', '1') : "";
 $r .= isset($bracket) ? HtmlInput::hidden('bracket', '1') : "";
 $r .= '</form>';
 $sql = "\n\t\tselect pcm_val,pcm_lib,array_to_string(array_agg(j_qcode) , ',') as acode\n\t\tfrom tmp_pcmn left join vw_poste_qcode on (j_poste=pcm_val) ";
 $sep = " where ";
 /* build the sql stmt */
 if (isset($j) && $j > 0 && isNumber($j)) {
     /* create a filter on the ledger */
     $ledger = new Acc_Account_Ledger($cn, 0);
     $fd_id = $ledger->build_sql_account($j);
     if ($fd_id != '') {
Exemplo n.º 11
0
         $side = 3;
     }
 } else {
     $iside->selected = $side;
 }
 $r .= tr($line . td($iside->input()));
 $r .= '</table>';
 $r .= '</div>';
 $r .= '<div style="float:left;padding-left:100">';
 $r .= HtmlInput::submit('search', 'Rechercher');
 $r .= '</div>';
 $r .= '</form>';
 $r .= '</div>';
 $form = '<div id="result" style="float:top;clear:both">';
 $form .= '<FORM id="letter_form" METHOD="post">';
 $form .= dossier::hidden();
 if (isset($_REQUEST['p_action'])) {
     $form .= HtmlInput::hidden('p_action', $_REQUEST['p_action']);
 }
 if (isset($_REQUEST['sa'])) {
     $form .= HtmlInput::hidden('sa', $_REQUEST['sa']);
 }
 if (isset($_REQUEST['acc'])) {
     $form .= HtmlInput::hidden('acc', $_REQUEST['acc']);
 }
 if (isset($_REQUEST['sc'])) {
     $form .= HtmlInput::hidden('sc', $_REQUEST['sc']);
 }
 if (isset($_REQUEST['sb'])) {
     $form .= HtmlInput::hidden('sb', $_REQUEST['sb']);
 }
 static function test_me()
 {
     $dossier = dossier::id();
     $cn = new Database($dossier);
     if (isset($_POST['go'])) {
         $b = new Anc_Group_Operation($cn);
         $b->get_from_array($_POST);
         return;
     }
     $a = new Anc_Group_Operation($cn);
     echo '<form method="post">';
     echo $a->form();
     echo dossier::hidden();
     echo '<input type="submit" name="go">';
     echo '</form>';
 }
Exemplo n.º 13
0
 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&eacute;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&eacute;e</TD>' : '<TD>Ferm&eacute;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&eacute;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>';
     }
 }
Exemplo n.º 14
0
 static function test_me()
 {
     $cn = new Database(dossier::id());
     $a = new Fiche($cn);
     $select_cat = new ISelect('fd_id');
     $select_cat->value = $cn->make_array('select fd_id,fd_label from fiche_def where frd_id=' . FICHE_TYPE_CLIENT);
     echo '<FORM METHOD="GET"> ';
     echo dossier::hidden();
     echo HtmlInput::hidden('test_select', $_GET['test_select']);
     echo 'Choix de la catégorie';
     echo $select_cat->input();
     echo HtmlInput::submit('go_card', 'Afficher');
     echo '</form>';
     if (isset($_GET['go_card'])) {
         $empty = $a->to_array($_GET['fd_id']);
         print_r($empty);
     }
 }
Exemplo n.º 15
0
 function show_button($p_string = '')
 {
     $r = "";
     $submit = HtmlInput::submit('', '');
     $hidden = new IHidden();
     /* for the export in PDF
         * Not yet needed, the html print should be enough
        $r.= '<form method="GET" action="ca_list_pdf.php" style="display:inline">';
        $r.= $p_string;
        $r.= dossier::hidden();
        $r.= $hidden->input("to",$this->to);
        $r.= $hidden->input("from",$this->from);
        $r.= $hidden->input("pa_id",$this->pa_id);
        $r.= $hidden->input("from_poste",$this->from_poste);
        $r.= $hidden->input("to_poste",$this->to_poste);
        $r.=HtmlInput::submit('bt_pdf',"Export en PDF");
        $r.= '</form>';
        */
     $r .= '<form method="GET" action="export.php"  style="display:inline">';
     $r .= HtmlInput::hidden("to", $this->to);
     $r .= HtmlInput::hidden("from", $this->from);
     $r .= HtmlInput::hidden("pa_id", $this->pa_id);
     $r .= HtmlInput::hidden("from_poste", $this->from_poste);
     $r .= HtmlInput::hidden("to_poste", $this->to_poste);
     $r .= HtmlInput::hidden('act', 'CSV:AncList');
     $r .= HtmlInput::hidden('ac', $_REQUEST['ac']);
     $r .= $p_string;
     $r .= dossier::hidden();
     $r .= HtmlInput::submit('bt_csv', "Export en CSV");
     $r .= '</form>';
     return $r;
 }
Exemplo n.º 16
0
 /**
  * @brief show the form for loading a template
  * @param p_action for the field action = destination url
  *
  *
  * @return string containing the forms
  */
 function form()
 {
     $r = '<p class="notice">';
     $r .= 'Veuillez introduire les mod&egrave;les servant à g&eacute;n&eacute;rer vos documents';
     $r .= '</p>';
     $r .= '<form enctype="multipart/form-data"  method="post">';
     $r .= dossier::hidden();
     // we need to add the sub action as hidden
     $h = new IHidden();
     $h->name = "sa";
     $h->value = "add_document";
     $r .= $h->input();
     $r .= '<table>';
     $t = new IText();
     $t->name = "md_name";
     $r .= "<tr><td> Nom </td><td>" . $t->input() . "</td>";
     $r .= "</tr>";
     $r .= "<tr><td>Catégorie de document </td>";
     $w = new ISelect();
     $w->name = "md_type";
     $w->value = $this->cn->make_array('select dt_id,dt_value from document_type order by dt_value');
     $r .= "<td>" . $w->input() . "</td></tr>";
     $r .= '<tr>';
     $r .= td(_('Affectation'));
     $waffect = new ISelect();
     $waffect->name = 'md_affect';
     $waffect->value = array(array('value' => 'ACH', 'label' => _('Uniquement journaux achat')), array('value' => 'VEN', 'label' => _('Uniquement journaux vente')), array('value' => 'GES', 'label' => _('Partie gestion')));
     $r .= td($waffect->input());
     $r .= '</tr>';
     $f = new IFile();
     $f->name = "doc";
     $r .= "<tr><td>fichier</td><td> " . $f->input() . "</td></tr>";
     $start = new IText();
     $start->name = "start_seq";
     $start->size = 9;
     $start->value = "0";
     $r .= "<tr><td> Numerotation commence a</td><td> " . $start->input() . "</td>";
     $r .= '<td class="notice">Si vous laissez &agrave; 0, la num&eacute;rotation ne changera pas, la prochaine facture sera n+1, n étant le n° que vous avez donn&eacute;</td>';
     $r .= "</tr>";
     $r .= '</table>';
     $r .= HtmlInput::submit('add_document', 'Ajout');
     $r .= "</form></p>";
     return $r;
 }
Exemplo n.º 17
0
}
require_once NOALYSS_INCLUDE . '/class_acc_reconciliation.php';
require_once NOALYSS_INCLUDE . '/function_javascript.php';
global $g_user;
/**
 *@file
 */
$aledger = $g_user->get_ledger('ALL', 3);
echo '<div class="noprint">';
echo '<div class="content">';
$rjrn = '';
$radio = new IRadio('choice');
$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;
Exemplo n.º 18
0
        if ($exercice->count() > 1) {
            $default = isset($_GET['ex']) ? $_GET['ex'] : $year;
            $dossier = dossier::id();
            if ($div != 'popup') {
                $obj = "{div:'{$div}',pcm_val:'" . $_GET['pcm_val'] . "',gDossier:'{$dossier}',select:this}";
                $is = $exercice->select('p_exercice', $default, ' onchange="update_history_account(' . $obj . ');"');
                $old = _("Autre exercice") . " " . $is->input();
            } else {
                $old = '<form method="get" action="popup.php">';
                $is = $exercice->select('ex', $default, 'onchange = "submit(this)"');
                $old .= _("Autre exercice") . " " . $is->input();
                $old .= HtmlInput::hidden('div', 'popup');
                $old .= HtmlInput::hidden('act', $_GET['act']);
                $old .= HtmlInput::hidden('pcm_val', $_GET['pcm_val']);
                $old .= HtmlInput::hidden('ajax', $_GET['ajax']);
                $old .= dossier::hidden();
                $old .= '</form>';
            }
        }
        ob_start();
        require_once NOALYSS_INCLUDE . '/template/history_top.php';
        if ($poste->HtmlTable($array) == -1) {
            echo h2($poste->id . " " . $poste->name, ' class="title"');
            echo h2(_("Aucune opération pour l'exercice courant"), 'class="error"');
        }
        echo $old;
        $html = ob_get_contents();
        ob_end_clean();
    }
}
$xml = escape_xml($html);
Exemplo n.º 19
0
    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;
    }
Exemplo n.º 20
0
 function display($p_array)
 {
     require_once NOALYSS_INCLUDE . '/class_acc_ledger_purchase.php';
     global $g_parameter, $g_user;
     extract($p_array);
     $ledger = new Acc_Ledger_Purchase($this->db, $this->jrn_def_id);
     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->label = _('Créer une nouvelle fiche');
     $f_add_button->tabindex = -1;
     $f_add_button->set_attribute('ipopup', 'ipop_newcard');
     $f_add_button->set_attribute('jrn', $this->jrn_def_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', $ledger->get_all_fiche_def());
     //    $f_add_button2->set_attribute('jrn',$ledger->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();
     }
     $r = "";
     $r .= dossier::hidden();
     $f_legend = _("En-tête facture fournisseur");
     $f_legend_detail = _("Détail articles acheté");
     // Ledger (p_jrn)
     //--
     /* if we suggest the next pj, then we need a javascript */
     $add_js = "";
     // Display the customer
     //--
     $fiche = 'cred';
     // Save old value and set a new one
     //--
     $e_client = isset($e_client) ? $e_client : "";
     $e_client_label = "&nbsp;";
     //str_pad("",100,".");
     // retrieve e_client_label
     //--
     if (strlen(trim($e_client)) != 0) {
         $fClient = new Fiche($ledger->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 = _("Fournisseur ") . 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', 'cred');
     // 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
     $min = $ledger->get_min_row();
     $p_article = isset($nb_item) ? $nb_item : $min;
     $max = $p_article < $min ? $min : $p_article;
     $e_comment = isset($e_comment) ? $e_comment : "";
     $Hid = new IHidden();
     $r .= $Hid->input("nb_item", $p_article);
     // 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"} : "";
         /* use vat */
         if ($g_parameter->MY_TVA_USE == '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($ledger->db);
             $fMarch->get_by_qcode($march);
             $march_label = $fMarch->strAttribut(ATTR_DEF_NAME);
             /* vat use */
             if (!isset($march_tva_id) && $g_parameter->MY_TVA_USE == 'Y') {
                 $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_dblclick("fill_ipopcard(this);");
         $W1->set_attribute('ipopup', 'ipopcard');
         $W1->set_attribute('typecard', 'deb');
         // 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('purchase', 'e_march' . $i . '_price');
         /* autocomplete */
         $W1->set_attribute('price', 'e_march' . $i . '_price');
         /* via search */
         // 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();
         $array[$i]['hidden'] = '';
         // For computing we need some hidden field for holding the value
         if ($g_parameter->MY_TVA_USE == 'Y') {
             $array[$i]['hidden'] .= HtmlInput::hidden('tva_march' . $i, 0);
         }
         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();
         $htva = new INum('htva_march' . $i);
         $htva->readOnly = 1;
         $htva->value = 0;
         $array[$i]['htva'] = $htva->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);
         if ($g_parameter->MY_TVA_USE == 'Y') {
             // vat label
             //--
             $Tva = new ITva_Popup($ledger->db);
             $Tva->js = "onblur=\"format_number(this);onChange=clean_tva({$i});compute_ledger({$i})\"";
             $Tva->in_table = true;
             $Tva->set_attribute('compute', $i);
             $Tva->value = $march_tva_id;
             $array[$i]['tva'] = $Tva->input("e_march{$i}" . "_tva_id");
             // Tva_amount
             // price
             $Tva_amount = new INum();
             $Tva_amount->setReadOnly(false);
             $Tva_amount->size = 9;
             $Tva_amount->javascript = "onBlur='format_number(this);compute_ledger({$i})'";
             $array[$i]['amount_tva'] = $Tva_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 = 9;
         $Quantity->javascript = "onChange=format_number(this);clean_tva({$i});compute_ledger({$i})";
         $array[$i]['quantity'] = $Quantity->input("e_quant" . $i, $quant);
     }
     $f_type = _('Fournisseur');
     ob_start();
     require_once NOALYSS_INCLUDE . '/template/predf_ledger_detail.php';
     $r .= ob_get_contents();
     ob_end_clean();
     // Set correctly the REQUEST param for jrn_type
     $r .= HtmlInput::hidden('jrn_type', 'ACH');
     $r .= HtmlInput::button('add_item', _('Ajout article'), ' onClick="ledger_add_row()"');
     return $r;
 }
Exemplo n.º 21
0
<div class="content" style="padding:0;">
    <?php 
require_once NOALYSS_INCLUDE . '/class_own.php';
$owner = new Own($cn);
?>

    <?php 
if ($access == 'W') {
    ?>
        <form  class="print" onsubmit="return op_save(this);">
        <?php 
}
?>

        <?php 
echo HtmlInput::hidden('whatdiv', $div) . HtmlInput::hidden('jr_id', $jr_id) . dossier::hidden();
?>
        <table style="width:100%">
            <tr><td>
                    <table>
                            <td></td>
                        <?php 
$date = new IDate('p_date');
$date->value = format_date($obj->det->jr_date);
echo td(_('Date')) . td($date->input());
?>
                        <tr>
                            <td></td>
                            <?php 
$date_ech = new IDate('p_ech');
$date_ech->value = format_date($obj->det->jr_ech);
Exemplo n.º 22
0
 /**
  * display screen to enter a new ledger
  */
 function input_new()
 {
     $retry = HtmlInput::default_value_post("sa", "");
     //            if ( $retry == "add") {
     $default_type = HtmlInput::default_value_post("p_jrn_type", -1);
     $previous_jrn_def_pj_pref = HtmlInput::default_value_post("jrn_def_pj_pref", "");
     $previous_p_description = HtmlInput::default_value_post("p_description", "");
     $previous_p_jrn_name = HtmlInput::default_value_post('p_jrn_name', '');
     $previous_p_jrn_type = HtmlInput::default_value_post("p_jrn_type", "");
     //            }
     global $g_user;
     $f_add_button = new ISmallButton('add_card');
     $f_add_button->label = _('Créer une nouvelle fiche');
     $f_add_button->tabindex = -1;
     $f_add_button->set_attribute('jrn', -1);
     $f_add_button->javascript = " this.jrn=-1;select_card_type({type_cat:4});";
     $str_add_button = "";
     if ($g_user->check_action(FICADD) == 1) {
         $str_add_button = $f_add_button->input();
     }
     $wSearch = new IPoste();
     $wSearch->table = 3;
     $wSearch->set_attribute('ipopup', 'ipop_account');
     $wSearch->set_attribute('account', 'p_jrn_class_deb');
     $wSearch->set_attribute('no_overwrite', '1');
     $wSearch->set_attribute('noquery', '1');
     $wSearch->name = "p_jrn_class_deb";
     $wSearch->size = 20;
     $search = $wSearch->input();
     // default for ACH
     $default_deb_purchase = $this->get_default_card('ACH', 'D');
     $default_cred_purchase = $this->get_default_card('ACH', 'C');
     // default for VEN
     $default_deb_sale = $this->get_default_card('VEN', 'D');
     $default_cred_sale = $this->get_default_card('VEN', 'C');
     // default for FIN
     $default_fin = $this->get_default_card("FIN", "");
     //default ods
     $default_ods = $this->get_default_card("ODS", "");
     /* construct all the hidden */
     $hidden = HtmlInput::hidden('p_jrn', -1);
     $hidden .= HtmlInput::hidden('p_action', 'jrn');
     $hidden .= HtmlInput::hidden('sa', 'add');
     $hidden .= dossier::hidden();
     $hidden .= HtmlInput::hidden('p_jrn_deb_max_line', 10);
     $hidden .= HtmlInput::hidden('p_ech_lib', 'echeance');
     /* properties of the ledger */
     $name = $previous_p_jrn_name;
     $code = "";
     $wType = new ISelect();
     $a_jrn = $this->db->make_array("select '-1',' -- " . _("choix du type de journal") . " -- ' union select jrn_type_id,jrn_desc from jrn_type");
     $wType->selected = '-1';
     $wType->value = $a_jrn;
     $wType->name = "p_jrn_type";
     $wType->id = "p_jrn_type_select_id";
     $wType->javascript = ' onchange="show_ledger_div()"';
     $wType->selected = $default_type;
     $type = $wType->input();
     $rcred = $rdeb = array();
     $wPjPref = new IText();
     $wPjPref->name = 'jrn_def_pj_pref';
     $wPjPref->value = $previous_jrn_def_pj_pref;
     $pj_pref = $wPjPref->input();
     $pj_seq = '';
     $last_seq = 0;
     $new = 1;
     $description = new ITextarea('p_description');
     $description->style = 'class="itextarea" style="margin:0px;"';
     $description->value = $previous_p_description;
     $str_description = $description->input();
     /* bank card */
     $qcode_bank = '';
     /* Numbering (only FIN) */
     $num_op = new ICheckBox('numb_operation');
     echo dossier::hidden();
     echo HtmlInput::hidden('ac', $_REQUEST['ac']);
     echo $hidden;
     $cn = $this->db;
     $min_row = new INum("min_row", MAX_ARTICLE);
     $min_row->prec = 0;
     require_once NOALYSS_INCLUDE . '/template/param_jrn.php';
 }
Exemplo n.º 23
0
 static function test_me()
 {
     if (isset($_GET['result'])) {
         ob_start();
         $cn = new Database(dossier::id());
         $a = new Acc_Bilan($cn);
         $a->get_request_get();
         $a->load();
         $form = $a->file_open_form();
         $a->compute_formula($form);
         fclose($form);
         // open the form
         $templ = $a->file_open_template();
         $r = $a->generate_odt($templ);
         fclose($templ);
         ob_end_clean();
         $a->send($r);
     } else {
         $cn = new Database(dossier::id());
         $a = new Acc_Bilan($cn);
         $a->get_request_get();
         echo '<form method="get">';
         echo $a->display_form();
         echo HtmlInput::hidden('test_select', $_GET['test_select']) . dossier::hidden();
         echo HtmlInput::submit('result', 'Sauve');
         echo '</form>';
     }
 }
Exemplo n.º 24
0
 echo '<TD><form method="GET" ACTION="export.php">' . dossier::hidden() . HtmlInput::submit('bt_pdf', "Export PDF") . HtmlInput::hidden("ac", $_REQUEST['ac']) . HtmlInput::hidden("act", "PDF:balance") . HtmlInput::hidden("from_periode", $_GET['from_periode']) . HtmlInput::hidden("to_periode", $_GET['to_periode']);
 echo HtmlInput::hidden('p_filter', $_GET['p_filter']);
 for ($e = 0; $e < count($selected); $e++) {
     if (isset($selected[$e]) && in_array($selected[$e], $array)) {
         echo HtmlInput::hidden("r_jrn[{$e}]", $selected[$e]);
     }
 }
 for ($e = 0; $e < count($array_cat); $e++) {
     if (isset($select_cat[$e])) {
         echo HtmlInput::hidden("r_cat[{$e}]", $e);
     }
 }
 echo HtmlInput::hidden("from_poste", $_GET['from_poste']) . HtmlInput::hidden("to_poste", $_GET['to_poste']);
 echo HtmlInput::get_to_hidden(array('lvl1', 'lvl2', 'lvl3', 'unsold', 'previous_exc'));
 echo "</form></TD>";
 echo '<TD><form method="GET" ACTION="export.php">' . HtmlInput::submit('bt_csv', "Export CSV") . dossier::hidden() . HtmlInput::hidden("act", "CSV:balance") . HtmlInput::hidden("from_periode", $_GET['from_periode']) . HtmlInput::hidden("to_periode", $_GET['to_periode']);
 echo HtmlInput::get_to_hidden(array('ac'));
 echo HtmlInput::hidden('p_filter', $_GET['p_filter']);
 for ($e = 0; $e < count($selected); $e++) {
     if (isset($selected[$e]) && in_array($selected[$e], $array)) {
         echo HtmlInput::hidden("r_jrn[{$e}]", $selected[$e]);
     }
 }
 for ($e = 0; $e < count($array_cat); $e++) {
     if (isset($select_cat[$e])) {
         echo HtmlInput::hidden("r_cat[{$e}]", $e);
     }
 }
 echo HtmlInput::hidden("from_poste", $_GET['from_poste']) . HtmlInput::hidden("to_poste", $_GET['to_poste']);
 echo HtmlInput::get_to_hidden(array('unsold', 'previous_exc'));
 echo "</form></TD>";
Exemplo n.º 25
0
 function test_me()
 {
     $cn = new Database(dossier::id());
     $anco = new Anc_Operation($cn);
     $j_id = 200;
     $anco->j_id = $j_id;
     $array = $anco->get_by_jid($j_id);
     $a = $anco->to_request($array, 1);
     echo '<form>';
     echo dossier::hidden();
     echo HtmlInput::hidden('j_id', $j_id);
     echo HtmlInput::hidden('test_select', $_REQUEST['test_select']);
     echo $anco->display_table(1, 15002, 0);
     echo '<input type="submit" name="save">';
     echo '</form>';
     if (isset($_REQUEST['save'])) {
         echo "to_save";
         var_dump($_REQUEST);
     }
     var_dump($a);
 }
Exemplo n.º 26
0
ob_start();
$ag_id = HtmlInput::default_value_get("ag_id", "0");
if ($ag_id == 0) {
    throw new Exception('ag_id is null');
}
require_once 'class_acc_ledger.php';
$r = HtmlInput::title_box(_("Détail fiche"), 'search_card');
$r .= '<form id="search_card1_frm" method="GET" onsubmit="action_add_concerned_card(this);return false;">';
$q = new IText('query');
$q->value = isset($query) ? $query : '';
$r .= '<span style="margin-left:50px">';
$r .= _('Fiche contenant') . HtmlInput::infobulle(19);
$r .= $q->input();
$r .= HtmlInput::submit('fs', _('Recherche'), "", "smallbutton");
$r .= '</span>';
$r .= dossier::hidden() . HtmlInput::hidden('op', 'add_concerned_card');
$r .= HtmlInput::request_to_hidden(array('ag_id'));
$r .= '</form>';
$query = HtmlInput::default_value_get("query", "");
$sql_array['query'] = $query;
$sql_array['typecard'] = 'all';
$fiche = new Fiche($cn);
/* Build the SQL and show result */
$sql = $fiche->build_sql($sql_array);
/* We limit the search to MAX_SEARCH_CARD records */
$sql = $sql . ' order by vw_name limit ' . MAX_SEARCH_CARD;
$a = $cn->get_array($sql);
for ($i = 0; $i < count($a); $i++) {
    $array[$i]['quick_code'] = $a[$i]['quick_code'];
    $array[$i]['name'] = h($a[$i]['vw_name']);
    $array[$i]['accounting'] = $a[$i]['accounting'];
Exemplo n.º 27
0
        $last--;
    }
}
echo $last;
?>
</td>
</tr>
<tr>
<td>
<?php 
echo _("Redémarrer la séquence (laisser à 0 pour ne pas changer)");
?>
</td>
<td>
<?php 
$pj = new INum('seq');
$pj->value = 0;
echo $pj->input();
?>
</td>
</tr>

</table>
<?php 
echo HtmlInput::hidden('p_action', 'document');
echo dossier::hidden();
echo HtmlInput::hidden('sa', 'mod_template');
echo HtmlInput::hidden('id', $doc->md_id);
echo HtmlInput::submit("mod", _('Sauver'));
?>
</form>
Exemplo n.º 28
0
 /**
  *@brief display the button export CSV
  *@param $p_hidden is a string containing hidden items
  *@return html string
  */
 function show_button($p_hidden = "")
 {
     $r = "";
     $r .= '<form method="GET" action="export.php"  style="display:inline">';
     $r .= HtmlInput::hidden("act", "CSV:AncAccList");
     $r .= HtmlInput::hidden("to", $this->to);
     $r .= HtmlInput::hidden("from", $this->from);
     $r .= HtmlInput::hidden("pa_id", $this->pa_id);
     $r .= HtmlInput::hidden("from_poste", $this->from_poste);
     $r .= HtmlInput::hidden("to_poste", $this->to_poste);
     $r .= HtmlInput::hidden("card_poste", $this->card_poste);
     $r .= $p_hidden;
     $r .= dossier::hidden();
     $r .= HtmlInput::submit('bt_csv', "Export en CSV");
     $r .= '</form>';
     return $r;
 }
Exemplo n.º 29
0
    $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>';
}
Exemplo n.º 30
0
 /**
  * \brief Display the object, the tags for the FORM
  *        are in the caller. It will be used for adding and updating
  *        action
  * \note  If  ag_id is not equal to zero then it is an update otherwise
  *        it is a new document
  *
  * \param $p_view form will be in readonly mode (value: READ, UPD or NEW  )
  * \param $p_gen true we show the tag for generating a doc (value : true or false) and adding files
  * \param $p_base is the ac parameter
  * \param $retour is the html code for the return button
  * \note  update the reference number or the document type is not allowed
  *
  *
  * \return string containing the html code
  */
 function Display($p_view, $p_gen, $p_base, $retour = "")
 {
     global $g_user;
     if ($p_view == 'UPD') {
         $upd = true;
         $readonly = false;
     } elseif ($p_view == "NEW") {
         $upd = false;
         $readonly = false;
         $this->ag_ref = _("Nouveau");
     } elseif ($p_view == 'READ') {
         $upd = true;
         $readonly = true;
     } else {
         throw new Exception('class_action' . __LINE__ . 'Follow_Up::Display error unknown parameter' . $p_view);
     }
     // Compute the widget
     // Date
     $date = new IDate();
     $date->readOnly = $readonly;
     $date->name = "ag_timestamp";
     $date->id = "ag_timestamp";
     $date->value = $this->ag_timestamp;
     $remind_date = new IDate();
     $remind_date->readOnly = $readonly;
     $remind_date->name = "ag_remind_date";
     $remind_date->id = "ag_remind_date";
     $remind_date->value = $this->ag_remind_date;
     // Doc Type
     $doc_type = new ISelect();
     $doc_type->name = "dt_id";
     $doc_type->value = $this->db->make_array("select dt_id,dt_value from document_type order by dt_value", 1);
     $doc_type->selected = $this->dt_id;
     $doc_type->readOnly = $readonly;
     $str_doc_type = $doc_type->input();
     // Description
     $desc = new ITextArea();
     $desc->style = ' class="itextarea" style="width:80%;margin-left:0px"';
     $desc->name = "ag_comment";
     $desc->readOnly = $readonly;
     $acomment = $this->db->get_array("SELECT agc_id, ag_id, to_char(agc_date,'DD.MM.YYYY HH24:MI') as str_agc_date, agc_comment, tech_user\n\t\t\t\t FROM action_gestion_comment where ag_id=\$1 order by agc_id;", array($this->ag_id));
     // List opération liées
     $operation = $this->db->get_array("select ago_id,j.jr_id,j.jr_internal,j.jr_comment,to_char(j.jr_date,'DD.MM.YY') as str_date\n\t\t\tfrom jrn as j join action_gestion_operation as ago on (j.jr_id=ago.jr_id)\n\t\t\twhere ag_id=\$1 order by jr_date", array($this->ag_id));
     $iconcerned = new IConcerned('operation');
     // List related action
     $action = $this->db->get_array("\n\t\t\tselect ag_id,ag_ref,substr(ag_title,1,40) as sub_title,to_char(ag_timestamp,'DD.MM.YY') as str_date ,\n\t\t\t\tag_timestamp,dt_value\n\t\t\t\t\tfrom action_gestion\n\t\t\t\t\t join document_type on (ag_type=dt_id)\n\t\t\t\twhere\n\t\t\t\tag_id in (select aga_greatest from action_gestion_related where aga_least =\$1)\n\t\t\t\tor\n\t\t\t\tag_id in (select aga_least from action_gestion_related where aga_greatest =\$1)\n\t\t\t\torder by ag_timestamp", array($this->ag_id));
     $iaction = new IRelated_Action('action');
     $iaction->value = isset($this->action) ? $this->action : "";
     // state
     // Retrieve the value
     $a = $this->db->make_array("select s_id,s_value from document_state ");
     $state = new ISelect();
     $state->readOnly = $readonly;
     $state->name = "ag_state";
     $state->value = $a;
     $state->selected = $this->ag_state;
     $str_state = $state->input();
     // Retrieve the value if there is an attached doc
     $doc_ref = "";
     // Document id
     $h2 = new IHidden();
     $h2->name = "d_id";
     $h2->value = $this->d_id;
     if ($this->d_id != 0 && $this->d_id != "") {
         $h2->readonly = $p_view == 'NEW' ? false : true;
         $doc = new Document($this->db, $this->d_id);
         $doc->get();
         if (strlen(trim($doc->d_lob)) != 0) {
             $d_id = new IHidden();
             $doc_ref = "<p> Document " . $doc->anchor() . '</p>';
             $doc_ref .= $h2->input() . $d_id->input('d_id', $this->d_id);
         }
     }
     // title
     $title = new IText();
     $title->readOnly = $readonly;
     $title->name = "ag_title";
     $title->value = $this->ag_title;
     $title->size = 60;
     // Priority of the ag_priority
     $ag_priority = new ISelect();
     $ag_priority->readOnly = $readonly;
     $ag_priority->name = "ag_priority";
     $ag_priority->selected = $this->ag_priority;
     $ag_priority->value = array(array('value' => 1, 'label' => 'Haute'), array('value' => 2, 'label' => 'Moyenne'), array('value' => 3, 'label' => 'Basse'));
     $str_ag_priority = $ag_priority->input();
     // hour of the action (meeting) ag_hour
     $ag_hour = new IText();
     $ag_hour->readOnly = $readonly;
     $ag_hour->name = "ag_hour";
     $ag_hour->value = $this->ag_hour;
     $ag_hour->size = 6;
     $ag_hour->javascript = " onblur=check_hour('ag_hour');";
     $str_ag_hour = $ag_hour->input();
     // Profile in charged of the action
     $ag_dest = new ISelect();
     $ag_dest->readOnly = $readonly;
     $ag_dest->name = "ag_dest";
     // select profile
     $aAg_dest = $this->db->make_array("select  p_id as value, " . "p_name as label " . " from profile  where p_id in (select p_granted from user_sec_action_profile where ua_right='W' and p_id=" . $g_user->get_profile() . ") order by 2");
     $ag_dest->value = $aAg_dest;
     $ag_dest->selected = $this->ag_dest;
     $str_ag_dest = $ag_dest->input();
     // ag_ref
     // Always false for update
     $client_label = new ISpan();
     /* 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');
     $filter = $this->db->make_list('select fd_id from fiche_def ');
     $f_add_button->set_attribute('filter', $filter);
     $f_add_button->javascript = " select_card_type(this);";
     $str_add_button = $f_add_button->input();
     // f_id_dest sender
     if ($this->qcode_dest != NOTFOUND && strlen(trim($this->qcode_dest)) != 0) {
         $tiers = new Fiche($this->db);
         $tiers->get_by_qcode($this->qcode_dest);
         $qcode_dest_label = $tiers->strAttribut(1);
         $this->f_id_dest = $tiers->id;
     } else {
         $qcode_dest_label = $this->f_id_dest == 0 || trim($this->qcode_dest) == "" ? 'Interne ' : 'Error';
     }
     $h_ag_id = new IHidden();
     // if concerns another action : show the link otherwise nothing
     //
     // sender
     $w = new ICard();
     $w->readOnly = $readonly;
     $w->jrn = 0;
     $w->name = 'qcode_dest';
     $w->value = $this->f_id_dest != 0 ? $this->qcode_dest : "";
     $w->label = "";
     $list_recipient = $this->db->make_list('select fd_id from fiche_def where frd_id in (14,25,8,9,16)');
     $w->extra = $list_recipient;
     $w->set_attribute('typecard', $list_recipient);
     $w->set_dblclick("fill_ipopcard(this);");
     $w->set_attribute('ipopup', 'ipopcard');
     // name of the field to update with the name of the card
     $w->set_attribute('label', 'qcode_dest_label');
     // name of the field to update with the name of the card
     $w->set_attribute('typecard', $w->extra);
     $w->set_function('fill_data');
     $w->javascript = sprintf(' onchange="fill_data_onchange(\'%s\');" ', $w->name);
     $sp = new ISpan();
     $sp->name = 'qcode_dest_label';
     $sp->value = $qcode_dest_label;
     // autre - a refaire pour avoir plusieurs fiches
     // Sur le modèle des tags
     $ag_contact = new ICard();
     $ag_contact->readOnly = $readonly;
     $ag_contact->jrn = 0;
     $ag_contact->name = 'ag_contact';
     $ag_contact->value = '';
     $ag_contact->set_attribute('ipopup', 'ipopcard');
     if ($this->ag_contact != 0) {
         $contact = new Fiche($this->db, $this->ag_contact);
         $ag_contact->value = $contact->get_quick_code();
     }
     $ag_contact->label = "";
     $list_contact = $this->db->make_list('select fd_id from fiche_def where frd_id=16');
     $ag_contact->extra = $list_contact;
     $ag_contact->set_dblclick("fill_ipopcard(this);");
     // name of the field to update with the name of the card
     $ag_contact->set_attribute('label', 'ag_contact_label');
     // name of the field to update with the name of the card
     $ag_contact->set_attribute('typecard', $list_contact);
     $ag_contact->set_function('fill_data');
     $ag_contact->javascript = sprintf(' onchange="fill_data_onchange(\'%s\');" ', $ag_contact->name);
     $spcontact = new ISpan();
     $spcontact->name = 'ag_contact_label';
     $spcontact->value = '';
     $fiche_contact = new Fiche($this->db);
     $fiche_contact->get_by_qcode($this->ag_contact);
     if ($fiche_contact->id != 0) {
         $spcontact->value = $fiche_contact->strAttribut(ATTR_DEF_NAME);
     }
     $h_agrefid = new IHidden();
     $iag_ref = new IText("ag_ref");
     $iag_ref->value = $this->ag_ref;
     $iag_ref->readOnly = $p_view == "NEW" || $p_view == 'READ' ? true : false;
     $str_ag_ref = $iag_ref->input();
     // Preparing the return string
     $r = "";
     /* for new files */
     $upload = new IFile();
     $upload->name = "file_upload[]";
     $upload->readOnly = $readonly;
     $upload->value = "";
     $aAttachedFile = $this->db->get_array('select d_id,d_filename,d_description,d_mimetype,' . '\'show_document.php?' . Dossier::get() . '&d_id=\'||d_id as link' . ' from document where ag_id=$1', array($this->ag_id));
     /* create the select for document */
     $aDocMod = new ISelect();
     $aDocMod->name = 'doc_mod';
     $aDocMod->value = $this->db->make_array('select md_id,dt_value||\' : \'||md_name as md_name' . ' from document_modele join document_type on (md_type=dt_id)' . ' order by md_name');
     $str_select_doc = $aDocMod->input();
     /* if no document then do not show the generate button */
     if (empty($aDocMod->value)) {
         $str_submit_generate = "";
     } else {
         $str_submit_generate = HtmlInput::submit("generate", _("Génére le document"));
     }
     $ag_id = $this->ag_id;
     /* fid = Icard  */
     $icard = new ICard();
     $icard->jrn = 0;
     $icard->table = 0;
     $icard->extra2 = 'QuickCode';
     $icard->noadd = "no";
     $icard->extra = 'all';
     /* Text desc  */
     $text = new IText();
     $num = new INum();
     /* TVA */
     $itva = new ITva_Popup($this->db);
     $itva->in_table = true;
     $aCard = array();
     /* create aArticle for the detail section */
     $article_count = count($this->aAction_detail) == 0 ? MAX_ARTICLE : count($this->aAction_detail);
     /* Compute total */
     $tot_item = 0;
     $tot_vat = 0;
     for ($i = 0; $i < $article_count; $i++) {
         /* fid = Icard  */
         $icard = new ICard();
         $icard->jrn = 0;
         $icard->table = 0;
         $icard->noadd = "no";
         $icard->extra = 'all';
         $icard->name = "e_march" . $i;
         $tmp_ad = isset($this->aAction_detail[$i]) ? $this->aAction_detail[$i] : false;
         $icard->readOnly = $readonly;
         $icard->value = '';
         $aCard[$i] = 0;
         if ($tmp_ad) {
             $march = new Fiche($this->db);
             $f = $tmp_ad->get_parameter('qcode');
             if ($f != 0) {
                 $march->id = $f;
                 $icard->value = $march->get_quick_code();
                 $aCard[$i] = $f;
             }
         }
         $icard->set_dblclick("fill_ipopcard(this);");
         // name of the field to update with the name of the card
         $icard->set_attribute('label', "e_march" . $i . "_label");
         // name of the field to update with the name of the card
         $icard->set_attribute('typecard', $icard->extra);
         $icard->set_attribute('ipopup', 'ipopcard');
         $icard->set_function('fill_data');
         $icard->javascript = sprintf(' onchange="fill_data_onchange(\'%s\');" ', $icard->name);
         $aArticle[$i]['fid'] = $icard->search() . $icard->input();
         $text->javascript = ' onchange="clean_tva(' . $i . ');compute_ledger(' . $i . ')"';
         $text->css_size = "100%";
         $text->name = "e_march" . $i . "_label";
         $text->id = "e_march" . $i . "_label";
         $text->size = 40;
         $text->value = $tmp_ad ? $tmp_ad->get_parameter('text') : "";
         $text->readOnly = $readonly;
         $aArticle[$i]['desc'] = $text->input();
         $num->javascript = ' onchange="format_number(this);clean_tva(' . $i . ');compute_ledger(' . $i . ')"';
         $num->name = "e_march" . $i . "_price";
         $num->id = "e_march" . $i . "_price";
         $num->size = 8;
         $num->readOnly = $readonly;
         $num->value = $tmp_ad ? $tmp_ad->get_parameter('price_unit') : 0;
         $aArticle[$i]['pu'] = $num->input();
         $num->name = "e_quant" . $i;
         $num->id = "e_quant" . $i;
         $num->size = 8;
         $num->value = $tmp_ad ? $tmp_ad->get_parameter('quantity') : 0;
         $aArticle[$i]['quant'] = $num->input();
         $itva->name = 'e_march' . $i . '_tva_id';
         $itva->id = 'e_march' . $i . '_tva_id';
         $itva->value = $tmp_ad ? $tmp_ad->get_parameter('tva_id') : 0;
         $itva->readOnly = $readonly;
         $itva->js = ' onchange="format_number(this);clean_tva(' . $i . ');compute_ledger(' . $i . ')"';
         $itva->set_attribute('compute', $i);
         $aArticle[$i]['tvaid'] = $itva->input();
         $num->name = "e_march" . $i . "_tva_amount";
         $num->id = "e_march" . $i . "_tva_amount";
         $num->value = $tmp_ad ? $tmp_ad->get_parameter('tva_amount') : 0;
         $num->javascript = " onchange=\"compute_ledger('" . $i . " ')\"";
         $num->size = 8;
         $aArticle[$i]['tva'] = $num->input();
         $tot_vat = bcadd($tot_vat, $num->value);
         $num->name = "tvac_march" . $i;
         $num->id = "tvac_march" . $i;
         $num->value = $tmp_ad ? $tmp_ad->get_parameter('total') : 0;
         $num->size = 8;
         $aArticle[$i]['tvac'] = $num->input();
         $tot_item = bcadd($tot_item, $num->value);
         $aArticle[$i]['hidden_htva'] = HtmlInput::hidden('htva_march' . $i, 0);
         $aArticle[$i]['hidden_tva'] = HtmlInput::hidden('tva_march' . $i, 0);
         $aArticle[$i]['ad_id'] = $tmp_ad ? HtmlInput::hidden('ad_id' . $i, $tmp_ad->get_parameter('id')) : HtmlInput::hidden('ad_id' . $i, 0);
     }
     /* Add the needed hidden values */
     $r .= dossier::hidden();
     /* add the number of item */
     $Hid = new IHidden();
     $r .= $Hid->input("nb_item", $article_count);
     $r .= HtmlInput::request_to_hidden(array("closed_action", "remind_date_end", "remind_date", "sag_ref", "only_internal", "state", "qcode", "ag_dest_query", "action_query", "tdoc", "date_start", "date_end", "hsstate", "searchtag"));
     $a_tag = $this->tag_get();
     $menu = new Default_Menu();
     /* get template */
     ob_start();
     require 'template/detail-action.php';
     $content = ob_get_contents();
     ob_end_clean();
     $r .= $content;
     //hidden
     $r .= "<p>";
     $r .= $h2->input();
     $r .= $h_ag_id->input('ag_id', $this->ag_id);
     $hidden2 = new IHidden();
     $r .= $hidden2->input('f_id_dest', $this->f_id_dest);
     $r .= "</p>";
     return $r;
 }