noalyss Version-9
Public Member Functions | Data Fields
Pre_op_ods Class Reference

concerns the predefined operation for ODS ledger More...

+ Inheritance diagram for Pre_op_ods:
+ Collaboration diagram for Pre_op_ods:

Public Member Functions

 __construct ($cn)
 
 compute_array ($p_od_id)
 compute an array accordingly with the FormVenView function More...
 
 get_post ()
 
 load ($p_od_id)
 load the data from the database and return an array More...
 
 save ($p_od_id, $p_nbitem)
 save the detail and op in the database More...
 
 __construct ($p_cn)
 

Data Fields

 $op
 

Additional Inherited Members

- Static Public Member Functions inherited from Pre_operation_detail
static build_detail ($p_jrn_type, Database $database)
 

Detailed Description

concerns the predefined operation for ODS ledger

Definition at line 29 of file pre_op_ods.class.php.

Constructor & Destructor Documentation

◆ __construct()

Pre_op_ods::__construct (   $cn)

Reimplemented from Pre_operation_detail.

Definition at line 32 of file pre_op_ods.class.php.

33 {
34 parent::__construct($cn);
35 }

References $cn.

Member Function Documentation

◆ compute_array()

Pre_op_ods::compute_array (   $p_od_id)

compute an array accordingly with the FormVenView function

Definition at line 84 of file pre_op_ods.class.php.

85 {
86 $count=0;
87 $p_array=$this->load($p_od_id);
88 foreach ($p_array as $row)
89 {
90 $c=($row['opd_debit']=='t')?'d':'c';
91 $array+=array("e_account".$count=>$row['opd_poste'],
92 "e_account".$count."_amount"=>$row['opd_amount'],
93 "e_account".$count."_type"=>$c
94 );
95 $count++;
96
97 }
98 return $array;
99 }
load($p_od_id)
load the data from the database and return an array
$count

References $array, $count, $p_array, $row, and load().

+ Here is the call graph for this function:

◆ get_post()

Pre_op_ods::get_post ( )

Definition at line 40 of file pre_op_ods.class.php.

41 {
42 $http=new \HttpInput();
43 $nb=$http->post("nb_item","number");
44 for ($i=0;$i< $nb ;$i++)
45 {
46 $this->{"e_account".$i}=$http->post("e_account'.$i");
47 $this->{"e_account".$i."_amount"}=$http->post("e_account".$i."_amount","number",0);
48 $this->{"e_account".$i."_type"}=$http->post('e_account'.$i."_type");
49
50 }
51 }

References $http, $i, and $nb.

◆ load()

Pre_op_ods::load (   $p_od_id)

load the data from the database and return an array

Returns
an array

Definition at line 103 of file pre_op_ods.class.php.

104 {
105 $sql="select opd_id,opd_poste,opd_amount,opd_debit".
106 " from op_predef_detail where od_id= $1 ".
107 " order by opd_debit, opd_id,opd_amount";
108 $res=$this->db->exec_sql($sql,array($p_od_id));
110 return $array;
111 }
static fetch_all($ret)
wrapper for the function pg_fetch_all
$SecUser db

References $array, $res, $sql, db, and DatabaseCore\fetch_all().

Referenced by compute_array().

+ Here is the call graph for this function:

◆ save()

Pre_op_ods::save (   $p_od_id,
  $p_nbitem 
)

save the detail and op in the database

Definition at line 56 of file pre_op_ods.class.php.

57 {
58 try
59 {
60 // save the selling
61 for ($i=0;$i< $p_nbitem ;$i++)
62 {
63 $sql='insert into op_predef_detail (opd_poste,opd_amount,'.
64 'opd_debit,od_id)'.
65 ' values ($1,$2,$3,$4)';
66
67 $this->db->exec_sql($sql,array($this->{"e_account".$i},
68 $this->{"e_account".$i."_amount"},
69 ($this->{"e_account".$i."_type"}=='d')?'t':'f',
70 $p_od_id)
71 );
72 }
73 }
74 catch (Exception $e)
75 {
77 echo ($e->getMessage());
78 throw $e;
79 }
80
81 }
record_log($p_message)
Record an error message into the log file of the server.
Definition: ac_common.php:1342

References $e, $i, $sql, db, and record_log().

+ Here is the call graph for this function:

Field Documentation

◆ $op

Pre_op_ods::$op

Definition at line 31 of file pre_op_ods.class.php.


The documentation for this class was generated from the following file: