noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
Lettering_Card Class Reference

only for operation retrieved thanks a quick_code manage the accounting entries for a given card More...

+ Inheritance diagram for Lettering_Card:
+ Collaboration diagram for Lettering_Card:

Public Member Functions

 __construct ($p_init, $p_qcode=null)
 
 get_all ()
 fills this->content with all the operation for the this->quick_code(j_qcode)
 
 get_balance_ageing ($p_type)
 fill $this->content with the rows from this query Columns are
 
 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 ()
 lettered operation with a different amount
 
 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 but do not make a link between operation.
 
 load ()
 
 remove_incoherent ()
 for some reason , sometimes, a record in letter_X doesn't have his counterpart in letter_Y
 
 save ($p_array)
 save from array, letter the accounting (or card) and create a link between operation
 
 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 ()
 

Data Fields

 $quick_code
 constructor
 
- Data Fields inherited from Lettering
 $content
 
 $db
 
 $end
 
 $fil_amount_max
 
 $fil_amount_min
 
 $fil_deb
 
 $linked
 
 $object_type
 
 $sql_ledger
 
 $start
 

Additional Inherited Members

- 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
 $variable (array) data member
 

Detailed Description

only for operation retrieved thanks a quick_code manage the accounting entries for a given card

Definition at line 688 of file lettering.class.php.

Constructor & Destructor Documentation

◆ __construct()

Lettering_Card::__construct ( $p_init,
$p_qcode = null )

Definition at line 697 of file lettering.class.php.

698 {
699 parent::__construct($p_init);
700 $this->quick_code=$p_qcode;
701 $this->object_type='card';
702 }

Member Function Documentation

◆ get_all()

Lettering_Card::get_all ( )

fills this->content with all the operation for the this->quick_code(j_qcode)

Definition at line 767 of file lettering.class.php.

768 {
769 $sql="
770 with let_diff as (select jl_id,deb_amount-cred_amount as diff_letter1
771 from
772 ( 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
773 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)) ,
774 letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
775 select DISTINCT j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
776 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
777 coalesce(let_diff.jl_id,-1) as letter,
778 diff_letter1 as letter_diff,
779 round(j_montant/currency_rate,4) as currency_amount,
780 currency_rate,
781 currency_id,
782 currency_rate_ref,
783 (select cr_code_iso from currency where currency_id=currency.id) as cr_code_iso
784 from jrnx join jrn on (j_grpt = jr_grpt_id)
785 left join letter_jl using (j_id)
786 left join let_diff using (jl_id)
787 where j_qcode = upper($1) and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
788 and $this->sql_ledger
789
790 order by j_date,j_id";
791 $this->content=$this->db->get_array($sql, array($this->quick_code, $this->start, $this->end));
792 }
else $card content[$j]['j_montant']
$SecUser db

References $sql, content, and db.

◆ get_balance_ageing()

Lettering_Card::get_balance_ageing ( $p_type)

fill $this->content with the rows from this query Columns are

  • j_id, id of jrnx
  • j_date, date opeation (yyyy.mm.dd)
  • to_char(j_date,'DD.MM.YYYY') as j_date_fmt,
  • jr_pj_number, receipt number
  • j_montant, amount of the rows
  • j_debit, Debit or credit
  • jr_comment, label of the operation
  • jr_internal, internal number
  • jr_id, id of jrn
  • jr_def_id, id of the ledger (jrn_def.jrn_def_id)
  • coalesce(let_diff.jl_id,-1) as letter, id of the lettering , -1 means unlettered
  • diff_letter1 as letter_diff, delta between lettered operation
  • extract ('days' from coalesce(jr_date_paid,now())-coalesce(jr_ech,jr_date)) as day_paid, days between operation and payment
  • jd1.jrn_def_type type of the ledger (FIN, ODS,VEN or ACH)
Parameters
type$p_typevalue is unlet for unlettered operation or let for everything

Definition at line 898 of file lettering.class.php.

899 {
900 $sql_let=($p_type=='unlet')?' let_diff.jl_id is null and':'';
901 $sql=" with let_diff as (select jl_id,deb_amount-cred_amount as diff_letter1
902 from
903 ( 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
904 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)) ,
905 letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
906 select DISTINCT j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
907 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
908 coalesce(let_diff.jl_id,-1) as letter,
909 diff_letter1 as letter_diff,
910 extract ('days' from coalesce(jr_date_paid,now())-jr_date) as day_paid,
911 jd1.jrn_def_type
912 from jrnx join jrn on (j_grpt = jr_grpt_id)
913 join jrn_def as jd1 on (jrn.jr_def_id=jd1.jrn_def_id)
914 left join letter_jl using (j_id)
915 left join let_diff using (jl_id)
916 where
917 {$sql_let}
918 j_qcode = upper($1)
919 and j_date >= to_date($2,'DD.MM.YYYY')
920 and {$this->sql_ledger}
921 and jrn_def_type in ('VEN','ACH')
922 order by j_date,j_id";
923 $this->content=$this->db->get_array($sql, array($this->quick_code, $this->start));
924 }

References $p_type, $sql, content, and db.

◆ get_filter()

Lettering_Card::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->quick_code: quick_code

Definition at line 713 of file lettering.class.php.

714 {
715 $filter_deb='';
716 if (isset($this->fil_deb))
717 {
718 switch ($this->fil_deb)
719 {
720 case 0:
721 $filter_deb=" and j_debit='t' ";
722 break;
723 case 1:
724 $filter_deb=" and j_debit='f' ";
725 break;
726 case 2:
727 $filter_deb=" ";
728 break;
729 }
730 }
731 $filter_amount="";
732 if (isset($this->fil_amount_max)&&
733 isset($this->fil_amount_min)&&
734 isNumber($this->fil_amount_max)==1&&
735 isNumber($this->fil_amount_min)==1&&
736 ($this->fil_amount_max!=0||$this->fil_amount_min!=0))
737 $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 )) ";
738 $sql="
739 with let_diff as (select jl_id,deb_amount-cred_amount as diff_letter1
740 from
741 ( 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
742 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)) ,
743 letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
744 select distinct j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
745 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
746 coalesce(let_diff.jl_id,-1) as letter,
747 diff_letter1 as letter_diff,
748 round(j_montant/currency_rate,4) as currency_amount,
749 currency_rate,
750 currency_rate_ref,
751 (select cr_code_iso from currency where currency_id=currency.id) as cr_code_iso
752 from jrnx join jrn on (j_grpt = jr_grpt_id)
753 left join letter_jl using (j_id)
754 left join let_diff using (jl_id)
755 where j_qcode = upper($1) and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
756 and $this->sql_ledger
757 $filter_deb
758 $filter_amount
759 order by j_date,j_id";
760
761 $this->content=$this->db->get_array($sql, array($this->quick_code, $this->start, $this->end));
762 }
isNumber($p_int)

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

+ Here is the call graph for this function:

◆ get_letter()

Lettering_Card::get_letter ( )

same as get_all but only for lettered operation

Definition at line 797 of file lettering.class.php.

798 {
799 $sql="
800 with let_diff as (select jl_id,deb_amount-cred_amount as diff_letter1
801 from
802 ( 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
803 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)) ,
804 letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
805 select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
806 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
807 let_diff.jl_id as letter,
808 diff_letter1 as letter_diff,
809 round(j_montant/currency_rate,4) as currency_amount,
810 currency_rate,
811 currency_id,
812 currency_rate_ref,
813 (select cr_code_iso from currency where currency_id=currency.id) as cr_code_iso
814 from jrnx join jrn on (j_grpt = jr_grpt_id)
815 join letter_jl using (j_id)
816 left join let_diff using (jl_id)
817 where j_qcode = upper($1) and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
818 and $this->sql_ledger
819 order by j_date,j_id";
820 $this->content=$this->db->get_array($sql, array($this->quick_code, $this->start, $this->end));
821 }

References $sql, content, and db.

◆ get_letter_diff()

Lettering_Card::get_letter_diff ( )

lettered operation with a different amount

Returns
void

Definition at line 827 of file lettering.class.php.

828 {
829 $sql="
830 with let_diff as (select jl_id,deb_amount-cred_amount as diff_letter1
831 from
832 ( 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
833 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)) ,
834 letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
835 select distinct j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
836 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
837 let_diff.jl_id as letter,
838 diff_letter1 as letter_diff,
839 round(j_montant/currency_rate,4) as currency_amount,
840 currency_id,
841 currency_rate,
842 currency_rate_ref,
843 (select cr_code_iso from currency where currency_id=currency.id) as cr_code_iso
844 from jrnx join jrn on (j_grpt = jr_grpt_id)
845 left join letter_jl using (j_id)
846 left join let_diff using (jl_id)
847 where j_qcode = upper($1) and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
848 and $this->sql_ledger
849 and diff_letter1 <>0
850 order by j_date,j_id";
851 $this->content=$this->db->get_array($sql, array($this->quick_code, $this->start, $this->end));
852 }

References $sql, content, and db.

◆ get_unletter()

Lettering_Card::get_unletter ( )

same as get_all but only for unlettered operation

Definition at line 857 of file lettering.class.php.

858 {
859 $sql="
860 select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
861 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
862 -1 as letter,
863 0 as letter_diff,
864 round(j_montant/currency_rate,4) as currency_amount,
865 currency_id,
866 currency_rate,
867 currency_rate_ref,
868 (select cr_code_iso from currency where currency_id=currency.id) as cr_code_iso
869 from jrnx join jrn on (j_grpt = jr_grpt_id)
870 where j_qcode = upper($1) and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
871 and $this->sql_ledger
872 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) )
873 order by j_date,j_id";
874 $this->content=$this->db->get_array($sql, array($this->quick_code, $this->start, $this->end));
875 }

References $sql, content, and db.

Field Documentation

◆ $quick_code

Lettering_Card::$quick_code

constructor

Parameters
$p_initdb resource
$p_qcodequick_code of the jrnx.j_id

Definition at line 696 of file lettering.class.php.


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