Blesta
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • blesta
    • app
      • components
        • events
          • default
      • controllers
      • models
    • components
      • auth
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • exchange
        • rates
          • foxrate
          • google
            • finance
          • yahoo
            • finance
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
      • json
      • modules
      • net
        • http
        • net
          • amazon
            • s3
          • geo
            • ip
      • plugins
      • recaptcha
      • security
      • session
        • cart
      • settingscollection
      • upgrades
      • upload
      • vcard
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
  • com
    • tecnick
      • tcpdf
        • blesta
          • components
            • invoice
              • templates
                • quickbooks
                  • invoice
                • templates
                  • default
  • Crypt
    • AES
    • DES
    • Hash
    • Random
    • RC4
    • Rijndael
    • RSA
    • TerraDES
  • File
    • ANSI
    • ASN1
    • X509
  • Math
    • BigInteger
  • minPHP
    • components
      • input
      • record
    • helpers
      • color
      • data
        • structure
      • date
      • html
      • xml
    • lib
  • Net
    • SFTP
    • SSH1
    • SSH2
  • None
  • PHP
  • PHPMailer
  • Services
    • JSON
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • DefaultInvoice
  • InvoiceTemplate
  • InvoiceTemplates
  • QuickbooksInvoice

Class DefaultInvoice

Abstract class that all Invoice Templates must extend

InvoiceTemplate
Extended by DefaultInvoice
Package: blesta\components\invoice\templates
Copyright: Copyright (c) 2010, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at components/invoice_templates/default_invoice/default_invoice.php

Methods summary

public
# __construct( )

Loads the language to be used for this invoice

Loads the language to be used for this invoice

public
# setMeta( array $meta )

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

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

Parameters

$meta
array
$meta 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
public
# includeAddress( boolean $include_address = true )

Sets whether the to address should be included in the invoice

Sets whether the to address should be included in the invoice

Parameters

$include_address
boolean
$include_address True to include the to address information, false to leave the information off of the document
public
# setCurrency( CurrencyFormat $currency_format )

Sets the CurrencyFormat object for parsing currency values

Sets the CurrencyFormat object for parsing currency values

Parameters

$currency_format
CurrencyFormat
$currency_format The CurrencyFormat object
public
# setMimeType( string $mime_type )

Sets the MIME type to be used when fetching and streaming this invoice. Called after __construct()

Sets the MIME type to be used when fetching and streaming this invoice. Called after __construct()

Parameters

$mime_type
string
$mime_type The mime_type to render ("application/pdf", "text/html", etc.)
public
# supportedMimeTypes( )

Returns the MIME types that this template supports for output

Returns the MIME types that this template supports for output

public string
# getFileExtension( string $mime_type )

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

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

Parameters

$mime_type
string
$mime_type The mime_type to fetch the extension of

Returns

string
The extension to use for the given mime type
public
# getName( )

Returns the name of this invoice PDF template

Returns the name of this invoice PDF template

public string
# getVersion( )

Returns the version of this invoice PDF template

Returns the version of this invoice PDF template

Returns

string
The current version of this invoice PDF template
public array
# getAuthors( )

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

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

Returns

array
The name and URL of the authors of this invoice PDF template
public
# makeDocument( array $invoice_data )

Generates one or more invoices for a single document

Generates one or more invoices for a single document

Parameters

$invoice_data
array
$invoice_data An numerically indexed array of stdClass objects each representing an invoice
public string
# fetch( )

Returns the invoice document in the desired format

Returns the invoice document in the desired format

Returns

string
The PDF document in binary format
public
# stream( string $name = null )

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

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

Parameters

$name
string
$name The name for the document minus the extension (optional)

Throws

Exception
Thrown when the MIME type is not supported by the template
public
# download( string $name = null )

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

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

Parameters

$name
string
$name The name for the document minus the extension (optional)

Throws

Exception
Thrown when the MIME type is not supported by the template

Magic methods summary

Properties summary

private static string $version
#

The version of this template

The version of this template

private static string $authors
#

The authors of this template

The authors of this template

private DefaultInvoicePdf $pdf
#

The PDF object used for rendering

The PDF object used for rendering

private array $meta
#

An array of meta data for this template

An array of meta data for this template

private array $invoice
#

Param

stdClass
Invoice data for the last invoice set
private mixed $mime_type
#

Param

string
MIME type to use when rendering this document
Blesta API documentation generated by ApiGen 2.8.0