34 parent::__construct(
$cn);
42 $http=new \HttpInput();
44 $this->e_client=
$http->post(
"e_client");
49 $this->$march=
$http->post(
'e_march'.
$i);
50 $this->{
"e_march".$i.
"_tva_id"}=
$http->post(
'e_march'.
$i.
"_tva_id",
"string",0);
51 $this->{
"e_march" .
$i .
"_tva_id"} =(empty($this->{
"e_march" .
$i .
"_tva_id"}))?0:$this->{
"e_march" .
$i .
"_tva_id"} ;
53 $this->{
"e_march".$i.
"_label"}=
$http->post(
'e_march'.
$i.
"_label",
"string",
"");
56 $this->{
"e_march".$i.
"_price"}=
$http->post(
'e_march'.
$i.
"_price",
"number");
57 $this->{
"e_march".$i.
"_tva_amount"}=
$http->post(
'e_march'.
$i.
"_tva_amount",
"number",
"0");
59 $this->{
"e_quant".$i}=
$http->post(
'e_quant'.
$i,
"number");
66 function save($p_od_id,$p_nb_item)
71 $sql=sprintf(
'insert into op_predef_detail (od_id,opd_poste,opd_debit)'.
78 for (
$i=0;
$i<$p_nb_item;
$i++)
81 $sql=
'insert into op_predef_detail (opd_poste,'
90 ' values ($1,$2,$3,$4,$5,$6,$7,$8)';
92 array($this->{
"e_march".$i},
93 $this->{
"e_march".$i.
"_price"},
94 $this->{
"e_march".$i.
"_tva_id"},
95 $this->{
"e_quant".$i},
98 $this->{
"e_march".$i.
"_tva_amount"},
99 $this->{
"e_march".$i.
"_label"},
105 record_log(
"PREOPVEN01".
$e->getMessage().$e->getTraceAsString());
116 if (empty(
$p_array))
return array();
119 if (
$row[
'opd_debit']==
't')
125 if ( trim(
$row[
'opd_poste']) !=
"")
128 "e_march".
$count.
"_price"=>
$row[
'opd_amount'],
129 "e_march".$count.
"_tva_id"=>
$row[
'opd_tva_id'],
130 "e_quant".$count=>
$row[
'opd_quantity'],
131 "e_march".$count.
"_label"=>
$row[
'opd_comment'],
132 "e_march".$count.
"_tva_amount"=>
$row[
'opd_tva_amount'],
146 $sql=
"select opd_id,opd_poste,opd_amount,opd_tva_id,opd_debit,".
147 " opd_quantity , opd_comment,opd_tva_amount from op_predef_detail where od_id= $1 ".
151 if (
$res ==
false)
return array();
171 $f_add_button=
new IButton(
'add_card');
172 $f_add_button->tabindex=-1;
173 $f_add_button->label=_(
'Créer une nouvelle fiche');
174 $f_add_button->set_attribute(
'ipopup',
'ipop_newcard');
175 $f_add_button->set_attribute(
'jrn',
$p_array[
'p_jrn']);
176 $f_add_button->javascript=
"this.jrn=\$('p_jrn').value; select_card_type(this);";
178 $f_add_button2=
new IButton(
'add_card2');
179 $f_add_button2->tabindex=-1;
180 $f_add_button2->label=_(
'Créer une nouvelle fiche');
181 $f_add_button2->set_attribute(
'ipopup',
'ipop_newcard');
182 $f_add_button2->set_attribute(
'filter',
$ledger->get_all_fiche_def ());
184 $f_add_button2->javascript=
" this.jrn=\$('p_jrn').value;select_card_type(this);";
190 $str_add_button=$f_add_button->input();
191 $str_add_button2=$f_add_button2->input();
195 $r.=dossier::hidden();
196 $f_legend=_(
'En-tête facture client');
208 $e_client_label=
" ";
217 $fClient->get_by_qcode($e_client);
227 $W1->label=
"Client ".Icon_Action::infobulle(0) ;
228 $W1->name=
"e_client";
230 $W1->value=$e_client;
232 $W1->set_dblclick(
"fill_ipopcard(this);");
233 $W1->set_attribute(
'ipopup',
'ipopcard');
236 $W1->set_attribute(
'label',
'e_client_label');
238 $W1->set_attribute(
'typecard',
'deb');
241 $W1->set_callback(
'filter_card');
242 $W1->set_function(
'fill_data');
243 $W1->javascript=sprintf(
' onchange="fill_data_onchange(\'%s\');" ',
245 $f_client_qcode=$W1->input();
246 $client_label=
new ISpan();
247 $client_label->table=0;
248 $f_client=$client_label->input(
"e_client_label",$e_client_label);
249 $f_client_bt=$W1->search();
259 $r.=$Hid->input(
"nb_item",$p_article);
261 $f_legend_detail=_(
"Détail articles vendus");
275 $march_tva_id=(isset(
$p_array[
"e_march$i".
"_tva_id"]))?
$p_array[
"e_march$i".
"_tva_id"]:
"";
276 $march_tva_amount=(isset(
$p_array[
"e_march$i".
"_tva_amount"]))?
$p_array[
"e_march$i".
"_tva_amount"]:
"";
285 $fMarch->get_by_qcode($march);
289 if ( ! (isset(
$p_array[
"e_march$i".
"_tva_id"])))
297 $W1->name=
"e_march".$i;
300 $W1->set_attribute(
'typecard',
'cred');
301 $W1->set_dblclick(
"fill_ipopcard(this);");
302 $W1->set_attribute(
'ipopup',
'ipopcard');
305 $W1->set_attribute(
'label',
'e_march'.
$i.
'_label');
307 $W1->set_attribute(
'price',
'e_march'.
$i.
'_price');
309 $W1->set_attribute(
'tvaid',
'e_march'.
$i.
'_tva_id');
311 $W1->set_callback(
'filter_card');
312 $W1->set_function(
'fill_data');
313 $W1->javascript=sprintf(
' onchange="fill_data_onchange(\'%s\');" ',
318 $array[
$i][
'quick_code']=$W1->input();
324 $htva=
new INum(
'htva_march'.
$i);
330 $tvac=
new INum(
'tvac_march'.
$i);
340 $Span=
new IText(
"e_march".
$i.
"_label");
342 $Span->css_size=
"100%";
345 $Span=
new ISpan(
"e_march".
$i.
"_label");
347 $Span->value=$march_label;
348 $Span->setReadOnly(
false);
351 $array[
$i][
'denom']=$Span->input(
"e_march".
$i.
"_label",$march_label);
354 $Price->setReadOnly(
false);
357 $Price->javascript=
"onBlur='format_number(this);clean_tva($i);compute_ledger($i)'";
358 $array[
$i][
'pu']=$Price->input(
"e_march".
$i.
"_price",$march_price);
362 if ( $flag_tva ==
'Y' )
368 $Tva->set_attribute(
'compute',
$i);
370 $Tva->js=
'onblur="format_number(this);clean_tva('.$i.
');compute_ledger('.
$i.
')"';
371 $Tva->value=$march_tva_id;
372 $array[
$i][
'tva']=$Tva->input(
"e_march$i".
"_tva_id");
375 $wTva_amount=
new INum();
376 $wTva_amount->readOnly=
false;
377 $wTva_amount->size=6;
378 $wTva_amount->javascript=
"onBlur='format_number(this);compute_ledger($i)'";
379 $array[
$i][
'amount_tva']=$wTva_amount->input(
"e_march".
$i.
"_tva_amount",$march_tva_amount);
385 $Quantity=
new INum();
386 $Quantity->setReadOnly(
false);
389 $Quantity->javascript=
"onChange='format_number(this);clean_tva($i);compute_ledger($i)'";
390 $array[
$i][
'quantity']=$Quantity->input(
"e_quant".
$i,$quant);
397 require_once NOALYSS_TEMPLATE.
'/predf_ledger_detail.php';
398 $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 sold,.
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 VEN ledger
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
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
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...