dolibarr 24.0.0-beta
ModelePdfAccountancy Class Reference

Parent class of accountancy models. More...

Inheritance diagram for ModelePdfAccountancy:
Collaboration diagram for ModelePdfAccountancy:

Public Member Functions

 write_file (BookKeeping $object, Translate $outputlangs, string $srctemplatepath='', bool $directDownload=true)
 Function to build pdf onto disk.
 
 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.
 
 defineColumnField ($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
 Define Array Column Field into $this->cols This method must be implemented by the module that generate the document with its own columns.
 

Static Public Member Functions

static liste_modeles ($db, $maxfilenamelength=0)
 Return list of active generation modules.
 

Protected Member Functions

 addDashLine (TCPDF $pdf, int $page, $y)
 Add dash line.
 
 addTotalLine (TCPDF $pdf, &$curY, &$nexY, $default_font_size, string $label, $tab_top_newpage, $debit, $credit, bool $uppercase=true)
 Add a total line to pdf.
 
 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.
 

Detailed Description

Parent class of accountancy models.

Definition at line 41 of file modules_accountancy.php.

Member Function Documentation

◆ addDashLine()

ModelePdfAccountancy::addDashLine ( TCPDF $pdf,
int $page,
$y )
protected

Add dash line.

Parameters
TCPDF$pdfTCPDF object
int$pagePage number
int | float$yY position
Returns
void

Definition at line 101 of file modules_accountancy.php.

Referenced by addTitleLine(), pdf_balance\addTotalLine(), pdf_bookkeeping\addTotalLine(), pdf_ledger\addTotalLine(), pdf_balance\write_file(), pdf_bookkeeping\write_file(), and pdf_ledger\write_file().

◆ addTitleLine()

ModelePdfAccountancy::addTitleLine ( TCPDF $pdf,
& $curY,
& $nexY,
$default_font_size,
string $columnKey,
string $label,
$tab_top_newpage,
bool $uppercase = true )
protected

Add the total accountancy group line to pdf.

Parameters
TCPDF$pdfTCPDF object
float$curYCurrent line Y
float$nexYNext line Y
int | float$default_font_sizeDefault font size
string$columnKeyColumn where to place title
string$labelLine label
int | float$tab_top_newpageTable top
bool$uppercaseApply uppercase ?
Returns
void

Definition at line 140 of file modules_accountancy.php.

References addDashLine(), getDolGlobalString(), and printTitleContent().

Referenced by pdf_bookkeeping\write_file(), and pdf_ledger\write_file().

◆ addTotalLine()

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

Add a total line to pdf.

Parameters
TCPDF$pdfTCPDF object
int | float$curYCurrent line Y
int | 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 in pdf_balance, pdf_bookkeeping, and pdf_ledger.

◆ liste_modeles()

static ModelePdfAccountancy::liste_modeles ( $db,
$maxfilenamelength = 0 )
static

Return list of active generation modules.

Parameters
DoliDB$dbDatabase handler
int<0,max>$maxfilenamelength Max length of value to show
Returns
string[]|int<-1,0> List of templates

Definition at line 67 of file modules_accountancy.php.

References getListOfModels().

◆ pdfTabTitles()

ModelePdfAccountancy::pdfTabTitles ( & $pdf,
$tab_top,
$tab_height,
$outputlangs,
$hidetop = 0 )

Print standard column content.

Parameters
TCPDI | TCPDF$pdfPdf object
float$tab_topTab top position
float$tab_heightDefault tab height
Translate$outputlangsOutput language
int$hidetopHide top
Returns
float Height of col tab titles

Reimplemented from CommonDocGenerator.

Definition at line 204 of file modules_accountancy.php.

References $conf, CommonDocGenerator\getColumnStatus(), and setEventMessages().

Referenced by pdf_balance\_tableau(), pdf_bookkeeping\_tableau(), pdf_ledger\_tableau(), pdf_balance\write_file(), pdf_bookkeeping\write_file(), and pdf_ledger\write_file().

◆ printTitleContent()

ModelePdfAccountancy::printTitleContent ( $pdf,
$curY,
$colKey,
$columnText )
protected

Print a title using the colKey start position, and the end of table as end position.

Parameters
TCPDF$pdfTCPDF object
int | float$curYCurrent line Y
string$colKeyColumn key name
string$columnTextTitle text
Returns
void

Definition at line 179 of file modules_accountancy.php.

References CommonDocGenerator\getColumnContentXStart(), and CommonDocGenerator\setAfterColsLinePositionsData().

Referenced by addTitleLine().

◆ write_file()

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

Function to build pdf onto disk.

Parameters
BookKeeping$objectObject source to build document
Translate$outputlangsLang output object
string$srctemplatepathFull path of source filename for generator using a template file
bool$directDownloadSend the generated pdf to the browser
Returns
int<-1,1> 1 if OK, <=0 if KO

Reimplemented in pdf_balance, pdf_bookkeeping, and pdf_ledger.


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