|
noalyss
Version-6.7.2
|
only for operation retrieved thanks a quick_code manage the accounting entries for a given card More...
Public Member Functions | |
| __construct ($p_init, $p_qcode=null) | |
| constructor | |
| get_all () | |
| fills this->content with all the operation for the this->quick_code(j_qcode) | |
| 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 () | |
| get_unletter () | |
| same as get_all but only for unlettered operation | |
only for operation retrieved thanks a quick_code manage the accounting entries for a given card
Definition at line 556 of file class_lettering.php.
| Lettering_Card::__construct | ( | $ | p_init, |
| $ | p_qcode = null |
||
| ) |
constructor
| $p_init | db resource |
| $p_qcode | quick_code of the jrnx.j_id |
Definition at line 563 of file class_lettering.php.
{
parent::__construct($p_init);
$this->quick_code=$p_qcode;
$this->object_type='card';
}
fills this->content with all the operation for the this->quick_code(j_qcode)
Definition at line 628 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,
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_qcode = upper($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->quick_code,$this->start,$this->end));
}
| Lettering_Card::get_filter | ( | $ | p_jid = 0 | ) |
fills the this->content, datas are filtered thanks
Definition at line 578 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 between $this->fil_amount_min and $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="
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,
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_qcode = upper($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->quick_code,$this->start,$this->end));
}
same as get_all but only for lettered operation
Definition at line 653 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_qcode = upper($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->quick_code,$this->start,$this->end));
}
Definition at line 673 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)
left join letter_jl using (j_id)
left join let_diff using (jl_id)
where j_qcode = upper($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->quick_code,$this->start,$this->end));
}
same as get_all but only for unlettered operation
Definition at line 697 of file class_lettering.php.
References $sql, content, and db.
{
$sql="
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_qcode = upper($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_deb join jnt_letter using (jl_id) union select j_id from letter_cred join jnt_letter using (jl_id) )
order by j_date,j_id";
$this->content=$this->db->get_array($sql,array($this->quick_code,$this->start,$this->end));
}