53 if (is_array($pa_ledger) == FALSE) {
54 throw new Exception (_(
'pa_ledger doit être un tableau'),
EXC_PARAM_VALUE);
57 $this->ma_ledger=$pa_ledger;
58 $this->m_from=$p_from;
60 $this->m_mode=$p_mode;
61 $this->filter_operation=
'all';
78 if (! in_array(
$ledger_type,[
'ACH',
'ODS',
'VEN',
'FIN'])) {
170 $nb_ledger=count($pa_ledger);
183 for (
$i=0;
$i<$nb_ledger;
$i++)
186 $type_next=
$ledger->get_type();
189 if ($type_next!=
$type)
201 $ret->set_filter_operation($p_paid);
212 $ret->set_filter_operation($p_paid);
229 if ($p_jrn_type==
'ODS')
235 $name=$this->
db->get_value(
'select ad_value from fiche_detail where ad_id=1 and f_id=$1',
237 $first_name=$this->
db->get_value(
'select ad_value from fiche_detail where ad_id=32 and f_id=$1',
239 return $name.
' '.$first_name;
253 $tiers=$this->
db->get_value(
'select max(qs_client) '
254 .
'from quant_sold join jrnx using (j_id) '
255 .
'join jrn on (jr_grpt_id=j_grpt) where jrn.jr_id=$1',
259 $tiers=$this->
db->get_value(
'select max(qp_supplier) '
260 .
' from quant_purchase '
261 .
' join jrnx using (j_id) '
262 .
' join jrn on (jr_grpt_id=j_grpt) '
263 .
' where jrn.jr_id=$1',
268 $tiers=$this->
db->get_value(
'select qf_other from quant_fin where jr_id=$1',
272 if ($this->
db->count()==0)
284 static $not_done=TRUE;
287 $prepare_query->prepare_reconcile_date();
312 abstract function get_row($p_limit, $p_offset);
326 $sql_filter=
" and (jr_date_paid is not null or jr_rapt ='paid' ) ";
329 $sql_filter=
" and (jr_date_paid is null and coalesce(jr_rapt,'x') <> 'paid' ) ";
332 throw new Exception(_(
"Filtre invalide",5));
365 $str_ledger=join(
',',$this->ma_ledger);
366 $count=$this->
db->get_value(
"select count(*)
368 join jrnx using (j_id)
369 join jrn on (jr_grpt_id=j_grpt)
370 where jr_tech_per>=$1 and jr_tech_per <=$2
371 and jr_def_id in ($str_ledger) ",[$this->m_from,$this->m_to]);
387 $prepare=$this->
db->is_prepare(
"supp_tax_info");
388 if ( $prepare ==
false ){
389 $this->
db->prepare(
"supp_tax_info",
"
391 case when j.j_debit is false and jd.jrn_def_type='ACH' then 0-j_montant
392 when j.j_debit is true and jd.jrn_def_type='VEN' then 0-j_montant
393 else j.j_montant end j_montant,
399 join acc_other_tax using (ac_id)
400 join jrnx j using (j_id)
401 join jrn_def jd on (j.j_jrn_def=jd.jrn_def_id)
406 $data=$this->get_data();
411 $ret=$this->
db->execute(
"supp_tax_info",array(
$data[
$i][
"jr_grpt_id"]));
416 $this->set_data(
$data);
record_log($p_message)
Record an error message into the log file of the server.
display financial operations in HTML , PDF or CSV
manage the list of operation when we need several ledger with a different type or from Misceleaneous ...
Display the operations for Purchase.
Acc_Ledger_History : Manage the list (history) of operations for display.
Display history of operation.
set_ledger_type($ledger_type)
set_from($m_from)
setter m_from (periode id)
get_ledger()
setter / getter
get_filter_operation()
Filter operation.
$m_to
Ending Periode : periode.p_id.
set_m_mode($m_mode)
Setter.
export_html()
call the right function , depending of m_mode
export_oneline_html()
display operation on one line m_mode=L
set_to($m_to)
setter m_to (periode id)
$m_from
Starting Periode : periode.p_id.
has_other_tax()
count the number of addition tax for the ledger
get_tiers($p_jrn_type, $jr_id)
Retrieve the third : supplier for purchase, customer for sale, bank for fin,.
export_accounting_html()
display accounting of operations m_mode=A
set_filter_operation($filter_operation)
Filter operation ,.
build_filter_operation()
Build a SQL clause to filter operation depending if they are paid, unpaid or no filter.
export_extended_html()
display extended details of operation m_mode=E
$filter_operation
type of ledger VEN , ACH , ODS, FIN
get_from()
setter / getter
set_a_ledger($ma_ledger)
setter ma_ledger (array of jrn_def_id)
get_tiers_id($p_jrn_type, $jr_id)
Return the f_id of the tiers , called by get_tiers.
static factory(Database $cn, $pa_ledger, $p_from, $p_to, $p_mode, $p_paid)
Build the right object.
$m_mode
mode of export L : one line, E accounting writing , D : Detail
prepare_reconcile_date()
Prepare the query for fetching the linked operation @staticvar int $prepare.
__construct(Database $cn, $pa_ledger, $p_from, $p_to, $p_mode)
get_mode()
setter / getter
export_detail_html()
display detail of operations m_mode=D
add_additional_tax_info()
add additional info about additional tax.
$ma_ledger
Array of ledger id : jrn_def.jrn_def_id.
get_row($p_limit, $p_offset)
static fetch_all($ret)
wrapper for the function pg_fetch_all
contains the class for connecting to Noalyss
contains prepared query used in different classes of the application