dolibarr 24.0.0-beta
pdf_ledger Class Reference

Class to build sending documents with model Espadon. More...

Inheritance diagram for pdf_ledger:
Collaboration diagram for pdf_ledger:

Public Member Functions

 __construct (DoliDB $db)
 Constructor.
 
 write_file (BookKeeping $object, Translate $outputlangs, string $srctemplatepath='', bool $directDownload=true)
 Function to build pdf onto disk.
 
 defineColumnField ($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
 Define Array Column Field.
 
- Public Member Functions inherited from ModelePdfAccountancy
 pdfTabTitles (&$pdf, $tab_top, $tab_height, $outputlangs, $hidetop=0)
 Print standard column content.
 
- Public Member Functions inherited from CommonDocGenerator
 __construct ($db)
 Constructor.
 
 get_substitutionarray_user ($user, $outputlangs)
 Define array with couple substitution key => substitution value.
 
 getSubstitutionarrayMember ($member, $outputlangs)
 Define array with couple substitution key => substitution value.
 
 get_substitutionarray_mysoc ($mysoc, $outputlangs)
 Define array with couple substitution key => substitution value.
 
 get_substitutionarray_thirdparty ($object, $outputlangs, $array_key='company')
 Define array with couple substitution key => substitution value For example {company_name}, {company_name_alias}.
 
 get_substitutionarray_contact ($object, $outputlangs, $array_key='object')
 Define array with couple substitution key => substitution value.
 
 get_substitutionarray_other ($outputlangs)
 Define array with couple substitution key => substitution value.
 
 get_substitutionarray_lines ($line, $outputlangs, $linenumber=0)
 Define array with couple substitution key => substitution value Note that vars into substitutions array are formatted.
 
 get_substitutionarray_shipment ($object, $outputlangs, $array_key='object')
 Define array with couple substitution key => substitution value Note that vars into substitutions array are formatted.
 
 get_substitutionarray_each_var_object (&$object, $outputlangs, $recursive=1)
 Define array with couple substitution key => substitution value @phpstan-template T.
 
 fill_substitutionarray_with_extrafields ($object, $array_to_fill, $extrafields, $array_key, $outputlangs)
 Fill array with couple extrafield key => extrafield value Note that vars into substitutions array are formatted.
 
 printRect ($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
 Rect pdf.
 
 printRoundedRect ($pdf, $x, $y, $w, $h, $r, $hidetop=0, $hidebottom=0, $style='D')
 Print a rounded rectangle on the PDF.
 
 getMaxAfterColsLinePositionsData ()
 Get position in PDF after col display.
 
 resetAfterColsLinePositionsData (float $y, int $pageNumb)
 Used for reset afterColsLinePositions var in start of a new pdf draw line loop.
 
 setAfterColsLinePositionsData (string $colId, float $y, int $pageNumb)
 Used for to set afterColsLinePositions var in a pdf draw line loop.
 
 columnSort ($a, $b)
 uasort callback function to Sort columns fields
 
 prepareArrayColumnField ($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
 Prepare Array Column Field.
 
 getColumnContentWidth ($colKey)
 get column content width from column key
 
 getColumnContentXStart ($colKey)
 get column content X (abscissa) left position from column key
 
 getColumnRank ($colKey)
 get column position rank from column key
 
 insertNewColumnDef ($newColKey, $defArray, $targetCol='', $insertAfterTarget=false)
 get column position rank from column key
 
 printStdColumnContent ($pdf, &$curY, $colKey, $columnText='')
 print standard column content
 
 printColDescContent ($pdf, &$curY, $colKey, $object, $i, $outputlangs, $hideref=0, $hidedesc=0, $issupplierline=0)
 print description column content
 
 getExtrafieldContent ($object, $extrafieldKey, $outputlangs=null)
 get extrafield content for pdf writeHtmlCell compatibility usage for PDF line columns and object note block
 
 getColumnStatus ($colKey)
 get column status from column key
 
 defineColumnExtrafield ($object, $outputlangs, $hidedetails=0)
 Define Array Column Field for extrafields.
 

Protected Member Functions

 _tableau (&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0, $currency='', $outputlangsbis=null)
 Show table for lines.
 
 _pagehead (&$pdf, $object, $showaddress, $outputlangs)
 Show top header of page.
 
 _pagefoot (&$pdf, $object, $outputlangs, $hidefreetext=0)
 Show footer of page.
 
 addTotalLine (TCPDF $pdf, &$curY, &$nexY, $default_font_size, string $label, $tab_top_newpage, $debit, $credit, bool $uppercase=true)
 Add a total line to pdf.
 
- Protected Member Functions inherited from ModelePdfAccountancy
 addDashLine (TCPDF $pdf, int $page, $y)
 Add dash line.
 
 addTitleLine (TCPDF $pdf, &$curY, &$nexY, $default_font_size, string $columnKey, string $label, $tab_top_newpage, bool $uppercase=true)
 Add the total accountancy group line to pdf.
 
 printTitleContent ($pdf, $curY, $colKey, $columnText)
 Print a title using the colKey start position, and the end of table as end position.
 

Additional Inherited Members

- Static Public Member Functions inherited from ModelePdfAccountancy
static liste_modeles ($db, $maxfilenamelength=0)
 Return list of active generation modules.
 

Detailed Description

Class to build sending documents with model Espadon.

Definition at line 42 of file pdf_ledger.modules.php.

Constructor & Destructor Documentation

◆ __construct()

pdf_ledger::__construct ( DoliDB $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 95 of file pdf_ledger.modules.php.

References $db, $mysoc, description, dol_syslog(), getCallerInfoString(), getDolGlobalInt(), name, pdf_getFormat(), and type.

Member Function Documentation

◆ _pagefoot()

pdf_ledger::_pagefoot ( & $pdf,
$object,
$outputlangs,
$hidefreetext = 0 )
protected

Show footer of page.

Need this->emetteur object

Parameters
TCPDF$pdfPDF
BookKeeping$objectObject to show
Translate$outputlangsObject lang for output
int<0,1>$hidefreetext 1=Hide free text
Returns
int Return height of bottom margin including footer text

Definition at line 759 of file pdf_ledger.modules.php.

References $object, getDolGlobalInt(), and pdf_pagefoot().

Referenced by write_file().

◆ _pagehead()

pdf_ledger::_pagehead ( & $pdf,
$object,
$showaddress,
$outputlangs )
protected

Show top header of page.

Parameters
TCPDF$pdfObject PDF
BookKeeping$objectObject to show
int<0,1>$showaddress 0=no, 1=yes
Translate$outputlangsObject lang for output
Returns
float|int Return topshift value

Definition at line 680 of file pdf_ledger.modules.php.

References $conf, date, dol_now(), dol_print_date(), pdf_getPDFFontSize(), pdf_pagehead(), and string.

Referenced by write_file().

◆ _tableau()

pdf_ledger::_tableau ( & $pdf,
$tab_top,
$tab_height,
$nexY,
$outputlangs,
$hidetop = 0,
$hidebottom = 0,
$currency = '',
$outputlangsbis = null )
protected

Show table for lines.

Parameters
TCPDF$pdfObject PDF
float | int$tab_topTop position of table
float | int$tab_heightHeight of table (rectangle)
float$nexYY
Translate$outputlangsLangs object
int$hidetopHide top bar of array
int$hidebottomHide bottom bar of array
string$currencyCurrency code
Translate$outputlangsbisLangs object bis
Returns
void

Definition at line 631 of file pdf_ledger.modules.php.

References $conf, getDolGlobalString(), pdf_getPDFFontSize(), ModelePdfAccountancy\pdfTabTitles(), and CommonDocGenerator\printRoundedRect().

Referenced by write_file().

◆ addTotalLine()

pdf_ledger::addTotalLine ( TCPDF $pdf,
& $curY,
& $nexY,
$default_font_size,
string $label,
$tab_top_newpage,
$debit,
$credit,
bool $uppercase = true )
protected

Add a total line to pdf.

Parameters
TCPDF$pdfTCPDF object
float$curYCurrent line Y
float$nexYNext line Y
int | float$default_font_sizeDefault font size
string$labelLine label
int | float$tab_top_newpageTable top
int | float | string$debitDebit
int | float | string$creditCredit
bool$uppercaseApply uppercase ?
Returns
void

Reimplemented from ModelePdfAccountancy.

Definition at line 1000 of file pdf_ledger.modules.php.

References ModelePdfAccountancy\addDashLine(), CommonDocGenerator\getColumnStatus(), getDolGlobalString(), price(), price2num(), and CommonDocGenerator\printStdColumnContent().

Referenced by write_file().

◆ defineColumnField()

pdf_ledger::defineColumnField ( $object,
$outputlangs,
$hidedetails = 0,
$hidedesc = 0,
$hideref = 0 )

Define Array Column Field.

Parameters
CommonObject$objectcommon object
Translate$outputlangslangs
int<0,1>$hidedetails Do not show line details
int<0,1>$hidedesc Do not show desc
int<0,1>$hideref Do not show ref
Returns
void

Reimplemented from CommonDocGenerator.

Definition at line 775 of file pdf_ledger.modules.php.

References $conf, $object, CommonDocGenerator\defineColumnExtrafield(), getDolGlobalInt(), and setEventMessages().

◆ write_file()

pdf_ledger::write_file ( BookKeeping $object,
Translate $outputlangs,
string $srctemplatepath = '',
bool $directDownload = true )

Function to build pdf onto disk.

Parameters
BookKeeping$objectObject shipping to generate (or id if old method)
Translate$outputlangsLang output object
string$srctemplatepathSource template path
bool$directDownloadSend generated file to browser
Returns
int<-1,1> 1 if OK, <=0 if KO

Reimplemented from ModelePdfAccountancy.

Definition at line 144 of file pdf_ledger.modules.php.

References $conf, $object, _pagefoot(), _pagehead(), _tableau(), ModelePdfAccountancy\addDashLine(), ModelePdfAccountancy\addTitleLine(), addTotalLine(), date, dol_mkdir(), dol_now(), dol_print_date(), dol_sanitizeFileName(), dolChmod(), CommonDocGenerator\getColumnStatus(), getDolGlobalInt(), getDolGlobalString(), length_accounta(), length_accountg(), pdf_getInstance(), pdf_getPDFFont(), pdf_getPDFFontSize(), ModelePdfAccountancy\pdfTabTitles(), CommonDocGenerator\prepareArrayColumnField(), price(), price2num(), and CommonDocGenerator\printStdColumnContent().


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