noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
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:
+ Collaboration diagram for Lettering_Account:

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 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

 $account
 
- 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 account (jrnx.j_poste) manage the accounting entries for a given account

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

Constructor & Destructor Documentation

◆ __construct()

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

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

494 {
495 parent::__construct($p_init);
496 $this->account=$p_account;
497 $this->object_type='account';
498 }

Member Function Documentation

◆ get_all()

Lettering_Account::get_all ( )

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

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

559 {
560 $sql=" with let_diff as (select jl_id,deb_amount-cred_amount as diff_letter1
561 from
562 ( 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
563 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)) ,
564 letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
565 select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
566 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
567 coalesce(let_diff.jl_id,-1) as letter,
568 diff_letter1 as letter_diff,
569 round(j_montant/currency_rate,4) as currency_amount,
570 currency_id,
571 currency_rate,
572 currency_rate_ref,
573 (select cr_code_iso from currency where currency_id=currency.id) as cr_code_iso
574 from jrnx join jrn on (j_grpt = jr_grpt_id)
575 left join letter_jl using (j_id)
576 left join let_diff using (jl_id)
577 where j_poste = $1 and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
578 and $this->sql_ledger
579
580 order by j_date,j_id";
581 $this->content=$this->db->get_array($sql, array($this->account, $this->start, $this->end));
582 }
else $card content[$j]['j_montant']
$SecUser db

References $sql, content, and db.

◆ get_filter()

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

510 {
511 $filter_deb='';
512 if (isset($this->fil_deb))
513 {
514 switch ($this->fil_deb)
515 {
516 case 0:
517 $filter_deb=" and j_debit='t' ";
518 break;
519 case 1:
520 $filter_deb=" and j_debit='f' ";
521 break;
522 case 2:
523 $filter_deb=" ";
524 break;
525 }
526 }
527 $filter_amount="";
528 if (isset($this->fil_amount_max)&&
529 isset($this->fil_amount_min)&&
530 isNumber($this->fil_amount_max)==1&&
531 isNumber($this->fil_amount_min)==1&&
532 ($this->fil_amount_max!=0||$this->fil_amount_min!=0))
533 $filter_amount=" and (j_montant >= $this->fil_amount_min and j_montant<=$this->fil_amount_max "
534 . " or (coalesce(comptaproc.get_letter_jnt($p_jid),-1)= coalesce(comptaproc.get_letter_jnt(j_id),-1) "
535 . " and coalesce(comptaproc.get_letter_jnt($p_jid),-1) <> -1 )) ";
536 $sql="
537 select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,
538 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
539 coalesce(comptaproc.get_letter_jnt(j_id),-1) as letter,
540 jr_pj_number,
541 round(j_montant/currency_rate,4) as currency_amount,
542 currency_rate,
543 currency_rate_ref,
544 (select cr_code_iso from currency where currency_id=currency.id) as cr_code_iso
545 from jrnx join jrn on (j_grpt = jr_grpt_id)
546 where j_poste = $1 and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
547 and $this->sql_ledger
548 $filter_deb
549 $filter_amount
550 order by j_date,j_id";
551
552 $this->content=$this->db->get_array($sql, array($this->account, $this->start, $this->end));
553 }
isNumber($p_int)

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

+ Here is the call graph for this function:

◆ get_letter()

Lettering_Account::get_letter ( )

same as get_all but only for lettered operation

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

588 {
589 $sql="
590 with let_diff as (select jl_id,deb_amount-cred_amount as diff_letter1
591 from
592 ( 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
593 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)) ,
594 letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
595 select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
596 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
597 let_diff.jl_id as letter,
598 diff_letter1 as letter_diff,
599 round(j_montant/currency_rate,4) as currency_amount,
600 currency_id,
601 currency_rate,
602 currency_rate_ref,
603 (select cr_code_iso from currency where currency_id=currency.id) as cr_code_iso
604 from jrnx join jrn on (j_grpt = jr_grpt_id)
605 join letter_jl using (j_id)
606 left join let_diff using (jl_id)
607 where j_poste = $1 and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
608 and $this->sql_ledger
609 order by j_date,j_id";
610 $this->content=$this->db->get_array($sql, array($this->account, $this->start, $this->end));
611 }

References $sql, content, and db.

◆ get_letter_diff()

Lettering_Account::get_letter_diff ( )

same as get_all but only for lettered operation

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

617 {
618 $sql="
619 with let_diff as (select jl_id,deb_amount-cred_amount as diff_letter1
620 from
621 ( 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
622 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)) ,
623 letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
624 select distinct j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
625 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
626 let_diff.jl_id as letter,
627 diff_letter1 as letter_diff,
628 round(j_montant/currency_rate,4) as currency_amount,
629 currency_id,
630 currency_rate,
631 currency_rate_ref,
632 (select cr_code_iso from currency where currency_id=currency.id) as cr_code_iso
633 from
634 jrnx join jrn on (j_grpt = jr_grpt_id)
635 join letter_jl using (j_id)
636 join let_diff using (jl_id)
637 where j_poste = $1 and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
638 and $this->sql_ledger
639 and diff_letter1 <> 0
640 order by j_date,j_id";
641 $this->content=$this->db->get_array($sql, array($this->account, $this->start, $this->end));
642 }

References $sql, content, and db.

◆ get_unletter()

Lettering_Account::get_unletter ( )

same as get_all but only for unlettered operation

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

648 {
649 $sql="
650 with letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
651 select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
652 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
653 -1 as letter,
654 0 as letter_diff,
655 round(j_montant/currency_rate,4) as currency_amount,
656 currency_id,
657 currency_rate,
658 currency_rate_ref,
659 (select cr_code_iso from currency where currency_id=currency.id) as cr_code_iso
660 from jrnx join jrn on (j_grpt = jr_grpt_id)
661 where j_poste = $1 and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
662 and $this->sql_ledger
663 and j_id not in (select j_id from letter_jl)
664 order by j_date,j_id";
665 $this->content=$this->db->get_array($sql, array($this->account, $this->start, $this->end));
666 }

References $sql, content, and db.

Field Documentation

◆ $account

Lettering_Account::$account

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


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