noalyss
Version-6.7.2
|
only for operation retrieved thanks a account (jrnx.j_poste) manage the accounting entries for a given account More...
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 |
only for operation retrieved thanks a account (jrnx.j_poste) manage the accounting entries for a given account
Definition at line 402 of file class_lettering.php.
Lettering_Account::__construct | ( | $ | p_init, |
$ | p_account = null |
||
) |
Definition at line 404 of file class_lettering.php.
{ parent::__construct($p_init); $this->account=$p_account; $this->object_type='account'; }
fills this->content with all the operation for the this->account(jrnx.j_poste)
Definition at line 463 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
Definition at line 420 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)); }
same as get_all but only for lettered operation
Definition at line 486 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)); }
same as get_all but only for lettered operation
Definition at line 509 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)); }
same as get_all but only for unlettered operation
Definition at line 535 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)); }