noalyss Version-10
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

See also
unit-test/include/class/acc_letterTest.php

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

Constructor & Destructor Documentation

◆ __construct()

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

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

507 {
508 parent::__construct($p_init);
509 $this->account=$p_account;
510 $this->object_type='account';
511 }

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

572 {
573 $sql=" with let_diff as (select jl_id,deb_amount-cred_amount as diff_letter1
574 from
575 ( 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
576 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)) ,
577 letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
578 select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
579 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
580 coalesce(let_diff.jl_id,-1) as letter,
581 diff_letter1 as letter_diff,
582 round(j_montant/currency_rate,4) as currency_amount,
583 currency_id,
584 currency_rate,
585 currency_rate_ref,
586 (select cr_code_iso from currency where currency_id=currency.id) as cr_code_iso
587 from jrnx join jrn on (j_grpt = jr_grpt_id)
588 left join letter_jl using (j_id)
589 left join let_diff using (jl_id)
590 where j_poste = $1 and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
591 and $this->sql_ledger
592
593 order by j_date,j_id";
594 $this->content=$this->db->get_array($sql, array($this->account, $this->start, $this->end));
595 }
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 522 of file lettering.class.php.

523 {
524 $filter_deb='';
525 if (isset($this->fil_deb))
526 {
527 switch ($this->fil_deb)
528 {
529 case 0:
530 $filter_deb=" and j_debit='t' ";
531 break;
532 case 1:
533 $filter_deb=" and j_debit='f' ";
534 break;
535 case 2:
536 $filter_deb=" ";
537 break;
538 }
539 }
540 $filter_amount="";
541 if (isset($this->fil_amount_max)&&
542 isset($this->fil_amount_min)&&
543 isNumber($this->fil_amount_max)==1&&
544 isNumber($this->fil_amount_min)==1&&
545 ($this->fil_amount_max!=0||$this->fil_amount_min!=0))
546 $filter_amount=" and (j_montant >= $this->fil_amount_min and j_montant<=$this->fil_amount_max "
547 . " or (coalesce(comptaproc.get_letter_jnt($p_jid),-1)= coalesce(comptaproc.get_letter_jnt(j_id),-1) "
548 . " and coalesce(comptaproc.get_letter_jnt($p_jid),-1) <> -1 )) ";
549 $sql="
550 select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,
551 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
552 coalesce(comptaproc.get_letter_jnt(j_id),-1) as letter,
553 jr_pj_number,
554 round(j_montant/currency_rate,4) as currency_amount,
555 currency_rate,
556 currency_rate_ref,
557 (select cr_code_iso from currency where currency_id=currency.id) as cr_code_iso
558 from jrnx join jrn on (j_grpt = jr_grpt_id)
559 where j_poste = $1 and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
560 and $this->sql_ledger
561 $filter_deb
562 $filter_amount
563 order by j_date,j_id";
564
565 $this->content=$this->db->get_array($sql, array($this->account, $this->start, $this->end));
566 }
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 600 of file lettering.class.php.

601 {
602 $sql="
603 with let_diff as (select jl_id,deb_amount-cred_amount as diff_letter1
604 from
605 ( 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
606 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)) ,
607 letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
608 select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
609 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
610 let_diff.jl_id as letter,
611 diff_letter1 as letter_diff,
612 round(j_montant/currency_rate,4) as currency_amount,
613 currency_id,
614 currency_rate,
615 currency_rate_ref,
616 (select cr_code_iso from currency where currency_id=currency.id) as cr_code_iso
617 from jrnx join jrn on (j_grpt = jr_grpt_id)
618 join letter_jl using (j_id)
619 left join let_diff using (jl_id)
620 where j_poste = $1 and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
621 and $this->sql_ledger
622 order by j_date,j_id";
623 $this->content=$this->db->get_array($sql, array($this->account, $this->start, $this->end));
624 }

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

630 {
631 $sql="
632 with let_diff as (select jl_id,deb_amount-cred_amount as diff_letter1
633 from
634 ( 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
635 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)) ,
636 letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
637 select distinct j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
638 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
639 let_diff.jl_id as letter,
640 diff_letter1 as letter_diff,
641 round(j_montant/currency_rate,4) as currency_amount,
642 currency_id,
643 currency_rate,
644 currency_rate_ref,
645 (select cr_code_iso from currency where currency_id=currency.id) as cr_code_iso
646 from
647 jrnx join jrn on (j_grpt = jr_grpt_id)
648 join letter_jl using (j_id)
649 join let_diff using (jl_id)
650 where j_poste = $1 and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
651 and $this->sql_ledger
652 and diff_letter1 <> 0
653 order by j_date,j_id";
654 $this->content=$this->db->get_array($sql, array($this->account, $this->start, $this->end));
655 }

References $sql, content, and db.

◆ get_unletter()

Lettering_Account::get_unletter ( )

same as get_all but only for unlettered operation

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

661 {
662 $sql="
663 with letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
664 select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
665 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
666 -1 as letter,
667 0 as letter_diff,
668 round(j_montant/currency_rate,4) as currency_amount,
669 currency_id,
670 currency_rate,
671 currency_rate_ref,
672 (select cr_code_iso from currency where currency_id=currency.id) as cr_code_iso
673 from jrnx join jrn on (j_grpt = jr_grpt_id)
674 where j_poste = $1 and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
675 and $this->sql_ledger
676 and j_id not in (select j_id from letter_jl)
677 order by j_date,j_id";
678 $this->content=$this->db->get_array($sql, array($this->account, $this->start, $this->end));
679 }

References $sql, content, and db.

Field Documentation

◆ $account

Lettering_Account::$account

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


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