noalyss Version-9
Public Member Functions
Print_Ledger_Detail Class Reference

this class extends PDF and let you export the detailled printing of any ledgers More...

+ Inheritance diagram for Print_Ledger_Detail:
+ Collaboration diagram for Print_Ledger_Detail:

Public Member Functions

 __construct (Database $p_cn, Acc_Ledger $ledger, $p_from, $p_to)
 
 export ()
 
 Footer ()
 
 Header ()
 
 setDossierInfo ($dossier="n/a")
 
- Public Member Functions inherited from Print_Ledger
 __construct (\Database $p_cn, $orientation, $unit, $format, Acc_Ledger $p_ledger, $p_from, $p_to, $p_filter_operation)
 integer parm_periode.p_id , end periode; More...
 
 get_filter_operation ()
 
 get_from ()
 
 get_ledger ()
 
 get_to ()
 
 set_filter_operation ($filter_operation)
 Filter the operations ,. More...
 
 set_from ($from)
 
 set_ledger ($ledger)
 
 set_to ($to)
 
- Public Member Functions inherited from PDF
 __construct (Database $p_cn, $orientation='P', $unit='mm', $format='A4')
 
 Footer ()
 
 get_tiers ($p_jr_id, $p_jrn_type)
 retrieve the client name and quick_code More...
 
 Header ()
 
 set_filter_operation ($filter_operation)
 
 setDossierInfo ($dossier="n/a")
 
- Public Member Functions inherited from PDF_Core
 __construct ( $orientation='P', $unit='mm', $format='A4')
 
 get_margin_bottom ()
 
 get_margin_left ()
 
 get_margin_right ()
 
 get_margin_top ()
 
 get_orientation ()
 
 get_page_size ()
 
 get_unit ()
 
 is_fill ($p_step)
 If the step is even then return 1 and set the backgroup color to blue , otherwise returns 0, and set the background color to white It is use to compute alternated colored row , it the parameter fill in write_cell and cell. More...
 
 line_new ($p_step=null)
 Print all the cell stored and call Ln (new line) More...
 
 LongLine ($w, $h, $txt, $border=0, $align='', $fill=false)
 
 write_cell ($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')
 

Additional Inherited Members

- Static Public Member Functions inherited from Print_Ledger
static available_ledger ($get_from_periode)
 find all the active ledger for the exerice of the periode and readable by the current user @global type $g_user More...
 
static factory (Database $cn, $p_type_export, Acc_Ledger $p_ledger, $p_from, $p_to, $p_filter_operation)
 Create an object Print_Ledger* depending on $p_type_export ( 0 => accounting 1-> one row per operation 2-> detail of item) More...
 
- Data Fields inherited from PDF
 $cn = null
 
 $date = ""
 
 $dossier = "n/a"
 
 $own = null
 
 $soc = ""
 
- Protected Member Functions inherited from Print_Ledger
 build_filter_operation ()
 Build a SQL clause to filter operation depending if they are paid, unpaid or no filter. More...
 
- Protected Member Functions inherited from PDF_Core
 print_row ()
 print the current array of cell and reset it , if different colors are set on the same row you have to print it before changing More...
 
- Protected Attributes inherited from Print_Ledger
 $filter_operation
 

Detailed Description

this class extends PDF and let you export the detailled printing of any ledgers

Definition at line 35 of file print_ledger_detail.class.php.

Constructor & Destructor Documentation

◆ __construct()

Print_Ledger_Detail::__construct ( Database  $p_cn,
Acc_Ledger  $ledger,
  $p_from,
  $p_to 
)

Definition at line 37 of file print_ledger_detail.class.php.

38 {
39
40 parent::__construct($p_cn,'L', 'mm', 'A4',$ledger,$p_from,$p_to,'all');
41
42 }
$ledger
concerned Ledger

References Print_Ledger\$ledger.

Member Function Documentation

◆ export()

Print_Ledger_Detail::export ( )

Definition at line 72 of file print_ledger_detail.class.php.

73 {
74
75 // detailled printing
76 $rap_deb=0;
77 $rap_cred=0;
78 // take all operations from jrn
79 $array=$this->get_ledger()->get_operation($this->get_from(),$this->get_to());
80
81 $this->SetFont('DejaVu','BI',7);
82 $this->write_cell(215,7,'report Débit',0,0,'R');
83 $this->write_cell(30,7,nbm($rap_deb),0,0,'R');
84 $this->line_new(4);
85 $this->write_cell(215,7,'report Crédit',0,0,'R');
86 $this->write_cell(30,7,nbm($rap_cred),0,0,'R');
87 $this->line_new(4);
88
89 // print all operation
90 for ($i=0;$i< count($array);$i++)
91 {
92 $this->SetFont('DejaVuCond','B',7);
93 $row=$array[$i];
94
95 $this->LongLine(20,7,$row['pj']);
96 $this->write_cell(15,7,$row['date_fmt']);
97 $this->write_cell(20,7,$row['internal']);
98 $this->LongLine(170,7,$row['comment']);
99 $this->write_cell(20,7,nbm($row['montant']),0,0,'R');
100
101 $this->line_new();
102 // get the entries
103 $aEntry=$this->cn->get_array("select j_id,j_poste,j_qcode,j_montant,j_debit, j_text,".
104 " case when j_text='' or j_text is null then pcm_lib else j_text end as desc,".
105 " pcm_lib ".
106 " from jrnx join tmp_pcmn on (j_poste=pcm_val) where j_grpt = $1".
107 " order by j_debit desc,j_id",
108 array($row['jr_grpt_id']));
109 for ($j=0;$j<count($aEntry);$j++)
110 {
111 $this->SetFont('DejaVuCond','',7);
112 $entry=$aEntry[$j];
113 // $this->write_cell(15,6,$entry['j_id'],0,0,'R');
114 $this->write_cell(32,6,$entry['j_qcode'],0,0,'R');
115 $this->write_cell(23,6,$entry['j_poste'],0,0,'R');
116
117 // if j_qcode is not empty retrieve name
118 if ( $entry['j_text'] =='' && $entry['j_qcode'] != '')
119 {
120 $f_id=$this->cn->get_value('select f_id from vw_poste_qcode where j_qcode=$1',array($entry['j_qcode']));
121 if ($f_id != '')
122 $name=$this->cn->get_value('select ad_value from fiche_detail where f_id=$1 and ad_id=1',
123 array($f_id));
124 else
125 $name=$entry['pcm_lib'];
126 }
127 else
128 $name=$entry['desc'];
129 $this->write_cell(150,6,$name,0,0,'L');
130
131 // print amount
132 $str_amount=nbm($entry['j_montant']);
133 if ( $entry['j_debit']=='t')
134 {
135 $this->write_cell(20,6,$str_amount,0,0,'R');
136 $this->write_cell(20,6,'',0,0,'R');
137 }
138 else
139 {
140 $this->write_cell(20,6,'',0,0,'R');
141 $this->write_cell(20,6,$str_amount,0,0,'R');
142 }
143 $this->line_new(4);
144 }
145 }
146 }
nbm($p_number, $p_dec=2)
format the number with a sep.
Definition: ac_common.php:137
$input_from cn
Definition: balance.inc.php:66
line_new($p_step=null)
Print all the cell stored and call Ln (new line)
LongLine($w, $h, $txt, $border=0, $align='', $fill=false)
write_cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')

References $array, $f_id, $i, $name, $row, cn, Print_Ledger\get_from(), Print_Ledger\get_ledger(), Print_Ledger\get_to(), PDF_Core\line_new(), PDF_Core\LongLine(), nbm(), and PDF_Core\write_cell().

+ Here is the call graph for this function:

◆ Footer()

Print_Ledger_Detail::Footer ( )

Reimplemented from PDF.

Definition at line 58 of file print_ledger_detail.class.php.

59 {
60 //Position at 2 cm from bottom
61 $this->SetY(-20);
62 //Arial italic 8
63 $this->SetFont('Arial', 'I', 8);
64 //Page number
65 $this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'L');
66 // Created by NOALYSS
67 $this->Cell(0,8,'Created by NOALYSS, online on https://www.noalyss.eu',0,0,'R',false,'https://www.noalyss.eu');
68
69 }

◆ Header()

Print_Ledger_Detail::Header ( )

Reimplemented from PDF.

Definition at line 49 of file print_ledger_detail.class.php.

50 {
51 //Arial bold 12
52 $this->SetFont('DejaVu', 'B', 12);
53 //Title
54 $this->Cell(0,10,$this->dossier, 'B', 0, 'C');
55 //Line break
56 $this->Ln(20);
57 }

◆ setDossierInfo()

Print_Ledger_Detail::setDossierInfo (   $dossier = "n/a")

Reimplemented from PDF.

Definition at line 44 of file print_ledger_detail.class.php.

45 {
46 $this->dossier = dossier::name()." ".$dossier;
47 }
$from_poste name
$dossier
Definition: pdf.class.php:38

References PDF\$dossier, and name.


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