FacturaScripts

MAILExport extends PDFExport
in package

Description of MAILExport

Tags
author

Carlos García Gómez [email protected]

Table of Contents

CONTENT_X  = 30
X position to start writing.
FONT_SIZE  = 9
Font size.
FOOTER_Y  = 10
Y position to start footer
INVOICE_TOTALS_Y  = 200
LIST_LIMIT  = 500
MAX_TITLE_LEN  = 12
Maximum title length
$divisaTools  : DivisaTools
$format  : FormatoDocumento
$i18n  : Translator
Translator object
$insertedHeader  : bool
$numberTools  : NumberTools
Class with number tools (to format numbers)
$pdf  : Cezpdf
PDF object.
$sendParams  : array<string|int, mixed>
$tableWidth  : int|float
PDF table width.
$fileName  : string
__construct()  : mixed
PDFExport constructor.
addBusinessDocPage()  : bool
addListModelPage()  : bool
Adds a new page with a table listing the model's data.
addModelPage()  : bool
addTablePage()  : bool
Adds a new page with the table.
getDoc()  : mixed
Return the full document.
getOrientation()  : mixed
newDoc()  : mixed
Blank document.
newPage()  : mixed
Adds a new page.
setOrientation()  : mixed
Sets default orientation.
show()  : mixed
addImageFromAttachedFile()  : mixed
addImageFromFile()  : mixed
calcImageSize()  : array<string|int, mixed>
Calculate image size and return as array of width and height
combineAddress()  : string
Combine address if the parameters don´t empty
fixValue()  : string
getBankData()  : string
getColumnAlignments()  : array<string|int, mixed>
getColumnTitles()  : array<string|int, mixed>
getColumnWidgets()  : array<string|int, mixed>
getCountryName()  : string
Gets the name of the country with that code.
getCursorData()  : array<string|int, mixed>
getCursorRawData()  : array<string|int, mixed>
getDivisaName()  : string
Gets the name of an specify divisa
getDocAddress()  : string
Returns the combination of the address.
getDocumentFormat()  : FormatoDocumento
getFileName()  : string
getLineHeaders()  : array<string|int, mixed>
getModelColumnsData()  : array<string|int, mixed>
getModelFields()  : array<string|int, mixed>
getTableData()  : array<string|int, mixed>
Returns the table data
getTaxesRows()  : mixed
insertBusinessDocBody()  : mixed
Generate the body of the page with the model data.
insertBusinessDocFooter()  : mixed
Inserts the footer of the page with the model data.
insertBusinessDocHeader()  : mixed
Inserts the header of the page with the model data.
insertBusinessDocShipping()  : mixed
Inserts the address of delivery with the model data.
insertCompanyLogo()  : mixed
Inserts company logo to PDF document or dies with a message to try to solve the problem.
insertFooter()  : mixed
Insert footer details.
insertHeader()  : mixed
Insert header details.
insertInvoicePayMethod()  : mixed
insertInvoiceReceipts()  : mixed
insertParallelTable()  : mixed
Generate a table with two key => value per row.
newLine()  : mixed
Adds a new line to the PDF.
newLongTitles()  : mixed
Adds a description of long titles to the PDF.
parallelTableData()  : array<string|int, mixed>
Returns a new table with 2 columns. Each column with colName1: colName2
removeEmptyCols()  : mixed
Remove the empty columns to save space.
removeLongTitles()  : mixed
Adds to $longTitles, and replace all long titles from $titles
setFileName()  : mixed
setTableColumns()  : mixed
Set the table content.
toolBox()  : ToolBox

Constants

CONTENT_X

X position to start writing.

public mixed CONTENT_X = 30

FONT_SIZE

Font size.

public mixed FONT_SIZE = 9

Y position to start footer

public mixed FOOTER_Y = 10

INVOICE_TOTALS_Y

public mixed INVOICE_TOTALS_Y = 200

MAX_TITLE_LEN

Maximum title length

public mixed MAX_TITLE_LEN = 12

Properties

$insertedHeader

protected bool $insertedHeader = false

$numberTools

Class with number tools (to format numbers)

protected NumberTools $numberTools

$pdf

PDF object.

protected Cezpdf $pdf

$sendParams

protected array<string|int, mixed> $sendParams = []

$tableWidth

PDF table width.

protected int|float $tableWidth = 0.0

Methods

__construct()

PDFExport constructor.

public __construct() : mixed
Return values
mixed

addListModelPage()

Adds a new page with a table listing the model's data.

public abstract addListModelPage(mixed $model, mixed $where, mixed $order, mixed $offset, mixed $columns[, mixed $title = '' ]) : bool
Parameters
$model : mixed
$where : mixed
$order : mixed
$offset : mixed
$columns : mixed
$title : mixed = ''
Return values
bool

addModelPage()

public addModelPage(ModelClass $model, array<string|int, mixed> $columns[, string $title = '' ]) : bool
Parameters
$model : ModelClass
$columns : array<string|int, mixed>
$title : string = ''
Return values
bool

addTablePage()

Adds a new page with the table.

public abstract addTablePage(mixed $headers, mixed $rows[, mixed $options = [] ][, mixed $title = '' ]) : bool
Parameters
$headers : mixed
$rows : mixed
$options : mixed = []
$title : mixed = ''
Return values
bool

getDoc()

Return the full document.

public abstract getDoc() : mixed
Return values
mixed

getOrientation()

public getOrientation() : mixed
Return values
mixed

newDoc()

Blank document.

public abstract newDoc(string $title, int $idformat, string $langcode) : mixed
Parameters
$title : string
$idformat : int
$langcode : string
Return values
mixed

newPage()

Adds a new page.

public newPage([string $orientation = 'portrait' ][, bool $forceNewPage = false ]) : mixed
Parameters
$orientation : string = 'portrait'
$forceNewPage : bool = false
Return values
mixed

setOrientation()

Sets default orientation.

public abstract setOrientation(string $orientation) : mixed
Parameters
$orientation : string
Return values
mixed

show()

public show(Response &$response) : mixed
Parameters
$response : Response
Return values
mixed

addImageFromAttachedFile()

protected addImageFromAttachedFile(AttachedFile $file, int|float $xPos, int|float $yPos, int|float $width, int|float $height) : mixed
Parameters
$file : AttachedFile
$xPos : int|float
$yPos : int|float
$width : int|float
$height : int|float
Return values
mixed

addImageFromFile()

protected addImageFromFile(string $filePath, int|float $xPos, int|float $yPos, int|float $width, int|float $height) : mixed
Parameters
$filePath : string
$xPos : int|float
$yPos : int|float
$width : int|float
$height : int|float
Return values
mixed

calcImageSize()

Calculate image size and return as array of width and height

protected calcImageSize(string $filePath) : array<string|int, mixed>
Parameters
$filePath : string
Return values
array<string|int, mixed>

fixValue()

protected fixValue(string $value) : string
Parameters
$value : string
Return values
string

getColumnAlignments()

protected getColumnAlignments(array<string|int, mixed> $columns) : array<string|int, mixed>
Parameters
$columns : array<string|int, mixed>
Return values
array<string|int, mixed>

getColumnTitles()

protected getColumnTitles(array<string|int, mixed> $columns) : array<string|int, mixed>
Parameters
$columns : array<string|int, mixed>
Return values
array<string|int, mixed>

getColumnWidgets()

protected getColumnWidgets(array<string|int, mixed> $columns) : array<string|int, mixed>
Parameters
$columns : array<string|int, mixed>
Return values
array<string|int, mixed>

getCountryName()

Gets the name of the country with that code.

protected getCountryName(string $code) : string
Parameters
$code : string
Return values
string

getCursorData()

protected getCursorData(array<string|int, ModelClass$cursor, array<string|int, mixed> $columns) : array<string|int, mixed>
Parameters
$cursor : array<string|int, ModelClass>
$columns : array<string|int, mixed>
Return values
array<string|int, mixed>

getCursorRawData()

protected getCursorRawData(array<string|int, ModelClass$cursor[, array<string|int, mixed> $fields = [] ]) : array<string|int, mixed>
Parameters
$cursor : array<string|int, ModelClass>
$fields : array<string|int, mixed> = []
Return values
array<string|int, mixed>

getDivisaName()

Gets the name of an specify divisa

protected getDivisaName(string $code) : string
Parameters
$code : string
Return values
string

getFileName()

protected getFileName() : string
Return values
string

getLineHeaders()

protected getLineHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>

getModelColumnsData()

protected getModelColumnsData(ModelClass $model, array<string|int, mixed> $columns) : array<string|int, mixed>
Parameters
$model : ModelClass
$columns : array<string|int, mixed>
Return values
array<string|int, mixed>

getModelFields()

protected getModelFields(ModelClass $model) : array<string|int, mixed>
Parameters
$model : ModelClass
Return values
array<string|int, mixed>

getTableData()

Returns the table data

protected getTableData(array<string|int, mixed> $cursor, array<string|int, mixed> $tableCols, array<string|int, mixed> $tableOptions) : array<string|int, mixed>
Parameters
$cursor : array<string|int, mixed>
$tableCols : array<string|int, mixed>
$tableOptions : array<string|int, mixed>
Return values
array<string|int, mixed>

insertBusinessDocShipping()

Inserts the address of delivery with the model data.

protected insertBusinessDocShipping(BusinessDocument $model) : mixed
Parameters
$model : BusinessDocument
Return values
mixed

Inserts company logo to PDF document or dies with a message to try to solve the problem.

protected insertCompanyLogo(int $idfile) : mixed
Parameters
$idfile : int
Return values
mixed

insertFooter()

Insert footer details.

protected insertFooter() : mixed
Return values
mixed

insertHeader()

Insert header details.

protected insertHeader([int $idempresa = null ]) : mixed
Parameters
$idempresa : int = null
Return values
mixed

insertParallelTable()

Generate a table with two key => value per row.

protected insertParallelTable(array<string|int, mixed> $tableData[, string $title = '' ][, array<string|int, mixed> $options = [] ]) : mixed
Parameters
$tableData : array<string|int, mixed>
$title : string = ''
$options : array<string|int, mixed> = []
Return values
mixed

newLine()

Adds a new line to the PDF.

protected newLine() : mixed
Return values
mixed

newLongTitles()

Adds a description of long titles to the PDF.

protected newLongTitles(array<string|int, mixed> &$titles, array<string|int, mixed> $columns) : mixed
Parameters
$titles : array<string|int, mixed>
$columns : array<string|int, mixed>
Return values
mixed

parallelTableData()

Returns a new table with 2 columns. Each column with colName1: colName2

protected parallelTableData(array<string|int, mixed> $table[, string $colName1 = 'key' ][, string $colName2 = 'value' ][, string $finalColName1 = 'data1' ][, string $finalColName2 = 'data2' ]) : array<string|int, mixed>
Parameters
$table : array<string|int, mixed>
$colName1 : string = 'key'
$colName2 : string = 'value'
$finalColName1 : string = 'data1'
$finalColName2 : string = 'data2'
Return values
array<string|int, mixed>

removeEmptyCols()

Remove the empty columns to save space.

protected removeEmptyCols(array<string|int, mixed> &$tableData, array<string|int, mixed> &$tableColsTitle[, mixed $customEmptyValue = '0' ]) : mixed
Parameters
$tableData : array<string|int, mixed>
$tableColsTitle : array<string|int, mixed>
$customEmptyValue : mixed = '0'
Return values
mixed

removeLongTitles()

Adds to $longTitles, and replace all long titles from $titles

protected removeLongTitles(array<string|int, mixed> &$longTitles, array<string|int, mixed> &$titles) : mixed
Parameters
$longTitles : array<string|int, mixed>
$titles : array<string|int, mixed>
Return values
mixed

setFileName()

protected setFileName(string $name) : mixed
Parameters
$name : string
Return values
mixed

setTableColumns()

Set the table content.

protected setTableColumns(array<string|int, mixed> &$columns, array<string|int, mixed> &$tableCols, array<string|int, mixed> &$tableColsTitle, array<string|int, mixed> &$tableOptions) : mixed
Parameters
$columns : array<string|int, mixed>
$tableCols : array<string|int, mixed>
$tableColsTitle : array<string|int, mixed>
$tableOptions : array<string|int, mixed>
Return values
mixed

Search results