noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
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)
 
 get_filter_operation ()
 
 get_from ()
 
 get_ledger ()
 
 get_to ()
 
 set_filter_operation ($filter_operation)
 Filter the operations ,.
 
 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')
 
 get_tiers ($p_jr_id, $p_jrn_type)
 retrieve the client name and quick_code
 
- Public Member Functions inherited from PDF_Core
 __construct ( $orientation='P', $unit='mm', $format='A4')
 
 fill_row ($enable)
 set color for row ,
 
 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.
 
 line_new ($p_step=null)
 Print all the cell stored and call Ln (new line)
 
 LongLine ($w, $h, $txt, $border=0, $align='', $fill=false)
 add a cell with automatic return to the line if the text is too long, deprecated , it calls only PDFCore::write_cell_
 
 write_cell ($width, $height=0, $txt='', $border=0, $interline=0, $align='', $fill=false, $link='')
 add a cell the text is not cut and don't return to this line if too large
 
 write_multi ($width, $interline, $txt, $border=0, $align='', $fill=false)
 add a cell with automatic return to the line if the text is too long
 

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
 
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)
 
- Static Public Member Functions inherited from PDF
static test_me ()
 test the class
 
- 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.
 
- Protected Member Functions inherited from PDF_Core
 add_cell (Cellule $Ce)
 
 check_page_add ()
 Check if a page must be added due a MultiCell.
 
 count_nb_row ($p_text, $p_colSize)
 Count the number of rows a p_text will take for a multicell.
 
 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
 
- Protected Attributes inherited from Print_Ledger
 $a_Tva
 $other_tax_previous (array)
 
 $filter_operation
 See Acc_Ledger_History::filter_operation.
 
 $flag_other_tax
 $flag_other_tax(bool) true if other tax exists
 
 $from
 
 $jrn_type
 
 $ledger
 concerned Ledger
 
 $other_tax_previous
 
 $previous
 internal variables for computing sum on PDF Listing
 
 $rap_htva
 $previous (array) see Acc_Ledger->previous_amount
 
 $rap_nd
 $rap_nd (float) $no-deductible tax
 
 $rap_other
 VAT when page starts.
 
 $rap_other_tax
 $rap_other_tav, amount to report for other tax than VAT
 
 $rap_priv
 $rap_priv (float) personal expense
 
 $rap_tva
 $rap_tva array(tva_id,amount)
 
 $rap_tva_np
 $rap_tva_np VAT not deductible
 
 $rap_tvac
 $rap_tvac (float) previous amount
 
 $show_col
 
 $to
 
 $tp_htva
 $tp_htva (float) total page price w/o VAT
 
 $tp_nd
 $tp_nd (float) total page price w/o VAT
 
 $tp_priv
 $tp_priv (float) total page personal expense
 
 $tp_tva
 $tp_tva (float) total page VAT
 
 $tp_tva_np
 $tp_tva_np (float) total page not deductible
 
 $tp_tvac
 $tp_tvac (float) total page full price All Tax Incl.
 
- Protected Attributes inherited from PDF_Core
 $bigger
 
 $cells =array()
 

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,'P', '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(155,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(155,7,'report Crédit',0,0,'R');
86 $this->write_cell(30,7,nbm($rap_cred),0,0,'R');
87 $this->line_new(10);
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->write_multi(20, 4,$row['pj'],'T');
96 $this->write_cell(15,4,$row['date_fmt'],'T');
97 $this->write_cell(20,4,$row['internal'],'T');
98 $this->write_multi(100,4,$row['comment'],'T');
99 $this->write_cell(40,4,nbm($row['montant']),'T',0,'R');
100
101
102 $this->line_new(7);
103 // get the entries
104 $aEntry=$this->cn->get_array("select j_id,j_poste,j_qcode,j_montant,j_debit, j_text,".
105 " case when j_text='' or j_text is null then pcm_lib else j_text end as desc,".
106 " pcm_lib ".
107 " from jrnx join tmp_pcmn on (j_poste=pcm_val) where j_grpt = $1".
108 " order by j_debit desc,j_id",
109 array($row['jr_grpt_id']));
110 for ($j=0;$j<count($aEntry);$j++)
111 {
112 $this->SetFont('DejaVuCond','',7);
113 $entry=$aEntry[$j];
114 // $this->write_cell(15,6,$entry['j_id'],0,0,'R');
115 $this->write_cell(32,6,$entry['j_qcode'],0,0,'R');
116 $this->write_cell(23,6,$entry['j_poste'],0,0,'R');
117
118 // if j_qcode is not empty retrieve name
119 if ( $entry['j_text'] =='' && $entry['j_qcode'] != '')
120 {
121 $f_id=$this->cn->get_value('select f_id from vw_poste_qcode where j_qcode=$1',array($entry['j_qcode']));
122 if ($f_id != '')
123 $name=$this->cn->get_value('select ad_value from fiche_detail where f_id=$1 and ad_id=1',
124 array($f_id));
125 else
126 $name=$entry['pcm_lib'];
127 }
128 else
129 $name=$entry['desc'];
130 $this->write_cell(100,6,$name,0,0,'L');
131
132 // print amount
133 $str_amount=nbm($entry['j_montant']);
134 if ( $entry['j_debit']=='t')
135 {
136 $this->write_cell(20,6,$str_amount,0,0,'R');
137 $this->write_cell(20,6,'',0,0,'R');
138
139 }
140 else
141 {
142 $this->write_cell(20,6,'',0,0,'R');
143 $this->write_cell(20,6,$str_amount,0,0,'R');
144 }
145 $this->line_new(4);
146 }
147 $this->line_new(3);
148 }
149 }
nbm($p_number, $p_dec=2)
format the number with a sep.
$input_from cn
line_new($p_step=null)
Print all the cell stored and call Ln (new line)
write_cell($width, $height=0, $txt='', $border=0, $interline=0, $align='', $fill=false, $link='')
add a cell the text is not cut and don't return to this line if too large
write_multi($width, $interline, $txt, $border=0, $align='', $fill=false)
add a cell with automatic return to the line if the text is too long

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

+ 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 }
$dossier
Definition pdf.class.php:38

References PDF\$dossier.


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