noalyss Version-9
Public Member Functions | Private Attributes
Operation_Opening Class Reference
+ Inheritance diagram for Operation_Opening:
+ Collaboration diagram for Operation_Opening:

Public Member Functions

 __construct ($p_id)
 
 display_result ()
 
 from_request ()
 
 get_exercice ()
 
 get_from_folder ()
 
 get_signature ()
 
 insert ()
 insert data into data operation_exercice and operation_exercice_detail More...
 
 set_exercice ($exercice)
 
 set_from_folder ($from_folder)
 
- Public Member Functions inherited from Operation_Exercice
 __construct ($p_id=-1)
 
 display_result ()
 
 display_row ($data, $row_tr=true)
 let display one row More...
 
 display_total ($with_span=true)
 display the balance (total) of the operation More...
 
 get_operation_exercice_sql ()
 
 input_transfer ()
 input data for transfering More...
 
 set_operation_exercice_sql (Operation_Exercice_SQL $operation_exercice_sql)
 
 submit_transfer ($ledger_id)
 transfer to accountancy More...
 
 transform ($ledger_id)
 Transform the data in table OPERATION_EXERCICE and OPERATION_EXERCICE_DETAIL into an array usable by Acc_Ledger, the result will be stored into the global variable $oe_data @globals $oe_data array with the data transformed. More...
 

Private Attributes

 $exercice
 
 $from_folder
 
 $signature
 

Additional Inherited Members

- Static Public Member Functions inherited from Operation_Exercice
static delete ($aOperation_id)
 
static input_row (Operation_Exercice_Detail_SQL $operation_detail_sql)
 input one row of operation_exercice More...
 
static input_source ()
 input the source of the data : folder, exercice, closing or opening operation More...
 
static list_draft ()
 
- Protected Attributes inherited from Operation_Exercice
 $operation_exercice_sql
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

Operation_Opening::__construct (   $p_id)

Reimplemented from Operation_Exercice.

Definition at line 35 of file operation_opening.class.php.

36 {
37 parent::__construct($p_id);
38 $this->signature = 'opening';
39
40 }

References $p_id.

Member Function Documentation

◆ display_result()

Operation_Opening::display_result ( )

Reimplemented from Operation_Exercice.

Definition at line 150 of file operation_opening.class.php.

151 {
152 echo h2("Ouverture compte");
153
154 parent::display_result(); // TODO: Change the autogenerated stub
155 }
h2($p_string, $p_class="", $raw="")
Definition: ac_common.php:68

References h2().

+ Here is the call graph for this function:

◆ from_request()

Operation_Opening::from_request ( )

Definition at line 79 of file operation_opening.class.php.

80 {
81 $http = new HttpInput();
82 $this->exercice = $http->request("exercice", "number");
83 $this->from_folder = $http->request("dos_id", "number");
84 }
manage the http input (get , post, request) and extract from an array

References $http.

◆ get_exercice()

Operation_Opening::get_exercice ( )
Returns
mixed

Definition at line 61 of file operation_opening.class.php.

References $exercice.

◆ get_from_folder()

Operation_Opening::get_from_folder ( )
Returns
mixed

Definition at line 45 of file operation_opening.class.php.

References $from_folder.

◆ get_signature()

Operation_Opening::get_signature ( )

Definition at line 74 of file operation_opening.class.php.

74 : string
75 {
76 return $this->signature;
77 }

References $signature.

◆ insert()

Operation_Opening::insert ( )

insert data into data operation_exercice and operation_exercice_detail

Returns
void

Definition at line 90 of file operation_opening.class.php.

91 {
93 $other_dossier = new Database($this->from_folder);
94
95 $sql = "
96with total_account as (
97 select sum(a.montant) as tot_amount, j_poste, f_id
98 from
99 (select j_id, case when j_debit='t' then j_montant
100 else j_montant * (-1) end as montant
101 from jrnx) as a
102 join jrnx using (j_id)
103 join parm_periode on (j_tech_per = p_id )
104 where
105 p_exercice=$1
106 and j_poste::text not like '7%'
107 and j_poste::text not like '6%'
108 group by j_poste,f_id
109 having (sum(a.montant) != 0 )
110 )
111select t1.tot_amount
112 ,t1.j_poste
113 ,(select pcm_lib from tmp_pcmn where pcm_val=t1.j_poste) as lib_accounting
114 ,t1.f_id
115 ,(select ad_value fd2 from fiche_detail fd2 where fd2.f_id=t1.f_id and fd2.ad_id=23) qcode
116,(select fd3.ad_value from fiche_detail fd3 where fd3.f_id=t1.f_id and fd3.ad_id=1) f_name
117,abs(t1.tot_amount) atot_amount
118,case when tot_amount <0 then 'f' else 't' end debit
119from total_account t1
120";
121 $exercice_report=$this->exercice+1;
122 $this->operation_exercice_sql->setp("oe_type", $this->signature)
123 ->setp("oe_dossier_id", $this->from_folder)
124 ->set("oe_text",_("Ecriture ouverture $exercice_report"))
125 ->setp("oe_exercice", $this->exercice);
126 try {
127 $cn->start();
128 $this->operation_exercice_sql->insert();
129 $array = $other_dossier->get_array($sql, array($this->exercice));
130 if (empty($array)) return;
131 foreach ($array as $item) {
133 $row->oe_id = $this->operation_exercice_sql->oe_id;
134 $row->oed_poste = (empty($item['qcode']))?$item["j_poste"]:null;
135 $row->oed_qcode = $item["qcode"];
136 $row->oed_amount = $item['atot_amount'];
137 $row->oed_label=(empty($item['qcode']))?$item['lib_accounting']:$item['f_name'];
138 $row->oed_debit = $item["debit"];
139 $row->save();
140 }
141 $cn->commit();
142
143 } catch (\Exception $e) {
144 $cn->rollback();
145 echo $e->getMessage();
146 throw $e;
147 }
148
149 }
contains the class for connecting to Noalyss
static connect()

References $array, $cn, $e, $row, $sql, and Dossier\connect().

+ Here is the call graph for this function:

◆ set_exercice()

Operation_Opening::set_exercice (   $exercice)
Parameters
mixed$exercice

Definition at line 69 of file operation_opening.class.php.

69 : void
70 {
71 $this->exercice = $exercice;
72 }

References $exercice.

◆ set_from_folder()

Operation_Opening::set_from_folder (   $from_folder)
Parameters
mixed$from_folder

Definition at line 53 of file operation_opening.class.php.

53 : void
54 {
55 $this->from_folder = $from_folder;
56 }

References $from_folder.

Field Documentation

◆ $exercice

Operation_Opening::$exercice
private

Definition at line 33 of file operation_opening.class.php.

Referenced by get_exercice(), and set_exercice().

◆ $from_folder

Operation_Opening::$from_folder
private

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

Referenced by get_from_folder(), and set_from_folder().

◆ $signature

Operation_Opening::$signature
private

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

Referenced by get_signature().


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