noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
Print_Ledger_Simple_Without_Vat Class Reference

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

+ Inheritance diagram for Print_Ledger_Simple_Without_Vat:
+ Collaboration diagram for Print_Ledger_Simple_Without_Vat:

Public Member Functions

 __construct ($p_cn, $p_jrn, $p_from, $p_to, $p_filter_operation)
 
 export ()
 export the ledger in PDF
 
 Footer ()
 write the Footer
 
 Header ()
 write the header of each page
 
 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
 

Protected Attributes

 $tp_htva
 
 $tp_nd
 
 $tp_priv
 
 $tp_tvac
 
- 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()
 

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
 

Detailed Description

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

Definition at line 33 of file print_ledger_simple_without_vat.class.php.

Constructor & Destructor Documentation

◆ __construct()

Print_Ledger_Simple_Without_Vat::__construct ( $p_cn,
$p_jrn,
$p_from,
$p_to,
$p_filter_operation )

Definition at line 39 of file print_ledger_simple_without_vat.class.php.

40 {
41
42
43 parent::__construct($p_cn,'L', 'mm', 'A4',$p_jrn,$p_from,$p_to,$p_filter_operation);
44 $this->jrn_type=$p_jrn->get_type();
45 //----------------------------------------------------------------------
46 /* report
47 *
48 * get rappel to initialize amount rap_xx
49 *the easiest way is to compute sum from quant_
50 */
51 $this->previous=$this->get_ledger()->previous_amount($p_from);
52
53
54 $this->rap_htva=$this->previous['price'];
55 $this->rap_tvac=$this->previous['price'];
56 $this->rap_priv=$this->previous['priv'];
57
58 }

References $p_jrn, and Print_Ledger\get_ledger().

+ Here is the call graph for this function:

Member Function Documentation

◆ export()

Print_Ledger_Simple_Without_Vat::export ( )

export the ledger in PDF

Definition at line 148 of file print_ledger_simple_without_vat.class.php.

149 {
150
151 $ledger_history=Acc_Ledger_History::factory($this->cn,
152 array($this->get_ledger()->id),
153 $this->get_from(),
154 $this->get_to(),
155 'D',
156 $this->get_filter_operation());
157
158 $ledger_history->get_row();
159 $a_jrn=$ledger_history->get_data();
160
161 if ( empty($a_jrn ) ) return;
162
163 // Prepare the query for reconcile date
164 $prepared_query=new Prepared_Query($this->cn);
165 $prepared_query->prepare_reconcile_date();
166
167 $ledger=$this->get_ledger();
168
169 for ( $i=0;$i<count($a_jrn);$i++)
170 {
171
172 $row=$a_jrn[$i];
173 $this->write_multi(15,3,($row['jr_pj_number']),0);
174 $this->write_cell(15,5,$row['str_date_short'],0,0);
175 $this->write_cell(20,5,$row['jr_internal'],0,0);
176 list($qc,$name)=$this->get_tiers($row['jr_id'],$this->jrn_type);
177 $this->write_cell(20,5,$qc,0,0);
178 $this->write_multi(40,3,$name,0,'L');
179
180 $this->write_multi(105,3,$row['jr_comment'],0,'L');
181
182 /* get other amount (without vat, total vat included, private, ND */
183 $other=$ledger->get_other_amount($a_jrn[$i]['jr_grpt_id']);
184 $this->tp_htva+=$other['price'];
185 $this->tp_priv+=$other['priv'];
186 $this->rap_htva+=$other['price'];
187 $this->rap_priv+=$other['priv'];
188
189
190 if ( $ledger_history->get_ledger_type() !='VEN')
191 {
192 $this->write_cell(15,5,sprintf("%.2f",$other['priv']),0,0,'R');
193 }
194
195 $this->write_cell(15,5,sprintf("%.2f",$other['price']),0,0,'R');
196 $ret_reconcile=$this->cn->execute('reconcile_date',array($row['jr_id']));
198 $str_payment="";
199 if ($max > 0) {
200 $sep="";
201 for ($e=0;$e<$max;$e++) {
203 $msg=( $row['qcode_bank'] != "")?"[".$row['qcode_bank']."]":$row['jr_internal'];
204 $str_payment=$row['jr_date'].$msg.$sep;
205 $sep=' , ';
206 }
207 $this->write_cell (50,5,$str_payment);
208 }
209 $this->line_new(5);
210 }
211 }
$input_from cn
static factory(Database $cn, $pa_ledger, $p_from, $p_to, $p_mode, $p_paid)
Build the right object.
static fetch_array($ret, $p_indice=0, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_array
static num_row($ret)
wrapper for the function pg_num_rows
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
get_tiers($p_jr_id, $p_jrn_type)
retrieve the client name and quick_code
Definition pdf.class.php:84
$ledger
concerned Ledger

References $e, $i, Print_Ledger\$ledger, $max, $msg, $name, $other, $ret_reconcile, $row, $sep, cn, Acc_Ledger_History\factory(), DatabaseCore\fetch_array(), Print_Ledger\get_filter_operation(), Print_Ledger\get_from(), Print_Ledger\get_ledger(), PDF\get_tiers(), Print_Ledger\get_to(), PDF_Core\line_new(), DatabaseCore\num_row(), PDF_Core\write_cell(), and PDF_Core\write_multi().

+ Here is the call graph for this function:

◆ Footer()

Print_Ledger_Simple_Without_Vat::Footer ( )

write the Footer

Reimplemented from PDF.

Definition at line 115 of file print_ledger_simple_without_vat.class.php.

116 {
117 //Position at 3 cm from bottom
118 $this->SetY(-20);
119 /* write reporting */
120 $this->Cell(215,6,'Total page ','T',0,'R'); /* HTVA */
121 if ( $this->jrn_type !='VEN')
122 {
123 $this->Cell(15,6,sprintf('%.2f',$this->tp_priv),'T',0,'R'); /* prive */
124 }
125 $this->Cell(15,6,sprintf('%.2f',$this->tp_htva),'T',0,'R'); /* HTVA */
126 $this->Cell(0,6,'','T',0,'R'); /* line */
127 $this->Ln(2);
128
129 $this->Cell(215,6,'report',0,0,'R'); /* HTVA */
130 if ( $this->jrn_type !='VEN')
131 {
132 $this->Cell(15,6,sprintf('%.2f',$this->rap_priv),0,0,'R'); /* prive */
133 }
134 $this->Cell(15,6,sprintf('%.2f',$this->rap_htva),0,0,'R'); /* HTVA */
135 $this->Ln(2);
136
137 //Arial italic 8
138 $this->SetFont('Arial', 'I', 8);
139 //Page number
140 $this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'L');
141 // Created by NOALYSS
142 $this->Cell(0,8,'Created by NOALYSS, online on https://www.noalyss.eu',0,0,'R',false,'https://www.noalyss.eu');
143 }

◆ Header()

Print_Ledger_Simple_Without_Vat::Header ( )

write the header of each page

Reimplemented from PDF.

Definition at line 67 of file print_ledger_simple_without_vat.class.php.

68 {
69 //Arial bold 12
70 $this->SetFont('DejaVu', 'B', 12);
71 //Title
72 $this->Cell(0,10,$this->dossier, 'B', 0, 'C');
73 //Line break
74 $this->Ln(20);
75 $this->SetFont('DejaVu', 'B', 8);
76 /* column header */
77 $this->Cell(15,6,'Pièce');
78 $this->Cell(15,6,'Date');
79 $this->Cell(20,6,'ref');
80 if ( $this->jrn_type=='ACH')
81 $this->Cell(60,6,'Client');
82 else
83 $this->Cell(60,6,'Fournisseur');
84 $this->Cell(105,6,'Commentaire');
85 if ( $this->jrn_type=='ACH')
86 {
87 $this->Cell(15,6,'Privé',0,0,'R');
88 }
89 $this->Cell(15,6,'Prix',0,0,'R');
90
91 $this->Ln(5);
92
93 $this->SetFont('DejaVu','',6);
94 // page Header
95 $this->Cell(215,6,'report',0,0,'R'); /* HTVA */
96 if ( $this->jrn_type != 'VEN')
97 {
98 $this->Cell(15,6,sprintf('%.2f',$this->rap_priv),0,0,'R'); /* prive */
99 }
100 $this->Cell(15,6,sprintf('%.2f',$this->rap_htva),0,0,'R'); /* HTVA */
101
102
103
104
105 $this->Ln(6);
106 //total page
107 $this->tp_htva=0.0;
108 $this->tp_tvac=0.0;
109 $this->tp_priv=0;
110 $this->tp_nd=0;
111 }

◆ setDossierInfo()

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

Reimplemented from PDF.

Definition at line 60 of file print_ledger_simple_without_vat.class.php.

61 {
62 $this->dossier = dossier::name()." ".$dossier;
63 }
$dossier
Definition pdf.class.php:38

References PDF\$dossier.

Field Documentation

◆ $tp_htva

Print_Ledger_Simple_Without_Vat::$tp_htva
protected

Definition at line 36 of file print_ledger_simple_without_vat.class.php.

◆ $tp_nd

Print_Ledger_Simple_Without_Vat::$tp_nd
protected

Definition at line 38 of file print_ledger_simple_without_vat.class.php.

◆ $tp_priv

Print_Ledger_Simple_Without_Vat::$tp_priv
protected

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

◆ $tp_tvac

Print_Ledger_Simple_Without_Vat::$tp_tvac
protected

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


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