33 parent::__construct(
$cn);
41 $http = new \HttpInput();
42 $nb =
$http->post(
"nb_item",
"number");
53 $this->{
'poste'.$i}=
$poste;
54 $this->{
'isqc'.$i}=
'f';
58 $this->{
'isqc'.$i}=(trim(
$http->post(
'qc_'.$i)) !=
"")?
't':
'f';
59 $this->{
'poste'.$i}=trim (
$qcode);
62 $this->{
"amount".$i}=
$http->post(
'amount'.
$i);
64 $this->{
"ld".$i}=
$http->post(
"ld".
$i);
66 $this->{
"ck".$i}=(isset(
$_POST[
'ck'.
$i]))?
't':
'f';
74 function save($p_od_id,$p_nb_item)
79 for (
$i=0;
$i<$p_nb_item;
$i++)
81 if ( ! isset ($this->{
"poste".$i}))
84 $sql=sprintf(
'insert into op_predef_detail (opd_poste,opd_amount,'.
85 'opd_debit,od_id,opd_qc,opd_comment)'.
86 ' values($1,$2,$3,$4,$5,$6) '
89 $this->
db->exec_sql(
$sql,[$this->{
"poste".$i},
113 if (empty(
$p_array))
return array();
116 $tmp_array=array(
"qc_".
$count=>
'',
123 if (
$row[
'opd_qc'] ==
't' )
124 $tmp_array[
'qc_'.$count]=
$row[
'opd_poste'];
126 $tmp_array[
'poste'.$count]=
$row[
'opd_poste'];
129 if (
$row[
'opd_debit'] ==
'f' )
130 unset ($tmp_array[
'ck'.
$count]);
144 $sql=
"select opd_id,opd_poste,opd_amount,opd_debit,opd_comment,".
145 " opd_qc from op_predef_detail where od_id=$1 ".
149 if (
$array ==
false )
return array();
166 $legder->nb=$legder->get_min_row();
174 $f_add_button =
new IButton(
'add_card');
175 $f_add_button->label = _(
'Créer une nouvelle fiche');
176 $f_add_button->set_attribute(
'ipopup',
'ipop_newcard');
177 $f_add_button->set_attribute(
'jrn', $legder->id);
178 $f_add_button->javascript =
" this.jrn=\$('p_jrn').value;select_card_type(this);";
179 $f_add_button->input();
185 $ret.=dossier::hidden();
187 $ret.=dossier::hidden();
193 $ret.=
'<div class="fieldset" style="overflow:auto;height:400px">';
194 $ret.=
'<table id="quick_item" style="width:100%">';
196 '<th style="text-align:left">Quickcode' . $info .
'</th>' .
197 '<th style="text-align:left">' . _(
'Poste') . $info_poste .
'</th>' .
198 '<th style="text-align:left">' . _(
'Libellé') .
'</th>' .
199 '<th style="text-align:left">' . _(
'Montant') .
'</th>' .
200 '<th style="text-align:left">' . _(
'Débit') .
'</th>' .
238 $poste->set_attribute(
'jrn', $legder->id);
239 $poste->set_attribute(
'ipopup',
'ipop_account');
240 $poste->set_attribute(
'label',
'ld' .
$i);
241 $poste->set_attribute(
'account',
'poste' .
$i);
246 $poste->dbl_click_history();
252 $Poste->find_by_value(
$poste->value);
253 $label = $Poste->get_lib();
257 $line_desc =
new IText();
258 $line_desc->name =
'ld' .
$i;
259 $line_desc->size = 30;
269 $amount->javascript =
' onChange="format_number(this);checkTotalDirect()"';
274 $deb->javascript =
' onChange="checkTotalDirect()"';
279 '<script> document.getElementById(\'poste' .
$i .
'\').onblur=
function(){
if (trim(this.
value) !=\
'\') {document.getElementById(\
'qc_' .
$i .
'\').value=
"";}}</script>
' .
281 $ret.='<
td>
' . $line_desc->input() . '</
td>
';
282 $ret.='<
td>
' . $amount->input() . '</
td>
';
283 $ret.='<
td>
' . $deb->input() . '</
td>
';
285 // If readonly == 1 then show CA
289 $ret.=Html_Input_Noalyss::ledger_add_item("M");
tr($p_string, $p_extra='')
record_log($p_message)
Record an error message into the log file of the server.
td($p_string='', $p_extra='')
surround the string with td
global $g_user
if no group available , then stop
Manage the account from the table tmp_pcmn.
static fetch_all($ret)
wrapper for the function pg_fetch_all
static id()
return the 'gDossier' value after a check
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
Input HTML for the card show buttons, in the file, you have to add card.js How to use :
This class handles only the numeric input, the input will call a javascript to change comma to period...
show a button, for selecting a account and a input text for manually inserting an account the differe...
static infobulle($p_comment)
Display a info in a bubble, text is in message_javascript.
concerns the predefined operation for the operation from 'Ecriture direct'
compute_array($p_od_id)
compute an array accordingly with the FormVenView function
get_post()
get the post and stove them into data member , before saving them in the db
save($p_od_id, $p_nb_item)
save the detail and op in the database
display($p_array)
Display the form for modifying or adding new predefined operation.
load($p_od_id)
load the data from the database and return an array
mother of the pre_op_XXX, it contains only one data : an object Pre_Operation. The child class contai...
for($i=0;$i< $nb_jrn;$i++) $deb