34 parent::__construct(
$cn);
35 $this->operation->od_direct=
'f';
41 $this->operation->od_direct=
'f';
42 $this->e_bank_account=
$_POST[
'e_bank_account'];
43 for (
$i=0;
$i<$this->operation->nb_item;
$i++)
45 $this->{
"e_other".$i}=
$_POST[
'e_other'.$i];
46 $this->{
"e_other".$i.
"_comment"}=
$_POST[
'e_other'.$i.
'_comment'];
47 $this->{
"e_other".$i.
"_amount"}=
$_POST[
'e_other'.$i.
"_amount"];
59 if ($this->operation->save() ==
false )
62 $sql=sprintf(
'insert into op_predef_detail (od_id,opd_poste,opd_debit)'.
65 $this->operation->od_id,
66 $this->e_bank_account,
70 for (
$i=0;
$i<$this->operation->nb_item;
$i++)
72 $sql=sprintf(
'insert into op_predef_detail (opd_poste,'.
73 'opd_amount,opd_comment,'.
76 "('%s',%.2f,'%s','%s',%d)",
77 $this->{
"e_other".$i},
78 $this->{
"e_other".$i.
"_amount"},
79 $this->{
"e_other".$i.
"_comment"},
81 $this->operation->od_id
89 echo (
$e->getMessage());
90 $this->
db->rollback();
99 $a_op=$this->operation->load();
100 $array=$this->operation->compute_array($a_op);
104 if (
$row[
'opd_debit']==
't')
106 $array+=array(
'e_bank_account'=>
$row[
'opd_poste']);
111 "e_other".
$count.
"_amount"=>
$row[
'opd_amount'],
112 "e_other".$count.
"_comment"=>
$row[
'opd_comment']
124 $sql=
"select opd_id,opd_poste,opd_amount,opd_comment,opd_debit".
125 " from op_predef_detail where od_id=$1 ".
127 $res=$this->
db->exec_sql(
$sql,[$this->operation->od_id]);
133 $this->operation->od_id=
$p_id;
record_log($p_message)
Record an error message into the log file of the server.
static fetch_all($ret)
wrapper for the function pg_fetch_all
concerns the predefined operation for FIN ledger
load()
load the data from the database and return an array
save()
save the detail and op in the database
compute_array()
compute an array accordingly with the FormVenView function
mother of the pre_op_XXX, it contains only one data : an object Pre_Operation. The child class contai...