dolibarr 25.0.0-alpha
pdf_standard_inventory.modules.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2026 Jose MARTINEZ <jose.martinez@pichinov.com>
3 * Copyright (C) 2026 MDW <mdeweerd@users.noreply.github.com>
4 *
5 * This program 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 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
25require_once DOL_DOCUMENT_ROOT.'/core/modules/inventory/modules_inventory.php';
26require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
27require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
28require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
29require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
30
31
39{
43 public $db;
44
48 public $name;
49
53 public $description;
54
58 public $update_main_doc_field;
59
63 public $type;
64
69 public $version = 'dolibarr';
70
74 public $emetteur;
75
79 public $posxproduct;
83 public $posxlabel;
87 public $posxwarehouse;
91 public $posxbatch;
95 public $posxqtystock;
99 public $posxqtyview;
103 public $posxgap;
107 public $posxend;
108
109
115 public function __construct($db)
116 {
117 global $langs, $mysoc;
118
119 // Translations
120 $langs->loadLangs(array("main", "stocks", "products"));
121
122 $this->db = $db;
123 $this->name = "standard_inventory";
124 $this->description = $langs->trans("InventorySheetPdfModelDesc");
125 $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template
126
127 // Dimension page
128 $this->type = 'pdf';
129 $formatarray = pdf_getFormat();
130 $this->page_largeur = $formatarray['width'];
131 $this->page_hauteur = $formatarray['height'];
132 $this->format = array($this->page_largeur, $this->page_hauteur);
133 $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
134 $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
135 $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
136 $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
137
138 $this->option_logo = 1; // Display logo
139 $this->option_multilang = 1; // Available in several languages
140 $this->option_freetext = 1; // Support add of a personalised text
141
142 // Get source company
143 $this->emetteur = $mysoc;
144 if (empty($this->emetteur->country_code)) {
145 $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
146 }
147 }
148
149
150 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
162 public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
163 {
164 // phpcs:enable
165 global $user, $langs, $conf, $mysoc, $hookmanager;
166
167 if (!is_object($outputlangs)) {
168 $outputlangs = $langs;
169 }
170 // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
171 if (getDolGlobalString('MAIN_USE_FPDF')) {
172 $outputlangs->charset_output = 'ISO-8859-1';
173 }
174
175 // Load translation files required by the page
176 $outputlangs->loadLangs(array("main", "dict", "companies", "stocks", "products"));
177
178 $isspecimen = empty($object->id);
179
180 if (empty($conf->stock->multidir_output[$isspecimen ? $conf->entity : ($object->entity ? $object->entity : $conf->entity)])) {
181 $this->error = 'Error: no output dir defined for module stock';
182 return 0;
183 }
184 $basedir = $conf->stock->multidir_output[$isspecimen ? $conf->entity : ($object->entity ? $object->entity : $conf->entity)].'/inventory';
185
186 if ($isspecimen) {
187 $dir = $basedir;
188 $file = $dir.'/SPECIMEN.pdf';
189 } else {
190 $objectref = dol_sanitizeFileName((string) $object->ref);
191 $dir = $basedir.'/'.$objectref;
192 $file = $dir.'/'.$objectref.'.pdf';
193 }
194
195 if (!file_exists($dir)) {
196 if (dol_mkdir($dir) < 0) {
197 $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);
198 return 0;
199 }
200 }
201
202 // Load the lines of the inventory
203 $lines = array();
204 if ($isspecimen) {
205 for ($i = 1; $i <= 5; $i++) {
206 $line = new stdClass();
207 $line->product_ref = 'PROD'.sprintf('%04d', $i);
208 $line->product_label = 'Product '.$i;
209 $line->warehouse_ref = 'WH-A';
210 $line->batch = '';
211 $line->qty_stock = 10 * $i;
212 $line->qty_view = 10 * $i - ($i % 2);
213 $line->pmp = 2.5 * $i;
214 $lines[] = $line;
215 }
216 $recorded = false;
217 } else {
218 $recorded = ((int) $object->status >= Inventory::STATUS_RECORDED);
219 $sql = "SELECT id.rowid, id.qty_stock, id.qty_view, id.qty_regulated, id.batch, id.pmp_real, id.pmp_expected,";
220 $sql .= " p.ref as product_ref, p.label as product_label, e.ref as warehouse_ref";
221 $sql .= " FROM ".MAIN_DB_PREFIX."inventorydet as id";
222 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = id.fk_product";
223 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e ON e.rowid = id.fk_warehouse";
224 $sql .= " WHERE id.fk_inventory = ".((int) $object->id);
225 $sql .= " ORDER BY e.ref, p.ref";
226 $resql = $this->db->query($sql);
227 if (!$resql) {
228 $this->error = $this->db->lasterror();
229 return 0;
230 }
231 while ($obj = $this->db->fetch_object($resql)) {
232 $line = new stdClass();
233 $line->product_ref = (string) $obj->product_ref;
234 $line->product_label = (string) $obj->product_label;
235 $line->warehouse_ref = (string) $obj->warehouse_ref;
236 $line->batch = (string) $obj->batch;
237 $line->qty_stock = $obj->qty_stock;
238 $line->qty_view = $recorded ? ($obj->qty_view !== null ? $obj->qty_view : ($obj->qty_stock + $obj->qty_regulated)) : $obj->qty_view;
239 $line->pmp = ($obj->pmp_real !== null && (float) $obj->pmp_real != 0) ? $obj->pmp_real : $obj->pmp_expected;
240 $lines[] = $line;
241 }
242 }
243
244 // Create pdf instance
245 $pdf = pdf_getInstance($this->format);
246 $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
247 $pdf->SetAutoPageBreak(true, 0);
248
249 $heightforinfotot = 30; // Height reserved to output the totals table
250 $heightforsignature = ($isspecimen || !$recorded) ? 25 : 0; // Height reserved for the signature block on count sheets
251 $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5);
252 $heightforfooter = $this->marge_basse + 8;
253
254 if (class_exists('TCPDF')) {
255 $pdf->setPrintHeader(false);
256 $pdf->setPrintFooter(false);
257 }
258 $pdf->SetFont(pdf_getPDFFont($outputlangs));
259
260 $pdf->Open();
261 $pagenb = 0;
262 $pdf->SetDrawColor(128, 128, 128);
263
264 $pdf->SetTitle($outputlangs->convToOutputCharset($isspecimen ? 'SPECIMEN' : $object->ref));
265 $pdf->SetSubject($outputlangs->transnoentities("Inventory"));
266 $pdf->SetCreator("Dolibarr ".DOL_VERSION);
267 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
268 $pdf->SetKeyWords($outputlangs->convToOutputCharset($isspecimen ? 'SPECIMEN' : $object->ref)." ".$outputlangs->transnoentities("Inventory"));
269 if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) {
270 $pdf->SetCompression(false);
271 }
272
273 // @phan-suppress-next-line PhanPluginSuspiciousParamOrder
274 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
275
276 // Columns (from left)
277 $this->posxproduct = $this->marge_gauche;
278 $this->posxlabel = $this->marge_gauche + 30;
279 $this->posxwarehouse = $this->page_largeur - $this->marge_droite - 92;
280 $this->posxbatch = $this->page_largeur - $this->marge_droite - 70;
281 $this->posxqtystock = $this->page_largeur - $this->marge_droite - 50;
282 $this->posxqtyview = $this->page_largeur - $this->marge_droite - 34;
283 $this->posxgap = $this->page_largeur - $this->marge_droite - 18;
284 $this->posxend = $this->page_largeur - $this->marge_droite;
285
286 // New page
287 $pdf->AddPage();
288 $pagenb++;
289 $top_shift = $this->pageHead($pdf, $object, 1, $outputlangs, $recorded, $isspecimen);
290 $pdf->SetFont('', '', $default_font_size - 1);
291 $pdf->MultiCell(0, 3, ''); // Set interline to 3
292 $pdf->SetTextColor(0, 0, 0);
293
294 $tab_top = 42 + $top_shift;
295 $tab_top_newpage = 10;
296
297 // Table header
298 $this->tableHeader($pdf, $tab_top, $outputlangs, $recorded);
299 $nexY = $tab_top + 7;
300
301 $nblines = count($lines);
302 $totalgap = 0;
303 $totalgapvalue = 0;
304 $nbgap = 0;
305
306 for ($i = 0; $i < $nblines; $i++) {
307 $line = $lines[$i];
308 $curY = $nexY;
309 $pdf->SetFont('', '', $default_font_size - 2);
310
311 // Page break management
312 if ($curY > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot + $heightforsignature))) {
313 $this->pageFoot($pdf, $object, $outputlangs, 1);
314 $pdf->AddPage();
315 $pagenb++;
316 $this->tableHeader($pdf, $tab_top_newpage, $outputlangs, $recorded);
317 $curY = $tab_top_newpage + 7;
318 $pdf->SetFont('', '', $default_font_size - 2);
319 $pdf->SetTextColor(0, 0, 0);
320 }
321
322 // Product ref
323 $pdf->SetXY($this->posxproduct, $curY);
324 $pdf->MultiCell($this->posxlabel - $this->posxproduct - 1, 3, $outputlangs->convToOutputCharset($line->product_ref), 0, 'L');
325 // Label
326 $pdf->SetXY($this->posxlabel, $curY);
327 $pdf->MultiCell($this->posxwarehouse - $this->posxlabel - 1, 3, $outputlangs->convToOutputCharset(pdf_truncate_text($pdf, $line->product_label, 45)), 0, 'L');
328 // Warehouse
329 $pdf->SetXY($this->posxwarehouse, $curY);
330 $pdf->MultiCell($this->posxbatch - $this->posxwarehouse - 1, 3, $outputlangs->convToOutputCharset(pdf_truncate_text($pdf, $line->warehouse_ref, 12)), 0, 'L');
331 // Batch
332 $pdf->SetXY($this->posxbatch, $curY);
333 $pdf->MultiCell($this->posxqtystock - $this->posxbatch - 1, 3, $outputlangs->convToOutputCharset(pdf_truncate_text($pdf, $line->batch, 10)), 0, 'L');
334 // Expected qty
335 $pdf->SetXY($this->posxqtystock, $curY);
336 $pdf->MultiCell($this->posxqtyview - $this->posxqtystock - 1, 3, ($line->qty_stock !== null && $line->qty_stock !== '') ? price2num($line->qty_stock, 'MS') : '', 0, 'R');
337
338 if ($recorded) {
339 $gap = (float) $line->qty_view - (float) $line->qty_stock;
340 // Counted qty
341 $pdf->SetXY($this->posxqtyview, $curY);
342 $pdf->MultiCell($this->posxgap - $this->posxqtyview - 1, 3, price2num($line->qty_view, 'MS'), 0, 'R');
343 // Gap
344 if ($gap != 0) {
345 $pdf->SetTextColor(150, 0, 0);
346 $nbgap++;
347 }
348 $pdf->SetXY($this->posxgap, $curY);
349 $pdf->MultiCell($this->posxend - $this->posxgap, 3, ($gap > 0 ? '+' : '').price2num($gap, 'MS'), 0, 'R');
350 $pdf->SetTextColor(0, 0, 0);
351 $totalgap += $gap;
352 $totalgapvalue += $gap * (float) $line->pmp;
353 } else {
354 // Count sheet: empty writable cells
355 $pdf->SetXY($this->posxqtyview, $curY - 1);
356 $pdf->MultiCell($this->posxgap - $this->posxqtyview - 1, 5, '', 1, 'R');
357 $pdf->SetXY($this->posxgap, $curY - 1);
358 $pdf->MultiCell($this->posxend - $this->posxgap, 5, '', 1, 'R');
359 }
360
361 $nexY = $curY + ($recorded ? 5 : 6);
362 }
363
364 // Totals
365 $pdf->SetFont('', 'B', $default_font_size - 1);
366 $curY = $nexY + 4;
367 if ($curY > ($this->page_hauteur - ($heightforfooter + $heightforinfotot + $heightforsignature))) {
368 $this->pageFoot($pdf, $object, $outputlangs, 1);
369 $pdf->AddPage();
370 $pagenb++;
371 $curY = $tab_top_newpage;
372 }
373 $pdf->SetXY($this->posxproduct, $curY);
374 $pdf->MultiCell(60, 4, $outputlangs->transnoentities("NbOfLines").' : '.$nblines, 0, 'L');
375 if ($recorded) {
376 $pdf->SetXY($this->posxproduct, $curY + 5);
377 $pdf->MultiCell(120, 4, $outputlangs->transnoentities("Difference").' : '.($totalgap > 0 ? '+' : '').price2num($totalgap, 'MS').' ('.$nbgap.' '.$outputlangs->transnoentities("Lines").')', 0, 'L');
378 $pdf->SetXY($this->posxproduct, $curY + 10);
379 $pdf->MultiCell(120, 4, $outputlangs->transnoentities("Valuation").' : '.price(price2num($totalgapvalue, 'MT'), 0, $outputlangs, 1, -1, -1, $conf->currency), 0, 'L');
380 }
381
382 // Signature block on count sheets
383 if (!$recorded) {
384 $posy = $curY + 8;
385 $pdf->SetFont('', '', $default_font_size - 1);
386 $pdf->SetXY($this->posxproduct, $posy);
387 $pdf->MultiCell(80, 4, $outputlangs->transnoentities("CountedBy").' : ____________________', 0, 'L');
388 $pdf->SetXY($this->page_largeur - $this->marge_droite - 80, $posy);
389 $pdf->MultiCell(80, 4, $outputlangs->transnoentities("DateAndSignature").' :', 0, 'L');
390 $pdf->Rect($this->page_largeur - $this->marge_droite - 80, $posy + 5, 80, 15);
391 }
392
393 // Page foot
394 $this->pageFoot($pdf, $object, $outputlangs, 0);
395 if (method_exists($pdf, 'AliasNbPages')) {
396 $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
397 }
398
399 $pdf->Close();
400
401 $pdf->Output($file, 'F');
402
403 // Add pdfgeneration hook
404 $hookmanager->initHooks(array('pdfgeneration'));
405 $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs);
406 global $action;
407 $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
408 if ($reshook < 0) {
409 $this->error = $hookmanager->error;
410 $this->errors = $hookmanager->errors;
411 }
412
413 dolChmod($file);
414
415 $this->result = array('fullpath' => $file);
416
417 return 1; // No error
418 }
419
429 protected function tableHeader(&$pdf, $tab_top, $outputlangs, $recorded)
430 {
431 global $conf;
432
433 $default_font_size = pdf_getPDFFontSize($outputlangs);
434
435 $pdf->SetFont('', 'B', $default_font_size - 2);
436 $pdf->SetDrawColor(128, 128, 128);
437 $pdf->line($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite, $tab_top);
438
439 $posy = $tab_top + 1;
440 $pdf->SetXY($this->posxproduct, $posy);
441 $pdf->MultiCell($this->posxlabel - $this->posxproduct - 1, 3, $outputlangs->transnoentities("ProductRef"), 0, 'L');
442 $pdf->SetXY($this->posxlabel, $posy);
443 $pdf->MultiCell($this->posxwarehouse - $this->posxlabel - 1, 3, $outputlangs->transnoentities("Label"), 0, 'L');
444 $pdf->SetXY($this->posxwarehouse, $posy);
445 $pdf->MultiCell($this->posxbatch - $this->posxwarehouse - 1, 3, $outputlangs->transnoentities("Warehouse"), 0, 'L');
446 $pdf->SetXY($this->posxbatch, $posy);
447 $pdf->MultiCell($this->posxqtystock - $this->posxbatch - 1, 3, $outputlangs->transnoentities("Batch"), 0, 'L');
448 $pdf->SetXY($this->posxqtystock, $posy);
449 $pdf->MultiCell($this->posxqtyview - $this->posxqtystock - 1, 3, $outputlangs->transnoentities("ExpectedQty"), 0, 'R');
450 $pdf->SetXY($this->posxqtyview, $posy);
451 $pdf->MultiCell($this->posxgap - $this->posxqtyview - 1, 3, $outputlangs->transnoentities("RealQty"), 0, 'R');
452 $pdf->SetXY($this->posxgap, $posy);
453 $pdf->MultiCell($this->posxend - $this->posxgap, 3, $outputlangs->transnoentities("Difference"), 0, 'R');
454
455 $pdf->line($this->marge_gauche, $tab_top + 6, $this->page_largeur - $this->marge_droite, $tab_top + 6);
456 }
457
469 protected function pageHead(&$pdf, $object, $showaddress, $outputlangs, $recorded, $isspecimen)
470 {
471 global $conf, $langs, $mysoc;
472
473 $default_font_size = pdf_getPDFFontSize($outputlangs);
474
475 pdf_pagehead($pdf, $outputlangs, $this->page_hauteur);
476
477 $pdf->SetTextColor(0, 0, 60);
478 $pdf->SetFont('', 'B', $default_font_size + 3);
479
480 $posy = $this->marge_haute;
481 $posx = $this->page_largeur - $this->marge_droite - 100;
482
483 $pdf->SetXY($this->marge_gauche, $posy);
484
485 // Logo
486 $logo = $conf->mycompany->dir_output.'/logos/'.$mysoc->logo;
487 if ($mysoc->logo) {
488 if (is_readable($logo)) {
489 $height = pdf_getHeightForLogo($logo);
490 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
491 } else {
492 $pdf->SetTextColor(200, 0, 0);
493 $pdf->SetFont('', 'B', $default_font_size - 2);
494 $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
495 $pdf->SetTextColor(0, 0, 60);
496 }
497 } else {
498 $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($mysoc->name), 0, 'L');
499 }
500
501 $pdf->SetFont('', 'B', $default_font_size + 3);
502 $pdf->SetXY($posx, $posy);
503 $pdf->SetTextColor(0, 0, 60);
504 $title = $outputlangs->transnoentities("Inventory");
505 if (!$recorded) {
506 $title .= ' - '.$outputlangs->transnoentities("Draft");
507 }
508 $pdf->MultiCell(100, 4, $title, '', 'R');
509
510 $pdf->SetFont('', 'B', $default_font_size);
511 $posy += 5;
512 $pdf->SetXY($posx, $posy);
513 $pdf->SetTextColor(0, 0, 60);
514 $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : ".($isspecimen ? 'SPECIMEN' : $outputlangs->convToOutputCharset($object->ref)), '', 'R');
515
516 $pdf->SetFont('', '', $default_font_size - 1);
517
518 if (!$isspecimen && !empty($object->date_inventory)) {
519 $posy += 4;
520 $pdf->SetXY($posx, $posy);
521 $pdf->SetTextColor(0, 0, 60);
522 $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : ".dol_print_date($this->db->jdate($object->date_inventory), "day", false, $outputlangs, true), '', 'R');
523 }
524 if (!$isspecimen && !empty($object->title)) {
525 $posy += 4;
526 $pdf->SetXY($posx, $posy);
527 $pdf->SetTextColor(0, 0, 60);
528 $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($object->title), '', 'R');
529 }
530
531 $pdf->SetTextColor(0, 0, 0);
532
533 return 0;
534 }
535
545 protected function pageFoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
546 {
547 $showdetails = getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', 0);
548 return pdf_pagefoot($pdf, $outputlangs, 'INVENTORY_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);
549 }
550}
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
$propal type
'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',...
Definition propal.php:280
Parent class for documents models.
Class to build inventory documents with model standard_inventory.
write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0)
Function to build pdf onto disk.
pageHead(&$pdf, $object, $showaddress, $outputlangs, $recorded, $isspecimen)
Show top header of page.
tableHeader(&$pdf, $tab_top, $outputlangs, $recorded)
Show table header.
pageFoot(&$pdf, $object, $outputlangs, $hidefreetext=0)
Show footer of page.
global $mysoc
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dolChmod($filepath, $newmask='')
Change mod of a file.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
pdf_getFormat($outputlangs=null, $mode='setup')
Return array with format properties of default PDF format.
Definition pdf.lib.php:87
pdf_getPDFFontSize($outputlangs)
Return font size to use for PDF generation.
Definition pdf.lib.php:296
pdf_getHeightForLogo($logo, $url=false)
Return height to use for Logo onto PDF.
Definition pdf.lib.php:319
pdf_pagehead($pdf, $outputlangs, $page_height)
Show header of page for PDF generation.
Definition pdf.lib.php:792
pdf_pagefoot($pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_basse, $marge_gauche, $page_hauteur, $object, $showdetails=0, $hidefreetext=0, $page_largeur=0, $watermark='')
Show footer of page for PDF generation.
Definition pdf.lib.php:1466
pdf_getPDFFont($outputlangs)
Return font name to use for PDF generation.
Definition pdf.lib.php:275
pdf_truncate_text($pdf, $text, $max_width, $ellipsis_pos=1, $ellipsis="\u{2026}")
Truncates text to fit a specified width in TCPDF, with configurable ellipsis position.
Definition pdf.lib.php:3437
pdf_getInstance($format='', $metric='mm', $pagetype='P')
Return a PDF instance object.
Definition pdf.lib.php:129
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:140