noalyss Version-9
Public Member Functions
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 More...
 
 Footer ()
 write the Footer More...
 
 Header ()
 write the header of each page More...
 
 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 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 35 of file print_ledger_simple_without_vat.class.php.

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

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 144 of file print_ledger_simple_without_vat.class.php.

145 {
146
147 $ledger_history=Acc_Ledger_History::factory($this->cn,
148 array($this->get_ledger()->id),
149 $this->get_from(),
150 $this->get_to(),
151 'D',
152 $this->get_filter_operation());
153
154 $ledger_history->get_row();
155 $a_jrn=$ledger_history->get_data();
156
157 if ( empty($a_jrn ) ) return;
158
159 // Prepare the query for reconcile date
160 $prepared_query=new Prepared_Query($this->cn);
161 $prepared_query->prepare_reconcile_date();
162
163 $ledger=$this->get_ledger();
164
165 for ( $i=0;$i<count($a_jrn);$i++)
166 {
167
168 $row=$a_jrn[$i];
169 $this->LongLine(15,5,($row['jr_pj_number']),0);
170 $this->write_cell(15,5,$row['str_date_short'],0,0);
171 $this->write_cell(20,5,$row['jr_internal'],0,0);
172 list($qc,$name)=$this->get_tiers($row['jr_id'],$this->jrn_type);
173 $this->write_cell(20,5,$qc,0,0);
174 $this->LongLine(40,5,$name,0,'L');
175
176 $this->LongLine(105,5,$row['jr_comment'],0,'L');
177
178 /* get other amount (without vat, total vat included, private, ND */
179 $other=$ledger->get_other_amount($a_jrn[$i]['jr_grpt_id']);
180 $this->tp_htva+=$other['price'];
181 $this->tp_priv+=$other['priv'];
182 $this->rap_htva+=$other['price'];
183 $this->rap_priv+=$other['priv'];
184
185
186 if ( $ledger_history->get_ledger_type() !='VEN')
187 {
188 $this->write_cell(15,5,sprintf("%.2f",$other['priv']),0,0,'R');
189 }
190
191 $this->write_cell(15,5,sprintf("%.2f",$other['price']),0,0,'R');
192 $ret_reconcile=$this->cn->execute('reconcile_date',array($row['jr_id']));
194 $str_payment="";
195 if ($max > 0) {
196 $sep="";
197 for ($e=0;$e<$max;$e++) {
199 $msg=( $row['qcode_bank'] != "")?"[".$row['qcode_bank']."]":$row['jr_internal'];
200 $str_payment=$row['jr_date'].$msg.$sep;
201 $sep=' , ';
202 }
203 $this->write_cell (50,5,$str_payment);
204 }
205 $this->line_new(5);
206 }
207 }
$input_from cn
Definition: balance.inc.php:66
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)
LongLine($w, $h, $txt, $border=0, $align='', $fill=false)
write_cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')
get_tiers($p_jr_id, $p_jrn_type)
retrieve the client name and quick_code
Definition: pdf.class.php:84
contains prepared query used in different classes of the application
$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(), PDF_Core\LongLine(), DatabaseCore\num_row(), and PDF_Core\write_cell().

+ Here is the call graph for this function:

◆ Footer()

Print_Ledger_Simple_Without_Vat::Footer ( )

write the Footer

Reimplemented from PDF.

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

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

◆ Header()

Print_Ledger_Simple_Without_Vat::Header ( )

write the header of each page

Reimplemented from PDF.

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

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

◆ setDossierInfo()

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

Reimplemented from PDF.

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

57 {
58 $this->dossier = dossier::name()." ".$dossier;
59 }
$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: