33 parent::__construct(
$cn);
41 $http = new \HttpInput();
42 $nb =
$http->post(
"nb_item",
"number");
43 $this->e_client=
$http->post(
'e_client');
45 $march =
"e_march" .
$i;
47 $this->$march =
$http->post(
'e_march' .
$i);
48 $this->{
"e_march" .
$i .
"_label"} =
$http->post(
'e_march' .
$i .
"_label",
"string",
"");
52 $this->{
"e_march" .
$i .
"_tva_id"} =
$http->post(
'e_march' .
$i .
"_tva_id",
"string", 0);
53 $this->{
"e_march" .
$i .
"_tva_id"} =(empty($this->{
"e_march" .
$i .
"_tva_id"}))?
null:$this->{
"e_march" .
$i .
"_tva_id"} ;
54 $this->{
"e_march" .
$i .
"_price"} =
$http->post(
'e_march' .
$i .
"_price",
"number");
55 $this->{
"e_march" .
$i .
"_tva_amount"} =
$http->post(
'e_march' .
$i .
"_tva_amount",
"string",
"0");
56 $this->{
"e_march" .
$i .
"_tva_amount"} = (empty( $this->{
"e_march" .
$i .
"_tva_amount"} ))?0: $this->{
"e_march" .
$i .
"_tva_amount"} ;
57 $this->{
"e_quant" .
$i} =
$http->post(
'e_quant' .
$i,
"number");
64 function save($p_od_id,$p_nb_item)
69 $sql=sprintf(
'insert into op_predef_detail (od_id,opd_poste,opd_debit)'.
77 for (
$i=0;
$i<$p_nb_item;
$i++)
80 $sql=
'insert into op_predef_detail (opd_poste,'
89 ' values ($1,$2,$3,$4,$5,$6,$7,$8)';
101 array($this->{
"e_march".$i},
102 $this->{
"e_march".$i.
"_price"},
103 $this->{
"e_march".$i.
"_tva_id"},
104 $this->{
"e_quant".$i},
107 $this->{
"e_march".$i.
"_tva_amount"},
108 $this->{
"e_march".$i.
"_label"}
114 record_log(
"PREOPACH01".
$e->getMessage().$e->getTraceAsString());
129 if (empty(
$p_array))
return array();
132 if (
$row[
'opd_debit']==
'f')
138 if ( trim(
$row[
'opd_poste']) !=
"")
141 "e_march".
$count.
"_price"=>
$row[
'opd_amount'],
142 "e_march".$count.
"_tva_id"=>
$row[
'opd_tva_id'],
143 "e_quant".$count=>
$row[
'opd_quantity'],
144 "e_march".$count.
"_label"=>
$row[
'opd_comment'],
145 "e_march".$count.
"_tva_amount"=>
$row[
'opd_tva_amount'],
161 $sql=
"select opd_id,opd_poste,opd_amount,opd_tva_id,opd_debit,".
162 " opd_quantity , opd_comment,opd_tva_amount from op_predef_detail where od_id= $1 ".
165 if (
$res ==
false)
return array();
186 $f_add_button=
new IButton(
'add_card');
187 $f_add_button->tabindex=-1;
188 $f_add_button->label=_(
'Créer une nouvelle fiche');
189 $f_add_button->set_attribute(
'ipopup',
'ipop_newcard');
190 $f_add_button->set_attribute(
'jrn',
$p_array[
'p_jrn']);
191 $f_add_button->javascript=
"this.jrn=\$('p_jrn').value; select_card_type(this);";
193 $f_add_button2=
new IButton(
'add_card2');
194 $f_add_button2->tabindex=-1;
195 $f_add_button2->label=_(
'Créer une nouvelle fiche');
196 $f_add_button2->set_attribute(
'ipopup',
'ipop_newcard');
197 $f_add_button2->set_attribute(
'filter',
$ledger->get_all_fiche_def ());
199 $f_add_button2->javascript=
" this.jrn=\$('p_jrn').value;select_card_type(this);";
205 $str_add_button=$f_add_button->input();
206 $str_add_button2=$f_add_button2->input();
210 $r.=dossier::hidden();
211 $f_legend=_(
'En-tête facture fournisseur');
221 $e_client_label=
" ";
230 $fClient->get_by_qcode($e_client);
240 $W1->label=
"Client ".Icon_Action::infobulle(0) ;
241 $W1->name=
"e_client";
243 $W1->value=$e_client;
245 $W1->set_dblclick(
"fill_ipopcard(this);");
246 $W1->set_attribute(
'ipopup',
'ipopcard');
249 $W1->set_attribute(
'label',
'e_client_label');
251 $W1->set_attribute(
'typecard',
'cred');
254 $W1->set_callback(
'filter_card');
255 $W1->set_function(
'fill_data');
256 $W1->javascript=sprintf(
' onchange="fill_data_onchange(\'%s\');" ',
258 $f_client_qcode=$W1->input();
259 $client_label=
new ISpan();
260 $client_label->table=0;
261 $f_client=$client_label->input(
"e_client_label",$e_client_label);
262 $f_client_bt=$W1->search();
272 $r.=$Hid->input(
"nb_item",$p_article);
274 $f_legend_detail=_(
"Détail articles achetés");
288 $march_tva_id=(isset(
$p_array[
"e_march$i".
"_tva_id"]))?
$p_array[
"e_march$i".
"_tva_id"]:
"";
289 $march_tva_amount=(isset(
$p_array[
"e_march$i".
"_tva_amount"]))?
$p_array[
"e_march$i".
"_tva_amount"]:
"";
298 $fMarch->get_by_qcode($march);
302 if ( ! (isset(
$p_array[
"e_march$i".
"_tva_id"])))
310 $W1->name=
"e_march".$i;
313 $W1->set_attribute(
'typecard',
'deb');
314 $W1->set_dblclick(
"fill_ipopcard(this);");
315 $W1->set_attribute(
'ipopup',
'ipopcard');
318 $W1->set_attribute(
'label',
'e_march'.
$i.
'_label');
320 $W1->set_attribute(
'price',
'e_march'.
$i.
'_price');
322 $W1->set_attribute(
'tvaid',
'e_march'.
$i.
'_tva_id');
324 $W1->set_callback(
'filter_card');
325 $W1->set_function(
'fill_data');
326 $W1->javascript=sprintf(
' onchange="fill_data_onchange(\'%s\');" ',
331 $array[
$i][
'quick_code']=$W1->input();
337 $htva=
new INum(
'htva_march'.
$i);
343 $tvac=
new INum(
'tvac_march'.
$i);
353 $Span=
new IText(
"e_march".
$i.
"_label");
355 $Span->css_size=
"100%";
358 $Span=
new ISpan(
"e_march".
$i.
"_label");
360 $Span->value=$march_label;
361 $Span->setReadOnly(
false);
364 $array[
$i][
'denom']=$Span->input(
"e_march".
$i.
"_label",$march_label);
367 $Price->setReadOnly(
false);
370 $Price->javascript=
"onBlur='format_number(this);clean_tva($i);compute_ledger($i)'";
371 $array[
$i][
'pu']=$Price->input(
"e_march".
$i.
"_price",$march_price);
375 if ( $flag_tva ==
'Y' )
381 $Tva->set_attribute(
'compute',
$i);
383 $Tva->js=
'onblur="format_number(this);clean_tva('.$i.
');compute_ledger('.
$i.
')"';
384 $Tva->value=$march_tva_id;
385 $array[
$i][
'tva']=$Tva->input(
"e_march$i".
"_tva_id");
388 $wTva_amount=
new INum();
389 $wTva_amount->readOnly=
false;
390 $wTva_amount->size=6;
391 $wTva_amount->javascript=
"onBlur='format_number(this);compute_ledger($i)'";
392 $array[
$i][
'amount_tva']=$wTva_amount->input(
"e_march".
$i.
"_tva_amount",$march_tva_amount);
398 $Quantity=
new INum();
399 $Quantity->setReadOnly(
false);
402 $Quantity->javascript=
"onChange='format_number(this);clean_tva($i);compute_ledger($i)'";
403 $array[
$i][
'quantity']=$Quantity->input(
"e_quant".
$i,$quant);
410 require_once NOALYSS_TEMPLATE.
'/predf_ledger_detail.php';
411 $r.=ob_get_contents();
noalyss_strlentrim($p_string)
record_log($p_message)
Record an error message into the log file of the server.
global $g_user
if no group available , then stop
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
if(!headers_sent())
– pour utiliser unoconv démarrer un server libreoffice commande libreoffice –headless –accept="socket...
Handle the ledger of purchase,.
static fetch_all($ret)
wrapper for the function pg_fetch_all
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...
concerns the predefined operation for ACH ledger
get_post()
get the post and stove them into data member , before saving them in the db
load($p_od_id)
load the data from the database and return an array
compute_array($p_od_id)
compute an array accordingly with the FormVenView function, first the data is fetched (via load) to t...
display($p_array)
Display the form for modifying or adding new predefined operation.
save($p_od_id, $p_nb_item)
save the detail and op in the database
mother of the pre_op_XXX, it contains only one data : an object Pre_Operation. The child class contai...