phpcompta  Version-6
 All Data Structures Namespaces Files Functions Variables Pages
Public Member Functions
Lettering_Account Class Reference

only for operation retrieved thanks a account (jrnx.j_poste) manage the accounting entries for a given account More...

Inheritance diagram for Lettering_Account:
Lettering

Public Member Functions

 __construct ($p_init, $p_account=null)
 
 get_all ()
 fills this->content with all the operation for the this->account(jrnx.j_poste)
 
 get_filter ($p_jid=0)
 fills the this->content, datas are filtered thanks
 
 get_letter ()
 same as get_all but only for lettered operation
 
 get_letter_diff ()
 same as get_all but only for lettered operation
 
 get_unletter ()
 same as get_all but only for unlettered operation
 
- Public Member Functions inherited from Lettering
 __construct ($p_init)
 constructor
 
 delete ()
 
 get_info ()
 
 get_linked ($p_jlid)
 
 get_parameter ($p_string)
 
 insert ()
 
 insert_couple ($j_id1, $j_id2)
 *Use to just insert a couple of lettered operation
 
 load ()
 
 save ($p_array)
 save from array
 
 seek ($cond, $p_array=null)
 retrieve * row thanks a condition
 
 set_parameter ($p_string, $p_value)
 
 show_letter ($p_jid)
 
 show_list ($p_type)
 *wrapper : it call show_all, show_lettered or show_not_lettered depending of the parameter
 
 update ()
 
 verify ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Lettering
static test_me ()
 Unit test for the class.
 
- Protected Member Functions inherited from Lettering
 show_all ()
 *show all the record from jrnx and their status (linked or not) *it fills the array $this->content
 
 show_lettered ()
 *show only the lettered records from jrnx *it fills the array $this->content
 
 show_lettered_diff ()
 *show only the lettered records from jrnx *it fills the array $this->content
 
 show_not_lettered ()
 *show only the not lettered records from jrnx *it fills the array $this->content
 
- Protected Attributes inherited from Lettering
 $variable
 

Detailed Description

only for operation retrieved thanks a account (jrnx.j_poste) manage the accounting entries for a given account

Definition at line 403 of file class_lettering.php.

Constructor & Destructor Documentation

Lettering_Account::__construct (   $p_init,
  $p_account = null 
)

Definition at line 405 of file class_lettering.php.

{
parent::__construct($p_init);
$this->account=$p_account;
$this->object_type='account';
}

Member Function Documentation

Lettering_Account::get_all ( )

fills this->content with all the operation for the this->account(jrnx.j_poste)

Definition at line 464 of file class_lettering.php.

References $sql, content, and db.

{
$sql=" with let_diff as (select jl_id,deb_amount-cred_amount as diff_letter1
from
( select jl_id,coalesce(sum(j_montant),0) as cred_amount from letter_cred join jrnx using (j_id) group by jl_id) as CRED
left join (select jl_id,coalesce(sum(j_montant),0) as deb_amount from letter_deb join jrnx using (j_id) group by jl_id) as DEB using (jl_id)) ,
letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
coalesce(let_diff.jl_id,-1) as letter,
diff_letter1 as letter_diff
from jrnx join jrn on (j_grpt = jr_grpt_id)
left join letter_jl using (j_id)
left join let_diff using (jl_id)
where j_poste = $1 and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
and $this->sql_ledger
order by j_date,j_id";
$this->content=$this->db->get_array($sql,array($this->account,$this->start,$this->end));
}
Lettering_Account::get_filter (   $p_jid = 0)

fills the this->content, datas are filtered thanks

  • fil_deb poss values t (debit), f(credit), ' ' (everything)
  • fil_amount_max max amount
  • fil_amount_min min amount
  • $this->start min date
  • $this->end max date
  • this->account: accounting

Definition at line 421 of file class_lettering.php.

References $sql, content, db, and isNumber().

{
$filter_deb='';
if (isset($this->fil_deb))
{
switch ($this->fil_deb)
{
case 0:
$filter_deb=" and j_debit='t' ";
break;
case 1:
$filter_deb=" and j_debit='f' ";
break;
case 2:
$filter_deb=" ";
break;
}
}
$filter_amount="";
if ( isset ($this->fil_amount_max ) &&
isset ($this->fil_amount_min ) &&
isNumber($this->fil_amount_max)==1 &&
isNumber($this->fil_amount_min)==1 &&
($this->fil_amount_max != 0 || $this->fil_amount_min != 0) )
$filter_amount=" and (j_montant >= $this->fil_amount_min and j_montant<=$this->fil_amount_max or (coalesce(comptaproc.get_letter_jnt($p_jid),-1)= coalesce(comptaproc.get_letter_jnt(j_id),-1) and coalesce(comptaproc.get_letter_jnt($p_jid),-1) <> -1 )) ";
$sql="
select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,
j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
coalesce(comptaproc.get_letter_jnt(j_id),-1) as letter
from jrnx join jrn on (j_grpt = jr_grpt_id)
where j_poste = $1 and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
and $this->sql_ledger
$filter_deb
$filter_amount
order by j_date,j_id";
$this->content=$this->db->get_array($sql,array($this->account,$this->start,$this->end));
}
Lettering_Account::get_letter ( )

same as get_all but only for lettered operation

Definition at line 487 of file class_lettering.php.

References $sql, content, and db.

{
$sql="
with let_diff as (select jl_id,deb_amount-cred_amount as diff_letter1
from
( select jl_id,coalesce(sum(j_montant),0) as cred_amount from letter_cred join jrnx using (j_id) group by jl_id) as CRED
left join (select jl_id,coalesce(sum(j_montant),0) as deb_amount from letter_deb join jrnx using (j_id) group by jl_id) as DEB using (jl_id)) ,
letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
let_diff.jl_id as letter,
diff_letter1 as letter_diff
from jrnx join jrn on (j_grpt = jr_grpt_id)
join letter_jl using (j_id)
left join let_diff using (jl_id)
where j_poste = $1 and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
and $this->sql_ledger
order by j_date,j_id";
$this->content=$this->db->get_array($sql,array($this->account,$this->start,$this->end));
}
Lettering_Account::get_letter_diff ( )

same as get_all but only for lettered operation

Definition at line 510 of file class_lettering.php.

References $sql, content, and db.

{
$sql="
with let_diff as (select jl_id,deb_amount-cred_amount as diff_letter1
from
( select jl_id,coalesce(sum(j_montant),0) as cred_amount from letter_cred join jrnx using (j_id) group by jl_id) as CRED
left join (select jl_id,coalesce(sum(j_montant),0) as deb_amount from letter_deb join jrnx using (j_id) group by jl_id) as DEB using (jl_id)) ,
letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
select distinct j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
let_diff.jl_id as letter,
diff_letter1 as letter_diff
from
jrnx join jrn on (j_grpt = jr_grpt_id)
join letter_jl using (j_id)
join let_diff using (jl_id)
where j_poste = $1 and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
and $this->sql_ledger
and diff_letter1 <> 0
order by j_date,j_id";
$this->content=$this->db->get_array($sql,array($this->account,$this->start,$this->end));
}
Lettering_Account::get_unletter ( )

same as get_all but only for unlettered operation

Definition at line 536 of file class_lettering.php.

References $sql, content, and db.

{
$sql="
with letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
-1 as letter,
0 as letter_diff
from jrnx join jrn on (j_grpt = jr_grpt_id)
where j_poste = $1 and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
and $this->sql_ledger
and j_id not in (select j_id from letter_jl)
order by j_date,j_id";
$this->content=$this->db->get_array($sql,array($this->account,$this->start,$this->end));
}

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