noalyss Version-9
Public Member Functions
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) More...
 
 get_filter ($p_jid=0)
 fills the this->content, datas are filtered thanks More...
 
 get_letter ()
 same as get_all but only for lettered operation More...
 
 get_letter_diff ()
 same as get_all but only for lettered operation More...
 
 get_unletter ()
 same as get_all but only for unlettered operation More...
 
- Public Member Functions inherited from Lettering
 __construct ( $p_init)
 constructor More...
 
 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. More...
 
 load ()
 
 remove_incoherent ()
 for some reason , sometimes, a record in letter_X doesn't have his counterpart in letter_Y More...
 
 save ($p_array)
 save from array, letter the accounting (or card) and create a link between operation More...
 
 seek ($cond, $p_array=null)
 retrieve * row thanks a condition More...
 
 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 More...
 
 update ()
 
 verify ()
 

Additional Inherited Members

- Data Fields inherited from Lettering
 $db
 
 $end
 
 $sql_ledger
 
 $start
 
- 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 More...
 
 show_lettered ()
 show only the lettered records from jrnx it fills the array $this->content More...
 
 show_lettered_diff ()
 show only the lettered records from jrnx it fills the array $this->content More...
 
 show_not_lettered ()
 show only the not lettered records from jrnx it fills the array $this->content More...
 
- Protected Attributes inherited from Lettering
 $variable
 

Detailed Description

only for operation retrieved thanks a account (jrnx.j_poste) manage the accounting entries for a given account

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

Constructor & Destructor Documentation

◆ __construct()

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

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

485 {
486 parent::__construct($p_init);
487 $this->account=$p_account;
488 $this->object_type='account';
489 }

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

550 {
551 $sql=" with let_diff as (select jl_id,deb_amount-cred_amount as diff_letter1
552 from
553 ( 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
554 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)) ,
555 letter_jl as (select jl_id,j_id from letter_cred union all select jl_id,j_id from letter_deb)
556 select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
557 j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
558 coalesce(let_diff.jl_id,-1) as letter,
559 diff_letter1 as letter_diff,
560 round(j_montant/currency_rate,4) as currency_amount,
561 currency_id,
562 currency_rate,
563 currency_rate_ref,
564 (select cr_code_iso from currency where currency_id=currency.id) as cr_code_iso
565 from jrnx join jrn on (j_grpt = jr_grpt_id)
566 left join letter_jl using (j_id)
567 left join let_diff using (jl_id)
568 where j_poste = $1 and j_date >= to_date($2,'DD.MM.YYYY') and j_date <= to_date ($3,'DD.MM.YYYY')
569 and $this->sql_ledger
570
571 order by j_date,j_id";
572 $this->content=$this->db->get_array($sql, array($this->account, $this->start, $this->end));
573 }
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 500 of file lettering.class.php.

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

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

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

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

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

References $sql, content, and db.

◆ get_unletter()

Lettering_Account::get_unletter ( )

same as get_all but only for unlettered operation

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

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

References $sql, content, and db.


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