noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
Operation_Closing Class Reference

closing operation , end of exercice for French accountancy More...

+ 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
 
 set_exercice ($exercice)
 
- Public Member Functions inherited from Operation_Exercice
 display_row ($data, $row_tr=true)
 let display one row
 
 display_total ($with_span=true)
 display the balance (total) of the operation
 
 get_operation_exercice_sql ()
 
 input_transfer ()
 input data for transfering
 
 set_operation_exercice_sql (Operation_Exercice_SQL $operation_exercice_sql)
 
 submit_transfer ($ledger_id)
 transfer to accountancy
 
 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.
 

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
 
static input_source ()
 input the source of the data : folder, exercice, closing or opening operation
 
static list_draft ()
 
- Protected Attributes inherited from Operation_Exercice
 $operation_exercice_sql
 

Detailed Description

closing operation , end of exercice for French accountancy

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

Constructor & Destructor Documentation

◆ __construct()

Operation_Closing::__construct ( $p_id)

Reimplemented from Operation_Exercice.

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

34 {
35 parent::__construct($p_id);
36 $this->signature='closing';
37
38 }

References $p_id.

Member Function Documentation

◆ display_result()

Operation_Closing::display_result ( )

Reimplemented from Operation_Exercice.

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

125 {
126 echo h2("ClĂ´ture compte");
127
128 parent::display_result(); // TODO: Change the autogenerated stub
129 }
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 56 of file operation_closing.class.php.

57 {
58 $http = new HttpInput();
59 $this->exercice = $http->request("exercice_cl", "number");
60 }

References $http.

◆ get_exercice()

Operation_Closing::get_exercice ( )

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

References $exercice.

◆ get_signature()

Operation_Closing::get_signature ( )

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

51 : string
52 {
53 return $this->signature;
54 }

References $signature.

◆ insert()

Operation_Closing::insert ( )

insert data into data operation_exercice and operation_exercice_detail

Returns
void

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

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

References $array, $cn, $e, $exercice, $row, $sql, and _.

◆ set_exercice()

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

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

47 : void
48 {
49 $this->exercice = $exercice;
50 }

References $exercice.

Field Documentation

◆ $exercice

Operation_Closing::$exercice
private

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

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

◆ $signature

Operation_Closing::$signature
private

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

Referenced by get_signature().


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