noalyss Version-9
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 ()
 
 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 674 of file lettering.class.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

684 {
685 parent::__construct($p_init);
686 $this->quick_code=$p_qcode;
687 $this->object_type='card';
688 }

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 753 of file lettering.class.php.

754 {
755 $sql="
756 with let_diff as (select jl_id,deb_amount-cred_amount as diff_letter1
757 from
758 ( 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
759 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)) ,
760 letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
761 select DISTINCT j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
762 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
763 coalesce(let_diff.jl_id,-1) as letter,
764 diff_letter1 as letter_diff,
765 round(j_montant/currency_rate,4) as currency_amount,
766 currency_rate,
767 currency_id,
768 currency_rate_ref,
769 (select cr_code_iso from currency where currency_id=currency.id) as cr_code_iso
770 from jrnx join jrn on (j_grpt = jr_grpt_id)
771 left join letter_jl using (j_id)
772 left join let_diff using (jl_id)
773 where j_qcode = upper($1) and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
774 and $this->sql_ledger
775
776 order by j_date,j_id";
777 $this->content=$this->db->get_array($sql, array($this->quick_code, $this->start, $this->end));
778 }
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 880 of file lettering.class.php.

881 {
882 $sql_let=($p_type=='unlet')?' let_diff.jl_id is null and':'';
883 $sql=" with let_diff as (select jl_id,deb_amount-cred_amount as diff_letter1
884 from
885 ( 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
886 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)) ,
887 letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
888 select DISTINCT j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
889 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
890 coalesce(let_diff.jl_id,-1) as letter,
891 diff_letter1 as letter_diff,
892 extract ('days' from coalesce(jr_date_paid,now())-jr_date) as day_paid,
893 jd1.jrn_def_type
894 from jrnx join jrn on (j_grpt = jr_grpt_id)
895 join jrn_def as jd1 on (jrn.jr_def_id=jd1.jrn_def_id)
896 left join letter_jl using (j_id)
897 left join let_diff using (jl_id)
898 where
899 {$sql_let}
900 j_qcode = upper($1)
901 and j_date >= to_date($2,'DD.MM.YYYY')
902 and {$this->sql_ledger}
903 and jrn_def_type in ('VEN','ACH')
904 order by j_date,j_id";
905 $this->content=$this->db->get_array($sql, array($this->quick_code, $this->start));
906 }

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 699 of file lettering.class.php.

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

784 {
785 $sql="
786 with let_diff as (select jl_id,deb_amount-cred_amount as diff_letter1
787 from
788 ( 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
789 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)) ,
790 letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
791 select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
792 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
793 let_diff.jl_id as letter,
794 diff_letter1 as letter_diff,
795 round(j_montant/currency_rate,4) as currency_amount,
796 currency_rate,
797 currency_id,
798 currency_rate_ref,
799 (select cr_code_iso from currency where currency_id=currency.id) as cr_code_iso
800 from jrnx join jrn on (j_grpt = jr_grpt_id)
801 join letter_jl using (j_id)
802 left join let_diff using (jl_id)
803 where j_qcode = upper($1) and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
804 and $this->sql_ledger
805 order by j_date,j_id";
806 $this->content=$this->db->get_array($sql, array($this->quick_code, $this->start, $this->end));
807 }

References $sql, content, and db.

◆ get_letter_diff()

Lettering_Card::get_letter_diff ( )

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

810 {
811 $sql="
812 with let_diff as (select jl_id,deb_amount-cred_amount as diff_letter1
813 from
814 ( 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
815 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)) ,
816 letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
817 select distinct j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
818 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
819 let_diff.jl_id as letter,
820 diff_letter1 as letter_diff,
821 round(j_montant/currency_rate,4) as currency_amount,
822 currency_id,
823 currency_rate,
824 currency_rate_ref,
825 (select cr_code_iso from currency where currency_id=currency.id) as cr_code_iso
826 from jrnx join jrn on (j_grpt = jr_grpt_id)
827 left join letter_jl using (j_id)
828 left join let_diff using (jl_id)
829 where j_qcode = upper($1) and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
830 and $this->sql_ledger
831 and diff_letter1 <>0
832 order by j_date,j_id";
833 $this->content=$this->db->get_array($sql, array($this->quick_code, $this->start, $this->end));
834 }

References $sql, content, and db.

◆ get_unletter()

Lettering_Card::get_unletter ( )

same as get_all but only for unlettered operation

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

840 {
841 $sql="
842 select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
843 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
844 -1 as letter,
845 0 as letter_diff,
846 round(j_montant/currency_rate,4) as currency_amount,
847 currency_id,
848 currency_rate,
849 currency_rate_ref,
850 (select cr_code_iso from currency where currency_id=currency.id) as cr_code_iso
851 from jrnx join jrn on (j_grpt = jr_grpt_id)
852 where j_qcode = upper($1) and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
853 and $this->sql_ledger
854 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) )
855 order by j_date,j_id";
856 $this->content=$this->db->get_array($sql, array($this->quick_code, $this->start, $this->end));
857 }

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 682 of file lettering.class.php.


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