Exemplo n.º 1
0
 /**
  * @brief show the cell content in Display for the tags
  * called also by ajax
  */
 function tag_cell()
 {
     global $g_user;
     $a_tag = $this->tag_get();
     $c = count($a_tag);
     for ($e = 0; $e < $c; $e++) {
         echo '<span style="border:1px solid black;margin-right:5px;">';
         echo $a_tag[$e]['t_tag'];
         if ($g_user->can_write_action($this->ag_id) == true) {
             $js_remove = sprintf("onclick=\"action_tag_remove('%s','%s','%s')\"", dossier::id(), $this->ag_id, $a_tag[$e]['t_id']);
             echo HtmlInput::anchor(SMALLX, "javascript:void(0)", $js_remove, ' class="smallbutton" style="padding:0px;display:inline" ');
         }
         echo '</span>';
         echo '&nbsp;';
         echo '&nbsp;';
     }
     $js = sprintf("onclick=\"action_tag_select('%s','%s')\"", dossier::id(), $this->ag_id);
     if ($g_user->can_write_action($this->ag_id) == true) {
         echo HtmlInput::button('tag_bt', 'Ajout tag', $js, 'smallbutton');
     }
 }
Exemplo n.º 2
0
  <h2 class="info"> <?php 
    echo _("Total lettré");
    ?>
</h2>
<span style="display:block;font-size:14px"><?php 
    echo _('Total Debit');
    ?>
   <?php 
    echo $amount_deb;
    ?>
</span>
<span style="display:block;font-size:14px"><?php 
    echo _('Total Credit');
    ?>
   <?php 
    echo $amount_cred;
    ?>
</span>
<span style="display:block;font-size:14px"><?php 
    echo _('Total') . " " . $side;
    ?>
   <?php 
    echo $delta;
    ?>
</span>

<?php 
}
echo HtmlInput::button('check_all', _('Sélectionner tout'), ' onclick="select_checkbox(\'letter_form\')"');
echo HtmlInput::button('check_none', _('Tout Désélectionner'), ' onclick="unselect_checkbox(\'letter_form\')"');
Exemplo n.º 3
0
        </td>
        <td>
        <span class="noprint" id="input_desc<?php 
        echo $aAttachedFile[$i]['d_id'];
        ?>
" style="display:none" >
              <input type="input" class="input_text" id="input_desc_txt<?php 
        echo $aAttachedFile[$i]['d_id'];
        ?>
" value="<?php 
        echo h($aAttachedFile[$i]['d_description']);
        ?>
">
              <?php 
        $js = sprintf("update_document('%s','%s')", dossier::id(), $aAttachedFile[$i]['d_id']);
        echo HtmlInput::button('save_desc' . $aAttachedFile[$i]['d_id'], _('Sauve'), 'onclick="' . $js . '"', 'smallbutton');
        ?>
        </span>
        <?php 
    } else {
        ?>
        </span>
        <?php 
    }
    $rmDoc = sprintf("return confirm_box(null,'" . _('Voulez-vous effacer le document') . " %s' , function(){remove_document('%s','%s');});", $aAttachedFile[$i]['d_filename'], dossier::id(), $aAttachedFile[$i]['d_id']);
    ?>
        </td>
        <td>
  <?php 
    if ($p_view != 'READ') {
        ?>
Exemplo n.º 4
0
 * @brief 
 * @param type $name Descriptionara
 */
echo HtmlInput::title_box("Poste comptable", "acc_update", "hide");
?>
<span id="acc_update_info" class="notice"></span>
<form method="post" id="acc_update_frm_id" onsubmit="pcmn_save();return false;">

<table style="width:100%">
<?php 
$r = td(_('Poste comptable'), 'style="width:20em;width:15rem;text-align:right"') . td($val->input());
echo tr($r);
$r = td(_('Description'), 'style="width:auto;text-align:right"') . td($lib->input());
echo tr($r);
$r = td(_('Parent'), 'style="width:auto;text-align:right"') . td($parent->input());
echo tr($r);
$r = td(_('Type'), 'style="width:auto;text-align:right"') . td($type->input());
echo tr($r);
?>
</table>
<?php 
echo HtmlInput::hidden('p_oldu', $pcmn_val);
echo HtmlInput::hidden('p_action', $action);
echo dossier::hidden();
$checkbox = new ICheckBox("delete_acc");
echo _('Cocher pour effacer') . " " . $checkbox->input();
echo '<hr>';
echo HtmlInput::submit('update', _('Sauve'));
echo HtmlInput::button('hide', _('Annuler'), 'onClick="$(\'acc_update\').hide();return true;"');
?>
</form>
Exemplo n.º 5
0
<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,{});
}
try {
var array=Array('customer_now_div','customer_late_div','supplier_now_div','supplier_late_div','action_now_div','action_late_div');
var i=0;
for  (i=0;i < array.length;i++) {
	new Draggable(array[i],{});
Exemplo n.º 6
0
        $p_post = null;
        if (isset($_REQUEST['pre_def']) && $_REQUEST['pre_def'] != '') {
            $op->set_od_id($_REQUEST['pre_def']);
            $p_post = $op->compute_array();
        }
    }
}
$p_msg = isset($p_msg) ? $p_msg : "";
print '<p class="notice">' . $p_msg . '</p>';
echo '<form method="post"  class="print">';
echo dossier::hidden();
echo HtmlInput::request_to_hidden(array('ac'));
echo $ledger->input($p_post);
echo '<div style="position:absolute;width:40%;right:20px">';
echo '<table class="info_op">' . '<tr>' . td(_('Débit')) . '<td id="totalDeb"></td>' . td(_('Crédit')) . ' <td id="totalCred"></td>' . td(_('Difference')) . ' <td id="totalDiff"></td>';
echo '</table>';
echo '</div>';
$iconcerned = new IConcerned('jrn_concerned');
$iconcerned->amount_id = "totalDeb";
echo "Opération rapprochée : " . $iconcerned->input();
echo '<p>';
echo HtmlInput::button('add', _('Ajout d\'une ligne'), 'onClick="quick_writing_add_row()"');
echo HtmlInput::submit('summary', _('Sauvez'));
echo '</p>';
echo '</form>';
echo "<script>checkTotalDirect();</script>";
echo create_script(" update_name()");
if ($g_parameter->MY_DATE_SUGGEST == 'Y') {
    echo create_script(" get_last_date()");
}
echo '</div>';
Exemplo n.º 7
0
    // if $l_id != 0
}
// $_POST[DATABASE]
?>
<h2> <?php 
echo _('Dossier Management');
?>
</h2>

<?php 
//---------------------------------------------------------------------------
// List of folder
if ($sa == 'list') {
    require_once NOALYSS_INCLUDE . '/class_sort_table.php';
    echo '<p>';
    echo HtmlInput::button(_('Ajouter'), _('Ajouter un dossier'), " onclick=\$('folder_add_id').show()");
    echo '</p>';
    $header = new Sort_Table();
    $url = $_SERVER['PHP_SELF'] . "?sa=list&action=" . $_REQUEST['action'];
    $header->add(_("id"), $url, " order by dos_id asc", " order by dos_id desc", "da", "dd");
    $header->add(_("Nom"), $url, " order by dos_name asc", " order by dos_name desc", "na", "nd");
    $header->add(_("Description"), $url, " order by dos_description asc", " order by dos_description  desc", "da", "dd");
    $repo = new Dossier(0);
    $repocn = new Database();
    $ord = isset($_REQUEST['ord']) ? $_REQUEST['ord'] : 'na';
    $sql_order = $header->get_sql_order($ord);
    $Res = $repocn->get_array("select *  from ac_dossier {$sql_order}");
    $compteur = 1;
    $template = "";
    echo '<div class="content">';
    echo '<span style="display:block">';
Exemplo n.º 8
0
		</td>
		<td>
			<?php 
    $v = $row['fd_create_account'] == 't' ? _("Automatique") : _("Manuel");
    echo $v;
    ?>
		</td>
		<td>
			<?php 
    echo $row['frd_text'];
    ?>
		</td>
		<td>
			<?php 
    echo h($row['fd_description']);
    ?>
		</td>
	</tr>


<?php 
}
?>
</table>
<?php 
echo HtmlInput::button("cat_fiche_def_add", _("Ajout d'une nouvelle catégorie"), "onclick=\"detail_category_show('detail_category_div','" . $dossier . "','-1')\"");
?>
</div>
<div id="detail_category_div" style="display:none"">

</div>
Exemplo n.º 9
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.º 10
0
 *   (at your option) any later version.
 *
 *   NOALYSS is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with NOALYSS; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
// Copyright Author Dany De Bontridder danydb@aevalys.eu
/**
 * @file
 * @brief show detail of a fiche_def (category of card) + Attribut
 *
 */
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
require_once NOALYSS_INCLUDE . '/class_fiche_def.php';
require_once NOALYSS_INCLUDE . '/class_tool_uos.php';
global $g_user;
$g_user->can_request(FICCAT, 0);
$fd = new Fiche_Def($cn, $_GET['id']);
if ($_GET['id'] > 0) {
    echo $fd->input_detail();
    echo HtmlInput::button("retour_b", _("Retour à la liste"), "onclick=\"\$('detail_category_div').hide();\$('list_cat_div').show()\"");
} else {
    $fd->input_new();
}
Exemplo n.º 11
0
         for ($i = 0; $i < count($array); $i++) {
             $class = $i % 2 == 0 ? ' class="even" ' : ' class="odd" ';
             $r .= '<tr ' . $class . ' id="select_cat_row_' . $array[$i]['fd_id'] . '">';
             $r .= '<td >';
             $r .= '<a href="javascript:void(0)" onclick="select_cat(\'' . $array[$i]['fd_id'] . '\')">' . h($array[$i]['fd_label']) . '</a>';
             $r .= '</td>';
             $r .= '<td>';
             $r .= '<a href="javascript:void(0)" onclick="select_cat(\'' . $array[$i]['fd_id'] . '\')">' . h($array[$i]['fd_description']) . '</a>';
             $r .= '</td>';
             $r .= "</tr>";
         }
         $r .= '</table>';
         $r .= HtmlInput::hidden('fd_id', 0);
         $r .= '<p style="text-align:center">';
         $r .= HtmlInput::submit('st', 'choix');
         $r .= HtmlInput::button('Annuler', _('Annuler'), " onclick=\"removeDiv('{$ctl}')\" ");
         $r .= '</p>';
         $r .= '</form>';
         $r .= '</div>';
         $html .= $r;
     }
     break;
     /*----------------------------------------------------------------------
       * SC save card
       * save the new card (insert)
       *
       ----------------------------------------------------------------------*/
 /*----------------------------------------------------------------------
   * SC save card
   * save the new card (insert)
   *
Exemplo n.º 12
0
    }
    echo '<table>';
    $count = 0;
    foreach ($array as $row) {
        if ($count % 2 == 0) {
            echo '<tr class="odd">';
        } else {
            echo '<tr class="even">';
        }
        $count++;
        echo '<td>' . h($row['od_name']) . '</td>';
        echo '<td>' . h($row['od_description']) . '</td>';
        echo '<td>';
        echo '<form method="POST" id="preod_frm" class="print" style="margin:0px;padding:0px;">';
        echo dossier::hidden();
        echo $hid->input("sa", "del");
        echo $hid->input("ac", $request_ac);
        echo $hid->input("del", "");
        echo $hid->input("od_id", $row['od_id']);
        echo $hid->input("jrn", $get_jrn);
        $b = '<input type="submit" class="smallbutton" value="' . _("Effacer") . '"' . ' onClick="return confirm_box(\'preod_frm\',\'' . _("Voulez-vous vraiment effacer cette operation ?") . '\');" >';
        echo $b;
        echo '</form>';
        echo '</td>';
        $b = HtmlInput::button('mod' . $row['od_id'], "Modifier", "onclick=\"mod_predf_op('" . dossier::id() . "','" . $row['od_id'] . "');\"");
        echo td($b);
        echo '</tr>';
    }
    echo '</table>';
}
echo '</div>';
Exemplo n.º 13
0
//----------------------------------------
// Correct the operations
//----------------------------------------
if (isset($_POST['correct'])) {
    $correct = 1;
}
//----------------------------------------
// Blank form
//----------------------------------------
echo '<div style="position:absolute" class="content">';
echo '<p class="notice">' . $p_msg . '</p>';
echo '<form class="print" name="form_detail" enctype="multipart/form-data" class="print" METHOD="POST">';
echo HtmlInput::hidden('ledger_type', 'fin');
echo HtmlInput::hidden('ac', $_REQUEST['ac']);
$array = isset($correct) ? $_POST : null;
// show select ledger
try {
    echo $Ledger->input($array);
    echo HtmlInput::button('add_item', _('Ajout article'), ' onClick="ledger_fin_add_row()"');
    echo HtmlInput::submit('save', _('Sauve'));
    echo HtmlInput::reset(_('Effacer'));
    if (!isset($_POST['e_date']) && $g_parameter->MY_DATE_SUGGEST == 'Y') {
        echo create_script(" get_last_date();ajax_saldo('first_sold');");
    } else {
        echo create_script(" ajax_saldo('first_sold');");
    }
    echo create_script(" update_name()");
} catch (Exception $ex) {
    echo $ex->getMessage();
}
return;
Exemplo n.º 14
0
            echo HtmlInput::hidden("ledger_type", "VEN");
            echo HtmlInput::hidden("ac", $_REQUEST['ac']);
            echo HtmlInput::hidden("sa", "p");
            echo $Ledger->input($array);
            echo '<div class="content">';
            echo $Ledger->input_paid();
            echo '</div>';
            echo '<script>';
            echo 'compute_all_ledger();';
            echo '</script>';
        }
    }
} catch (Exception $e) {
    alert($e->getMessage());
    return;
}
echo '<div class="content">';
echo HtmlInput::button('act', _('Actualiser'), 'onClick="compute_all_ledger();"');
echo HtmlInput::submit("view_invoice", _("Enregistrer"));
echo HtmlInput::reset(_('Effacer '));
echo '</div>';
echo "</FORM>";
/* if we suggest the pj n# the run the script */
if ($g_parameter->MY_PJ_SUGGEST == 'Y') {
    echo '<script> update_pj()</script>';
}
if (!isset($_POST['e_date']) && $g_parameter->MY_DATE_SUGGEST == 'Y') {
    echo create_script(" get_last_date()");
}
echo create_script(" update_name()");
return;
Exemplo n.º 15
0
?>
	<?php 
echo HtmlInput::submit("search", _("Recherche"));
?>
	<?php 
echo HtmlInput::request_to_hidden(array('ac', 'gDossier', 'ord'));
?>
</form>
     <?php 
echo _('Filtre'), HtmlInput::filter_table('menu_tb', '0,1,2,4', '1');
?>
</fieldset>
<?php 
$gDossier = Dossier::id();
echo HtmlInput::button("Add_plugin", _("Ajout d'un plugin"), "onclick=add_plugin({$gDossier})");
echo HtmlInput::button("Add_menu", _("Ajout d'un menu"), "onclick=create_menu({$gDossier})");
echo '<table class="result" id="menu_tb">';
echo '<tr>';
echo '<th>' . $table->get_header(0) . '</th>';
echo '<th>' . $table->get_header(1) . '</th>';
echo '<th>' . $table->get_header(2) . '</th>';
echo '<th>' . $table->get_header(3) . HtmlInput::infobulle(33) . '</th>';
echo '<th>' . $table->get_header(4) . '</th>';
echo '<th>' . $table->get_header(5) . '</th>';
echo '<th>' . $table->get_header(6) . '</th>';
echo '<th>' . $table->get_header(7) . '</th>';
echo '</tr>';
for ($i = 0; $i < Database::num_row($ret); $i++) {
    $row = $menu->get_object($ret, $i);
    $js = $row->me_code;
    switch ($row->me_type) {
Exemplo n.º 16
0
 /**
  * @brief this function is intended to test this class
  */
 static function test_me($pCase = '')
 {
     if ($pCase == '') {
         echo Acc_Reconciliation::$javascript;
         html_page_start();
         $cn = new Database(dossier::id());
         $_SESSION['g_user'] = '******';
         $_SESSION['g_pass'] = '******';
         $id = isset($_REQUEST['p_jrn']) ? $_REQUEST['p_jrn'] : -1;
         $a = new Acc_Ledger($cn, $id);
         $a->with_concerned = true;
         // Vide
         echo '<FORM method="post">';
         echo $a->select_ledger()->input();
         echo HtmlInput::submit('go', 'Test it');
         echo '</form>';
         if (isset($_POST['go'])) {
             echo "Ok ";
             echo '<form method="post">';
             echo $a->show_form();
             echo HtmlInput::submit('post_id', 'Try me');
             echo '</form>';
             // Show the predef operation
             // Don't forget the p_jrn
             echo '<form>';
             echo dossier::hidden();
             echo '<input type="hidden" value="' . $id . '" name="p_jrn">';
             $op = new Pre_operation($cn);
             $op->p_jrn = $id;
             $op->od_direct = 't';
             if ($op->count() != 0) {
                 echo HtmlInput::submit('use_opd', 'Utilisez une opération pr&eacute;d&eacute;finie', "", "smallbutton");
                 echo $op->show_button();
             }
             echo '</form>';
             exit('test_me');
         }
         if (isset($_POST['post_id'])) {
             echo '<form method="post">';
             echo $a->show_form($_POST, 1);
             echo HtmlInput::button('add', 'Ajout d\'une ligne', 'onClick="quick_writing_add_row()"');
             echo HtmlInput::submit('save_it', _("Sauver"));
             echo '</form>';
             exit('test_me');
         }
         if (isset($_POST['save_it'])) {
             print 'saving';
             $array = $_POST;
             $array['save_opd'] = 1;
             try {
                 $a->save($array);
             } catch (Exception $e) {
                 alert($e->getMessage());
                 echo '<form method="post">';
                 echo $a->show_form($_POST);
                 echo HtmlInput::submit('post_id', 'Try me');
                 echo '</form>';
             }
             return;
         }
         // The GET at the end because automatically repost when you don't
         // specify the url in the METHOD field
         if (isset($_GET['use_opd'])) {
             $op = new Pre_op_advanced($cn);
             $op->set_od_id($_REQUEST['pre_def']);
             //$op->p_jrn=$id;
             $p_post = $op->compute_array();
             echo '<FORM method="post">';
             echo $a->show_form($p_post);
             echo HtmlInput::submit('post_id', 'Use predefined operation');
             echo '</form>';
             return;
         }
     }
     // if case = ''
     ///////////////////////////////////////////////////////////////////////////
     // search
     if ($pCase == 'search') {
         html_page_start();
         $cn = new Database(dossier::id());
         $ledger = new Acc_Ledger($cn, 0);
         $_SESSION['g_user'] = '******';
         $_SESSION['g_pass'] = '******';
         echo $ledger->search_form('ALL');
     }
     ///////////////////////////////////////////////////////////////////////////
     // reverse
     // Give yourself the var and check in your tables
     ///////////////////////////////////////////////////////////////////////////
     if ($pCase == 'reverse') {
         $cn = new Database(dossier::id());
         $jr_internal = 'OD-01-272';
         try {
             $cn->start();
             $jrn_def_id = $cn->get_value('select jr_def_id from jrn where jr_internal=$1', array($jr_internal));
             $ledger = new Acc_Ledger($cn, $jrn_def_id);
             $ledger->jr_id = $cn->get_value('select jr_id from jrn where jr_internal=$1', array($jr_internal));
             echo "Ouvrez le fichier " . __FILE__ . " à la ligne " . __LINE__ . " pour changer jr_internal et vérifier le résultat de l'extourne";
             $ledger->reverse('01.07.2010');
         } catch (Exception $e) {
             $cn->rollback();
             var_dump($e);
         }
         $cn->commit();
     }
 }
Exemplo n.º 17
0
 *
 */
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
// Security
if ($g_user->check_module('CFGPRO') == 0) {
    die;
}
require_once NOALYSS_INCLUDE . '/class_profile_sql.php';
require_once NOALYSS_INCLUDE . '/class_profile_menu.php';
require_once NOALYSS_INCLUDE . '/class_html_input.php';
$p_id = HtmlInput::default_value_request('p_id', -1);
$profile = new Profile_sql($cn, $p_id);
$gDossier = Dossier::id();
$add_impression = HtmlInput::button("add", _("Ajout Menu"), "onclick=\"add_menu({dossier:{$gDossier},p_id:{$p_id},type:'pr'})\"");
$call_tab = HtmlInput::default_value_post('tab', 'none');
$a_tab = array('profile_gen_div' => 'tabs', 'profile_menu_div' => 'tabs', 'profile_print_div' => 'tabs', 'profile_gestion_div' => 'tabs', 'profile_repo_div' => 'tabs');
$a_tab[$call_tab] = 'tabs_selected';
?>
<h1>Profil <?php 
echo $profile->p_name;
?>
</h1>
<?php 
echo HtmlInput::anchor(_('Retour'), "", " onclick = \" \$('detail_profile').hide();\$('list_profile').show(); \" ", 'class="line"');
if ($p_id > 0) {
    ?>
<ul class="tabs">
    
    <li class="<?php 
Exemplo n.º 18
0
<table class="result">
<?php 
$nb_dossier = count($a_dossier);
for ($i = 0; $i < $nb_dossier; $i++) {
    $class = $i % 2 == 0 ? "even" : "odd";
    ?>
    <tr id="row_db_<?php 
    echo $a_dossier[$i]['dos_id'];
    ?>
" class="<?php 
    echo $class;
    ?>
">
        <td>
            <?php 
    echo HtmlInput::button('add_folder', BUTTONADD, " onclick=\"folder_add({$user_id},{$a_dossier[$i]['dos_id']});\"", ' smallbutton');
    ?>
         
        </td>
        <td>
            <?php 
    echo h($a_dossier[$i]['dos_name']);
    ?>
        </td>
        <td>
            <?php 
    echo h($a_dossier[$i]['dos_description']);
    ?>
        </td>
    </tr>
<?php 
Exemplo n.º 19
0
 /**
  * Javascript to print the current window
  */
 static function print_window()
 {
     $r = '';
     $r .= HtmlInput::button('print', 'Imprimer', 'onclick="window.print();"');
     return $r;
 }
Exemplo n.º 20
0
        echo h($rDossier['dos_description']);
        ?>
                </td>
                <td>
                    <?php 
        echo HtmlInput::anchor(_('Enleve'), "", " onclick=\"folder_remove({$mod_user->id},{$rDossier['dos_id']});\"");
        ?>
                </td>
                
            </tr>
<?php 
    }
    ?>
        </TABLE>
        <?php 
    echo HtmlInput::button("database_add_button", _('Ajout'), " onclick=\"folder_display({$mod_user->id});\"");
    ?>
        <?php 
    // If UserChange->admin==1 it means he can access all databases
    //
} else {
    ?>
        
<?php 
}
?>

</DIV>

<?php 
html_page_stop();
Exemplo n.º 21
0
        }
        echo "<TD class=\"num\"> {$l_line['jrn_def_name']} </TD>";
        $jrn_priv->name = 'jrn_act' . $l_line['jrn_def_id'];
        $jrn_priv->value = $array;
        if ($admin != 1) {
            $jrn_priv->selected = $sec_User->get_ledger_access($l_line['jrn_def_id']);
        } else {
            $jrn_priv->selected = 'W';
        }
        echo '<td>';
        echo $jrn_priv->input();
        echo '</td>';
        echo '</tr>';
    }
    echo '</table>';
    echo '</fieldset>';
    //**********************************************************************
    // Show Priv. for actions
    //**********************************************************************
    echo '<fieldset> <legend>Actions </legend>';
    include 'template/security_list_action.php';
    echo '</fieldset>';
    echo HtmlInput::button('Imprime', 'imprime', "onclick=\"window.open('" . $sHref . "');\"");
    echo HtmlInput::submit('ok', 'Sauve');
    echo HtmlInput::reset('Annule');
    echo $return;
    echo '</form>';
}
// end of the form
echo "</DIV>";
html_page_stop();
Exemplo n.º 22
0
 function button_export_pdf($p_string = "")
 {
     if (CONVERT_GIF_PDF != 'NOT' && PDFTK != 'NOT') {
         $r = "";
         $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", "PDF:AncReceipt");
         $r .= $p_string;
         $r .= dossier::hidden();
         $r .= HtmlInput::submit('bt_receipt_anal_pdf', _("Export des pièces en PDF"));
     } else {
         $r = "";
         $msg = _("Les extensions pour convertir en pdf ne sont pas installées");
         $r = HtmlInput::button("bt_receipt_anal", _('Export des pièces en PDF'), sprintf('onclick="alert(\'%s\')"', $msg));
     }
     return $r;
 }
Exemplo n.º 23
0
    ?>
		</td>
		<td>
			<?php 
    $js = ' onclick="stock_repo_change(\'' . dossier::id() . '\',\'' . $array[$i]['r_id'] . '\')"';
    echo HtmlInput::button("mod", _("Modifier"), $js);
    ?>
		</td>
	</tr>

<?php 
}
?>
</table>
	<?php 
echo HtmlInput::button("show_add_depot_d", "Ajout d'un dépot", "onclick=\"\$('add_depot_d').show();\"");
?>
	<div id="add_depot_d" class="inner_box" style="display:none">
	<?php 
echo HtmlInput::title_box("Ajouter un dépôt", "add_depot_d", "hide");
?>
	<form method="post">
		<table>
			<tr>
				<td>
					Nom
				</td>
				<td>
					<?php 
$name = new IText("r_name", "");
echo $name->input();
Exemplo n.º 24
0
<?php 
}
?>
</table>
<?php 
if ($p_readonly == false) {
    echo HtmlInput::button_action(_('Ajouter une ligne'), 'stock_add_row();', "xx", 'smallbutton');
}
if ($p_readonly == false) {
    echo HtmlInput::submit('save', _('Sauver'));
}
if ($p_readonly == false) {
    echo HtmlInput::hidden('row', $nb);
}
if ($p_readonly == false) {
    echo HtmlInput::button("reprise_show", _('Reprise inventaire'), " onclick=\"\$('reprise_inventaire_div').show();\"");
}
?>
	</form>
</div>
<div class="inner_box" id="reprise_inventaire_div" style="display:none">
    <form method="get">
    <?php 
echo HtmlInput::title_box(_('Reprise inventaire'), 'reprise_inventaire_div', 'hide');
?>
    <?php 
echo HtmlInput::request_to_hidden(array('gDossier', 'ac'));
?>
    <table>
        <tr>
            <td>
Exemplo n.º 25
0
 function display_row($p_odd, $with_tag = 'Y')
 {
     $r = "";
     $highlight = $this->get_class();
     $p_odd = $highlight == "" ? $p_odd : $highlight;
     if ($with_tag == 'Y') {
         $r = '<tr id="tr' . $this->tl_id . '" class="' . $p_odd . '">';
     }
     $r .= '<td sorttable_customkey="' . format_date($this->tl_date, 'DD.MM.YYYY', 'YYYYMMDD') . '">' . $this->tl_date . '</td>' . '<td>' . '<a class="line" href="javascript:void(0)" onclick="todo_list_show(\'' . $this->tl_id . '\')">' . htmlspecialchars($this->tl_title) . '</a>' . '</td>';
     if ($this->is_public == 'Y' && $this->use_login != $_SESSION['g_user']) {
         // This is a public note, cannot be removed
         $r .= '<td></td>';
     } elseif ($this->use_login == $_SESSION['g_user']) {
         // This a note the user owns
         $r .= '<td>' . HtmlInput::button('del', 'X', 'onClick="todo_list_remove(' . $this->tl_id . ')"', 'smallbutton') . '</td>';
     } else {
         // this is a note shared by someone else
         $r .= '<td>' . HtmlInput::button('del', 'X', 'onClick="todo_list_remove_share(' . $this->tl_id . ',\'' . $this->use_login . '\',' . Dossier::id() . ')"', 'smallbutton') . '</td>';
     }
     if ($with_tag == 'Y') {
         $r .= '</tr>';
     }
     return $r;
 }
Exemplo n.º 26
0
<?php

//This file is part of NOALYSS and is under GPL
//see licence.txt
?>
    
<?php 
echo HtmlInput::button("other_bt", _("Autres actions"), 'onclick="$(\'other_div\').style.display=\'block\';action_show_checkbox();"', "smallbutton");
$radio = new IRadio("othact");
/*
 * Hidden values for a previous search
 */
echo HtmlInput::request_to_hidden(array("closed_action", "remind_date_end", "remind_date", "sag_ref", "remind_date", "only_internal", "state", "gDossier", "qcode", "start_date", "end_date", "ag_id", "ag_dest_query", "tdoc", "action_query", "date_start", "date_end", "hsstate", "searchtag"));
?>
<div id="other_div" class="inner_box" style="width:40%;display: none">
    <?php 
echo HtmlInput::title_box(_('Actions sur plusieurs documents'), 'other_div', 'hide', 'action_hide_checkbox();');
?>
    <?php 
echo _("Sélectionner les documents et l' action :");
?>
    <ul style='list-style-type: none;padding-left:30px;margin: 0px' >
        <li >
            <?php 
$radio->value = "IMP";
$radio->selected = true;
echo $radio->input();
?>
            <?php 
echo _("Impression");
?>
Exemplo n.º 27
0
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');
}
echo <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<data>
<ctl>mod_predf_op</ctl>
<code>{$html}</code>
</data>
Exemplo n.º 28
0
 function search_box_button()
 {
     $bt = HtmlInput::button("Recherche", "Recherche", ' onclick="$(\'histo_search_d\').show();"');
     echo $bt;
 }
Exemplo n.º 29
0
 *
 */
require_once NOALYSS_INCLUDE . '/class_tag.php';
require_once NOALYSS_INCLUDE . '/class_tool_uos.php';
$tag = new Tag($cn);
$uos = new Tool_Uos('tag');
if (isset($_POST['save_tag_sb'])) {
    if (!isset($_POST['remove'])) {
        try {
            $uos->check();
            $tag->save($_POST);
            $uos->save();
        } catch (Exception $e) {
            alert("déjà sauvé");
        }
    } else {
        $tag->remove($_POST);
    }
}
?>
<div style="margin-left:10%;width:80%">
     <p class="notice">
        <?php 
echo _("Vous pouvez utiliser ceci comme des étiquettes pour marquer des documents ou \n         comme des dossiers pour rassembler des documents. Un document peut appartenir\n         à plusieurs dossiers ou avoir plusieurs étiquettes.");
?>
     </p>
    <?php 
$tag->show_list();
$js = sprintf("onclick=\"show_tag('%s','%s','%s','p')\"", Dossier::id(), $_REQUEST['ac'], '-1');
echo HtmlInput::button("tag_add", "Ajout d'un tag", $js);
Exemplo n.º 30
0
 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 = "&nbsp;";
     //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;
 }