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

Public Member Functions

 __construct ($p_id)
 
 display_result ()
 
 from_request ()
 
 get_exercice ()
 
 get_signature ()
 
 insert ()
 insert data into data operation_exercice and operation_exercice_detail More...
 
 set_exercice ($exercice)
 
- 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
 
 $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 24 of file operation_closing.class.php.

Constructor & Destructor Documentation

◆ __construct()

Operation_Closing::__construct (   $p_id)

Reimplemented from Operation_Exercice.

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

30 {
31 parent::__construct($p_id);
32 $this->signature='closing';
33
34 }

References $p_id.

Member Function Documentation

◆ display_result()

Operation_Closing::display_result ( )

Reimplemented from Operation_Exercice.

Definition at line 120 of file operation_closing.class.php.

121 {
122 echo h2("ClĂ´ture compte");
123
124 parent::display_result(); // TODO: Change the autogenerated stub
125 }
h2($p_string, $p_class="", $raw="")
Definition: ac_common.php:68

References h2().

+ Here is the call graph for this function:

◆ from_request()

Operation_Closing::from_request ( )

Definition at line 52 of file operation_closing.class.php.

53 {
54 $http = new HttpInput();
55 $this->exercice = $http->request("exercice_cl", "number");
56 }
manage the http input (get , post, request) and extract from an array

References $http.

◆ get_exercice()

Operation_Closing::get_exercice ( )

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

References $exercice.

◆ get_signature()

Operation_Closing::get_signature ( )

Definition at line 47 of file operation_closing.class.php.

47 : string
48 {
49 return $this->signature;
50 }

References $signature.

◆ insert()

Operation_Closing::insert ( )

insert data into data operation_exercice and operation_exercice_detail

Returns
void

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

62 {
64
65 $sql = "
66with total_account as (
67 select sum(a.montant) as tot_amount, j_poste, f_id
68 from
69 (select j_id, case when j_debit='t' then j_montant
70 else j_montant * (-1) end as montant
71 from jrnx) as a
72 join jrnx using (j_id)
73 join parm_periode on (j_tech_per = p_id )
74 where
75 p_exercice=$1
76 and( j_poste::text like '7%'
77 or j_poste::text like '6%')
78 group by j_poste,f_id
79 having (sum(a.montant) != 0 )
80 )
81select t1.tot_amount
82 ,t1.j_poste
83 ,(select pcm_lib from tmp_pcmn where pcm_val=t1.j_poste) as lib_accounting
84 ,t1.f_id
85 ,(select ad_value fd2 from fiche_detail fd2 where fd2.f_id=t1.f_id and fd2.ad_id=23) qcode
86,(select fd3.ad_value from fiche_detail fd3 where fd3.f_id=t1.f_id and fd3.ad_id=1) f_name
87,abs(t1.tot_amount) atot_amount
88,case when tot_amount <0 then 'f' else 't' end debit
89from total_account t1
90";
91 $exercice_report=$this->exercice;
92 $this->operation_exercice_sql->setp("oe_type", $this->signature)
93 ->setp("oe_dossier_id", Dossier::id())
94 ->set("oe_text",_("Ecriture cloture $exercice_report"))
95 ->setp("oe_exercice", $this->exercice);
96 try {
97 $cn->start();
98 $this->operation_exercice_sql->insert();
99 $array = $cn->get_array($sql, array($this->exercice));
100 if (empty($array)) return;
101 foreach ($array as $item) {
103 $row->oe_id = $this->operation_exercice_sql->oe_id;
104 $row->oed_poste = (empty($item['qcode']))?$item["j_poste"]:null;
105 $row->oed_qcode = $item["qcode"];
106 $row->oed_amount = $item['atot_amount'];
107 $row->oed_label=(empty($item['qcode']))?$item['lib_accounting']:$item['f_name'];
108 $row->oed_debit = $item["debit"];
109 $row->save();
110 }
111 $cn->commit();
112
113 } catch (\Exception $e) {
114 $cn->rollback();
115 echo $e->getMessage();
116 throw $e;
117 }
118
119 }
static id()
return the 'gDossier' value after a check
static connect()

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

+ Here is the call graph for this function:

◆ set_exercice()

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

Definition at line 43 of file operation_closing.class.php.

43 : void
44 {
45 $this->exercice = $exercice;
46 }

References $exercice.

Field Documentation

◆ $exercice

Operation_Closing::$exercice
private

Definition at line 27 of file operation_closing.class.php.

Referenced by get_exercice(), insert(), and set_exercice().

◆ $signature

Operation_Closing::$signature
private

Definition at line 26 of file operation_closing.class.php.

Referenced by get_signature().


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