noalyss Version-9
Public Member Functions
Acc_Ledger_History_Financial Class Reference

display financial operations in HTML , PDF or CSV More...

+ Inheritance diagram for Acc_Ledger_History_Financial:
+ Collaboration diagram for Acc_Ledger_History_Financial:

Public Member Functions

 __construct (Database $cn, $pa_ledger, $p_from, $p_to, $p_mode)
 
 export_accounting_html ()
 display the accounting More...
 
 export_detail_html ()
 display detail of operations m_mode=D More...
 
 export_extended_html ()
 display extended details of operation m_mode=E More...
 
 export_html ()
 display in HTML following the mode More...
 
 export_oneline_html ()
 display in HTML one operation by line More...
 
 get_data ()
 To get data. More...
 
 get_row ($p_limit=-1, $p_offset="")
 Get the rows from jrnx and quant* tables. More...
 
- Public Member Functions inherited from Acc_Ledger_History
 __construct (Database $cn, $pa_ledger, $p_from, $p_to, $p_mode)
 
 export_accounting_html ()
 display accounting of operations m_mode=A More...
 
 export_detail_html ()
 display detail of operations m_mode=D More...
 
 export_extended_html ()
 display extended details of operation m_mode=E More...
 
 export_html ()
 call the right function , depending of m_mode More...
 
 export_oneline_html ()
 display operation on one line m_mode=L More...
 
 get_filter_operation ()
 Filter operation. More...
 
 get_from ()
 setter / getter More...
 
 get_ledger ()
 setter / getter More...
 
 get_ledger_type ()
 
 get_mode ()
 setter / getter More...
 
 get_row ($p_limit, $p_offset)
 
 get_tiers ($p_jrn_type, $jr_id)
 Retrieve the third : supplier for purchase, customer for sale, bank for fin,. More...
 
 get_tiers_id ($p_jrn_type, $jr_id)
 Return the f_id of the tiers , called by get_tiers. More...
 
 get_to ()
 setter / getter More...
 
 has_other_tax ()
 count the number of addition tax for the ledger More...
 
 set_a_ledger ($ma_ledger)
 setter ma_ledger (array of jrn_def_id) More...
 
 set_filter_operation ($filter_operation)
 Filter operation ,. More...
 
 set_from ($m_from)
 setter m_from (periode id) More...
 
 set_ledger_type ($ledger_type)
 
 set_m_mode ($m_mode)
 Setter. More...
 
 set_to ($m_to)
 setter m_to (periode id) More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Acc_Ledger_History
static factory (Database $cn, $pa_ledger, $p_from, $p_to, $p_mode, $p_paid)
 Build the right object. More...
 
- Data Fields inherited from Acc_Ledger_History
 $db
 database connx More...
 
- Protected Member Functions inherited from Acc_Ledger_History
 add_additional_tax_info ()
 add additional info about additional tax. More...
 
 build_filter_operation ()
 Build a SQL clause to filter operation depending if they are paid, unpaid or no filter. More...
 
 prepare_reconcile_date ()
 Prepare the query for fetching the linked operation @staticvar int $prepare. More...
 
- Protected Attributes inherited from Acc_Ledger_History
 $filter_operation
 type of ledger VEN , ACH , ODS, FIN More...
 
 $ledger_type
 
 $m_from
 Starting Periode : periode.p_id. More...
 
 $m_mode
 mode of export L : one line, E accounting writing , D : Detail More...
 
 $m_to
 Ending Periode : periode.p_id. More...
 
 $ma_ledger
 Array of ledger id : jrn_def.jrn_def_id. More...
 

Detailed Description

display financial operations in HTML , PDF or CSV

Examples
acc_ledger_historyTest.php.

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

Constructor & Destructor Documentation

◆ __construct()

Acc_Ledger_History_Financial::__construct ( Database  $cn,
  $pa_ledger,
  $p_from,
  $p_to,
  $p_mode 
)
Parameters
Database$cn
array$pa_ledgerarray of jrn_def.jrn_def_id
integer$p_fromperiode
integer$p_to
char$p_modeE D L or A , for Extended ,Detail , Listing , Accounting
Exceptions
Exceptionif $pa_ledger is not an array

Reimplemented from Acc_Ledger_History.

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

36 {
37 parent::__construct($cn, $pa_ledger, $p_from, $p_to, $p_mode);
38 $this->ledger_type='FIN';
39 }

References $cn.

Member Function Documentation

◆ export_accounting_html()

Acc_Ledger_History_Financial::export_accounting_html ( )

display the accounting

Reimplemented from Acc_Ledger_History.

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

44 {
45 $ledger_history=new Acc_Ledger_History_Generic($this->db,
46 $this->ma_ledger, $this->m_from, $this->m_to, $this->m_mode);
47 $ledger_history->export_accounting_html();
48 }
manage the list of operation when we need several ledger with a different type or from Misceleaneous ...
$SecUser db

References db.

Referenced by export_html().

◆ export_detail_html()

Acc_Ledger_History_Financial::export_detail_html ( )

display detail of operations m_mode=D

Reimplemented from Acc_Ledger_History.

Definition at line 50 of file acc_ledger_history_financial.class.php.

51 {
52 $this->export_oneline_html();
53 }
export_oneline_html()
display in HTML one operation by line

References export_oneline_html().

+ Here is the call graph for this function:

◆ export_extended_html()

Acc_Ledger_History_Financial::export_extended_html ( )

display extended details of operation m_mode=E

Reimplemented from Acc_Ledger_History.

Definition at line 55 of file acc_ledger_history_financial.class.php.

56 {
57 $ledger_history=new Acc_Ledger_History_Generic($this->db,
58 $this->ma_ledger, $this->m_from, $this->m_to, $this->m_mode);
59 $ledger_history->export_accounting_html();
60 }

References db.

◆ export_html()

Acc_Ledger_History_Financial::export_html ( )

display in HTML following the mode

Reimplemented from Acc_Ledger_History.

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

66 {
67 switch ($this->m_mode)
68 {
69 case "E":
71 break;
72 case "D":
73 $this->export_oneline_html();
74 break;
75 case "L":
76 $this->export_oneline_html();
77 break;
78 case "A":
80 break;
81 default:
82 break;
83 }
84 }

References export_accounting_html(), and export_oneline_html().

+ Here is the call graph for this function:

◆ export_oneline_html()

Acc_Ledger_History_Financial::export_oneline_html ( )

display in HTML one operation by line

Reimplemented from Acc_Ledger_History.

Definition at line 89 of file acc_ledger_history_financial.class.php.

90 {
91 $this->get_row();
92
94 require_once NOALYSS_TEMPLATE.'/acc_ledger_history_financial_oneline.php';
95
96 }
get_row($p_limit=-1, $p_offset="")
Get the rows from jrnx and quant* tables.
prepare_reconcile_date()
Prepare the query for fetching the linked operation @staticvar int $prepare.

References get_row(), and Acc_Ledger_History\prepare_reconcile_date().

Referenced by export_detail_html(), and export_html().

+ Here is the call graph for this function:

◆ get_data()

Acc_Ledger_History_Financial::get_data ( )

To get data.

Returns
array of rows

Definition at line 160 of file acc_ledger_history_financial.class.php.

161 {
162 return $this->data;
163 }

References $data.

◆ get_row()

Acc_Ledger_History_Financial::get_row (   $p_limit = -1,
  $p_offset = "" 
)

Get the rows from jrnx and quant* tables.

Parameters
int$p_limitmax of rows to returns
int$p_offsetthe number of rows to skip

Reimplemented from Acc_Ledger_History.

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

104 {
105 $periode=sql_filter_per($this->db, $this->m_from, $this->m_to, 'p_id',
106 'jr_tech_per');
107
108 $cond_limite=($p_limit!=-1)?" limit ".$p_limit." offset ".$p_offset:"";
109
110 $ledger_list=join(",", $this->ma_ledger);
111 $sql="
112 with detail as (
113 select x.f_id as f_id,
114 (select ad_value from fiche_detail where ad_id=1 and f_id=x.f_id) as name,
115 (select ad_value from fiche_detail where ad_id=32 and f_id=x.f_id) as first_name,
116 (select ad_value from fiche_detail where ad_id=23 and f_id=x.f_id) as qcode
117 from
118 fiche as x)
119 select
120 bk.f_id as bk_f_id,
121 bk.name as bk_name,
122 bk.first_name as bk_first_name,
123 bk.qcode as bk_qcode,
124 tiers.f_id as tiers_f_id,
125 tiers.name as tiers_name,
126 tiers.first_name as tiers_first_name,
127 tiers.qcode as tiers_qcode,
128 jr_id,
129 jr_pj_number,
130 to_char(jr_date,'DD.MM.YYYY') as str_date,
131 to_char(jr_date_paid,'DD.MM.YYYY') as str_date_paid,
132 jr_internal,
133 jrn.jr_comment,
134 jr_pj_name,
135 qf_amount,
136 currency_id,
137 currency_rate,
138 currency_rate_ref,
139 oc_amount,
140 oc_vat_amount,
141 currency.cr_code_iso
142 from
143 jrn
144 join quant_fin using (jr_id)
145 join detail as tiers on (tiers.f_id=qf_other)
146 join detail as bk on (bk.f_id=qf_bank)
147 left join operation_currency using(j_id)
148 join currency on (currency.id=jrn.currency_id)
149 where
150 jr_def_id in ({$ledger_list})
151 and {$periode}
152 {$cond_limite}
153 order by jr_date, substring(jr_pj_number,'[0-9]+$')::numeric ";
154 $this->data=$this->db->get_array($sql);
155 }
sql_filter_per($p_cn, $p_from, $p_to, $p_form='p_id', $p_field='jr_tech_per')
Create the condition to filter on the j_tech_per thanks a from and to date.
Definition: ac_common.php:682

References $periode, $sql, db, and sql_filter_per().

Referenced by export_oneline_html().

+ Here is the call graph for this function:

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