Blesta Source Documentation

PerforatedInvoice extends InvoiceTemplate

Perforated Invoice Template

Table of Contents

Properties

$authors
$invoice
$meta
$mime_type
$pdf
$version

Methods

__construct() Loads the language to be used for this invoice
download() Outputs the Invoice document to stdout, sending the appropriate headers to force a download of the document
fetch() Returns the invoice document in the desired format
getAuthors() Returns the name and URL for the authors of this invoice PDF template
getFileExtension() Returns the file extension for the given (supported) mime type
getName() Returns the name of this invoice PDF template
getVersion() Returns the version of this invoice PDF template
includeAddress() Sets whether the to address should be included in the invoice
makeDocument() Generates one or more invoices for a single document
setCurrency() Sets the CurrencyFormat object for parsing currency values
setDate() Sets the Date object for parsing date values
setMeta() Sets the meta data to use for this invoice. This method is invoked after __construct() but before makeDocument()
setMimeType() Sets the MIME type to be used when fetching and streaming this invoice.
stream() Outputs the Invoice document to stdout, sending the apporpriate headers to render the document inline
supportedMimeTypes() Returns the MIME types that this template supports for output
supportsQuotes() Determine whether this invoice template supports quotes
Properties

$authors

private static string $authors = [['name' => 'Phillips Data, Inc.', 'url' => 'http://www.blesta.com']]

The authors of this template

$invoice

private array<string|int, mixed> $invoice = []

Invoice data for the last invoice set

$meta

private array<string|int, mixed> $meta = []

An array of meta data for this template

$mime_type

private string $mime_type

MIME type to use when rendering this document

Methods

__construct()

Loads the language to be used for this invoice

public __construct() : mixed

download()

Outputs the Invoice document to stdout, sending the appropriate headers to force a download of the document

public download([string $name = null ]) : mixed
Parameters
$name : string = null

The name for the document minus the extension (optional)

Tags
throws
Exception

Thrown when the MIME type is not supported by the template

fetch()

Returns the invoice document in the desired format

public fetch() : string
Return values
string

The PDF document in binary format

getAuthors()

Returns the name and URL for the authors of this invoice PDF template

public getAuthors() : array<string|int, mixed>
Return values
array<string|int, mixed>

The name and URL of the authors of this invoice PDF template

getFileExtension()

Returns the file extension for the given (supported) mime type

public getFileExtension(string $mime_type) : string
Parameters
$mime_type : string

The mime_type to fetch the extension of

Return values
string

The extension to use for the given mime type

getName()

Returns the name of this invoice PDF template

public getName() : mixed

getVersion()

Returns the version of this invoice PDF template

public getVersion() : string
Return values
string

The current version of this invoice PDF template

includeAddress()

Sets whether the to address should be included in the invoice

public includeAddress([bool $include_address = true ]) : mixed
Parameters
$include_address : bool = true

True to include the address on the PDF, or false otherwise (optional, default true)

makeDocument()

Generates one or more invoices for a single document

public makeDocument(array<string|int, mixed> $invoice_data) : mixed
Parameters
$invoice_data : array<string|int, mixed>

An numerically indexed array of stdClass objects each representing an invoice

setDate()

Sets the Date object for parsing date values

public setDate(Date $date) : mixed
Parameters
$date : Date

The Date object

setMeta()

Sets the meta data to use for this invoice. This method is invoked after __construct() but before makeDocument()

public setMeta(array<string|int, mixed> $meta) : mixed
Parameters
$meta : array<string|int, mixed>

An array of meta data including:

  • background The absolute path to the background graphic
  • logo The absolute path to the logo graphic
  • company_name The name of the company
  • company_address The address of the company
  • terms The terms to display on this invoice
  • paper_size The size of paper to use (e.g. "A4" or "Letter")
  • tax An array of tax info including:
    • tax_id The Tax ID/VATIN of this company
    • cascade_tax Whether or not taxes are cascading
  • language The language of the definitions to set for this document

setMimeType()

Sets the MIME type to be used when fetching and streaming this invoice.

public setMimeType(string $mime_type) : mixed

Called after __construct()

Parameters
$mime_type : string

The mime_type to render ("application/pdf", "text/html", etc.)

stream()

Outputs the Invoice document to stdout, sending the apporpriate headers to render the document inline

public stream([string $name = null ]) : mixed
Parameters
$name : string = null

The name for the document minus the extension (optional)

Tags
throws
Exception

Thrown when the MIME type is not supported by the template

supportedMimeTypes()

Returns the MIME types that this template supports for output

public supportedMimeTypes() : mixed

supportsQuotes()

Determine whether this invoice template supports quotes

public supportsQuotes() : bool
Return values
bool
Tags
subpackage

components.invoicetemplates.perforated_invoice

copyright

Copyright (c) 2015, Phillips Data, Inc.

license

http://www.blesta.com/license/ The Blesta License Agreement

link

Blesta


        
On this page

Search results