noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
print_ledger_misc.class.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with NOALYSS; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19
20// Copyright Author Dany De Bontridder danydb@aevalys.eu
21
22/*!
23 * \file
24 * \brief print a listing of Miscelleaneous operation
25 */
26/**
27 * \class Print_Ledger_Misc
28 * \brief print a listing of Miscelleaneous operation
29 */
31{
32 function __construct(Database $p_cn,$p_jrn,$p_from,$p_to)
33 {
34 parent::__construct($p_cn,'P','mm','A4',$p_jrn,$p_from,$p_to,"all");
35 }
36 function Header()
37 {
38 //Arial bold 12
39 $this->SetFont('DejaVu', 'B', 12);
40 //Title
41 $this->Cell(0,10,$this->dossier, 'B', 0, 'C');
42 //Line break
43 $this->Ln(20);
44 $this->SetFont('DejaVu', 'B', 7);
45 $this->Cell(10,6,_('Date'));
46 $this->Cell(30,6,_('Piece'));
47 $this->Cell(20,6,_('Interne'));
48 $this->Cell(25,6,_('Tiers'));
49 $this->Cell(60,6,_('Commentaire'));
50 $this->Cell(20,6,_('Devise'),0,0,'R');
51 $this->Cell(15,6,_('Montant'),0,0,'R');
52 $this->Ln(6);
53
54 }
55 function Footer()
56 {
57 //Position at 2 cm from bottom
58 $this->SetY(-20);
59 //Arial italic 8
60 $this->SetFont('Arial', 'I', 8);
61 //Page number
62 $this->Cell(0,6,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'C');
63 $this->Ln(3);
64 // Created by NOALYSS
65 $this->Cell(0,6,'Created by NOALYSS, online on https://www.noalyss.eu',0,0,'C',false,'https://www.noalyss.eu');
66 }
67 /**
68 *@brief print the pdf
69 *@param
70 *@param
71 *@return
72 *@see
73 */
74 function export()
75 {
76 $a_jrn=$this->get_ledger()->get_rowSimple($this->get_from(),$this->get_to());
77
78 $this->SetFont('DejaVu', '', 6);
79 if ( $a_jrn == null ) return;
80 $ledger=$this->get_ledger();
81 $border='0';
82 for ( $i=0;$i<count($a_jrn);$i++)
83 {
84 $row=$a_jrn[$i];
85
86 $this->write_cell(10,3, smaller_date($row['date']),border:$border);
87 $this->write_multi(30,3,$row['jr_pj_number'],border:$border);
88 $this->write_cell(20,3,$row['jr_internal'],border:$border);
89 $type=$this->cn->get_value("select jrn_def_type from jrn_def where jrn_def_id=$1",array($a_jrn[$i]['jr_def_id']));
90 $other=mb_substr($ledger->get_tiers($type,$a_jrn[$i]['jr_id']),0,25);
91 $this->write_multi(25,3,$other,$border,'L');
92 $positive=$row['montant'];
93 $this->write_multi(60,3,$row['str_comment'],$border,'L');
94 if ( $type == 'FIN' ) {
95 $positive = $this->cn->get_value("select qf_amount from quant_fin ".
96 " where jr_id=".$row['jr_id']);
97 }
98 if ( $row['currency_id'] != 0 ) {
99 $this->write_cell(20,3,nbm(bcadd($row['sum_ocvat_amount'],$row['sum_ocamount']),2).$row['cr_code_iso'],border:$border);
100 } else {
101 $this->write_cell(20,3,"",border:$border);
102 }
103 $this->write_cell(15,3,nbm($positive),$border,0,'R');
104 $this->line_new(5);
105
106 }
107 }
108}
smaller_date($p_date)
shrink the date, make a date shorter for the printing
nbm($p_number, $p_dec=2)
format the number with a sep.
$input_from cn
_("actif, passif,charge,...")
contains the class for connecting to Noalyss
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
print a listing of Miscelleaneous operation
__construct(Database $p_cn, $p_jrn, $p_from, $p_to)
Parent class for the print_ledger class.
$ledger
concerned Ledger