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

create a standard invoice More...

+ Inheritance diagram for Noalyss\Invoice_PDF:
+ Collaboration diagram for Noalyss\Invoice_PDF:

Public Member Functions

 __construct (\Database $cn, private $dirname, private $filename)
 
 footer ()
 
 get_data ()
 
 get_dirname ()
 
 get_filename ()
 
 header ()
 
 set_data ($array)
 
 set_dirname ($dirname)
 
 set_filename ($filename)
 
- 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
 
 Header ()
 
 set_filter_operation ($filter_operation)
 
 setDossierInfo ($dossier="n/a")
 
- 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
 

Private Attributes

 $data
 $data (array) see Acc_Ledger_Purchases
 

Additional Inherited Members

- 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 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 PDF_Core
 $bigger
 
 $cells =array()
 

Detailed Description

create a standard invoice

Definition at line 34 of file invoice_pdf.class.php.

Constructor & Destructor Documentation

◆ __construct()

Noalyss\Invoice_PDF::__construct ( \Database $cn,
private $dirname,
private $filename )
Parameters
$dirnamefolder where to save file
$filenamefilename to use

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

44 {
45 parent::__construct($cn);
46 }

References PDF\$cn, and $dirname.

Member Function Documentation

◆ footer()

Noalyss\Invoice_PDF::footer ( )

Definition at line 81 of file invoice_pdf.class.php.

82 {
83 //Position at 1 cm from bottom
84 $this->SetY(-10);
85 //Arial italic 8
86 $this->SetFont('Arial', '', 8);
87 //Page number
88 parent::Cell(0, 8, " Page " . $this->PageNo() . '/{nb}', 0, 0, 'C');
89 parent::Ln(3);
90 }

◆ get_data()

Noalyss\Invoice_PDF::get_data ( )

Definition at line 76 of file invoice_pdf.class.php.

77 {
78 return $this->data;
79 }

References $data.

◆ get_dirname()

Noalyss\Invoice_PDF::get_dirname ( )

Definition at line 48 of file invoice_pdf.class.php.

49 {
50 return $this->dirname;
51 }
$dirname
Definition constant.php:42

References $dirname.

◆ get_filename()

Noalyss\Invoice_PDF::get_filename ( )

Definition at line 53 of file invoice_pdf.class.php.

54 {
55 return $this->filename;
56 }

◆ header()

Noalyss\Invoice_PDF::header ( )

Definition at line 92 of file invoice_pdf.class.php.

93 {
94 global $g_parameter;
95 $this->setY(15);
96 $this->SetFont('DejaVu', '', 6);
97 $colsize = 90;
98 $this->write_multi($colsize, 3, $g_parameter->MY_NAME);
99 $this->write_multi($colsize, 3, $this->data['e_date'], border: '', align: 'R');
100 $this->line_new();
101 $this->write_multi($colsize, 3,
102 sprintf("%s %s "
103 , $g_parameter->MY_STREET
104 , $g_parameter->MY_NUMBER));
105 $this->line_new();
106 $this->write_multi($colsize, 3, $g_parameter->MY_POSTCODE
107 . " " . $g_parameter->MY_CITY
108 . " " . $g_parameter->MY_COUNTRY
109 );
110 $this->line_new();
111 $this->write_multi($colsize, 3, $g_parameter->MY_TVA);
112 $this->line_new();
113
114 $email_company = $this->cn->get_value("select pe_value from parameter_extra where pe_code=$1",
115 ['INVOICE_EMAIL_COMPANY']);
116 $site = $this->cn->get_value("select pe_value from parameter_extra where pe_code=$1",
117 ['WEB_COMPANY']);
118 // for FRANCE , the SIREN and SIRET must be given
119 $siren = $this->cn->get_value("select pe_value from parameter_extra where pe_code=$1",
120 ['SIREN']);
121 $siret = $this->cn->get_value("select pe_value from parameter_extra where pe_code=$1",
122 ['SIRET']);
123 $iban = $this->cn->get_value("select pe_value from parameter_extra where pe_code=$1",
124 ['COMPANY_BANK_IBAN']);
125 $bic = $this->cn->get_value("select pe_value from parameter_extra where pe_code=$1",
126 ['COMPANY_BANK_BIC']);
127
128 if ($siret != "")
129 {
130 $this->write_multi($colsize, 3, "SIRET $siret");
131 $this->line_new();
132 }
133 if ($siren != "")
134 {
135 $this->write_multi($colsize, 3, "SIREN $siren");
136 $this->line_new();
137 }
138 if ($iban != "")
139 {
140 $this->write_multi($colsize, 3, "IBAN $iban BIC $bic");
141 $this->line_new();
142 }
143 if ($g_parameter->MY_PHONE != "")
144 {
145 $this->write_multi($colsize, 3, sprintf(_("Tel %s "),
146 $g_parameter->MY_PHONE
147 ));
148 $this->line_new();
149 }
150 if ($email_company != "")
151 {
152 $this->write_multi($colsize, 3, sprintf(_("email %s "),
153 $email_company));
154 $this->line_new();
155 }
156 if ($site != "")
157 {
158 $this->write_multi($colsize, 3, sprintf(_("site %s"),
159 $site
160 ));
161 $this->line_new();
162 }
163 $this->setFont("DejaVu", 'B', 14);
164 $this->write_multi(40, 10, "");
165 $this->write_multi(100, 10, _("Facture") . " " . $this->data['e_pj'], border: 1, align: 'C');
166 $this->write_multi(40, 10, "");
167 $this->line_new(10);
168 $this->ln(5);
169 }
global $g_parameter
$input_from cn
_("actif, passif,charge,...")

References $g_parameter, _, cn, PDF_Core\line_new(), and PDF_Core\write_multi().

+ Here is the call graph for this function:

◆ set_data()

Noalyss\Invoice_PDF::set_data ( $array)

Definition at line 70 of file invoice_pdf.class.php.

71 {
72 $this->data = $array;
73 return $this;
74 }

References $array.

◆ set_dirname()

Noalyss\Invoice_PDF::set_dirname ( $dirname)

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

59 {
60 $this->dirname = $dirname;
61 return $this;
62 }

References $dirname.

◆ set_filename()

Noalyss\Invoice_PDF::set_filename ( $filename)

Definition at line 64 of file invoice_pdf.class.php.

65 {
66 $this->filename = $filename;
67 return $this;
68 }

Field Documentation

◆ $data

Noalyss\Invoice_PDF::$data
private

$data (array) see Acc_Ledger_Purchases

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


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