Quittio next API

RenderedInvoice
in package
implements Attachable, Responsable uses DeliversFile

FinalYes

Rendered invoice for Laravel: usable as mail attachment and as HTTP response, storable on any filesystem disk.

Table of Contents

Interfaces

Attachable
Responsable

Methods

__construct()  : mixed
as()  : self
The result for another format of the same run.
cancel()  : self
Cancels this invoice: builds the cancellation with Quittio::cancellation() and renders it in the formats of this invoice. $lines cancels part of it, $history passes the earlier partial cancellations (see Quittio::cancellation()).
contents()  : string
The main output: PDF, otherwise XML, HTML or JSON.
core()  : RenderedInvoice
The result of the core, e.g. for save() to a local path.
data()  : InvoiceData
The calculated invoice data of the run (totals, VAT breakdown, due date).
download()  : Response
filename()  : string
File name of the main output, from the configured pattern; $extension replaces the extension of the main output.
format()  : string
Key of the format of this result, e.g. "zugferd".
formats()  : array<int, string>
hashes()  : array<string, string>
hasPdf()  : bool
Whether this format produced a PDF.
hasXml()  : bool
Whether this format produced XML (also the XML embedded in a PDF).
html()  : string
The rendered template, as mPDF received it.
json()  : string
The invoice as JSON (InvoiceData::toJson()).
mimeType()  : string
MIME type of the main output (contents()).
pdf()  : string
The PDF.
profile()  : Profile|null
Profile of the XML; null for formats without XML.
save()  : string
Stores the main output on a filesystem disk (default: quittio.storage.disk).
stream()  : Response
toMailAttachment()  : Attachment
toResponse()  : Response
validation()  : ValidationResult
Validation result of this format; in the mode "warn" it may contain errors, empty in the mode "off".
xml()  : string
The e-invoice XML, also the one embedded in the PDF.

Methods

as()

The result for another format of the same run.

public as(string $format) : self
Parameters
$format : string
Tags
throws
LogicException

when the format was not rendered in this run

Return values
self

cancel()

Cancels this invoice: builds the cancellation with Quittio::cancellation() and renders it in the formats of this invoice. $lines cancels part of it, $history passes the earlier partial cancellations (see Quittio::cancellation()).

public cancel(string $number[, string|null $reason = null ][, array<int, BigDecimal|int|string, amount?: string}>|null $lines = null ][, Date|DateTimeInterface|string|null $issueDate = null ][, string|null $strategy = null ][, CancellationHistory|null $history = null ]) : self
Parameters
$number : string
$reason : string|null = null
$lines : array<int, BigDecimal|int|string, amount?: string}>|null = null
$issueDate : Date|DateTimeInterface|string|null = null
$strategy : string|null = null
$history : CancellationHistory|null = null
Return values
self

contents()

The main output: PDF, otherwise XML, HTML or JSON.

public contents() : string
Return values
string

download()

public download([string|null $filename = null ]) : Response
Parameters
$filename : string|null = null
Return values
Response

filename()

File name of the main output, from the configured pattern; $extension replaces the extension of the main output.

public filename([string|null $extension = null ]) : string
Parameters
$extension : string|null = null
Return values
string

format()

Key of the format of this result, e.g. "zugferd".

public format() : string
Return values
string

formats()

public formats() : array<int, string>
Return values
array<int, string>

hashes()

public hashes() : array<string, string>
Return values
array<string, string>

hasPdf()

Whether this format produced a PDF.

public hasPdf() : bool
Return values
bool

hasXml()

Whether this format produced XML (also the XML embedded in a PDF).

public hasXml() : bool
Return values
bool

html()

The rendered template, as mPDF received it.

public html() : string
Tags
throws
LogicException

when the format produced no HTML

Return values
string

json()

The invoice as JSON (InvoiceData::toJson()).

public json() : string
Return values
string

mimeType()

MIME type of the main output (contents()).

public mimeType() : string
Return values
string

save()

Stores the main output on a filesystem disk (default: quittio.storage.disk).

public save([string|null $disk = null ][, string|null $path = null ]) : string
Parameters
$disk : string|null = null
$path : string|null = null
Tags
throws
RuntimeException

when the disk does not store the file

Return values
string —

the stored path

stream()

public stream([string|null $filename = null ]) : Response
Parameters
$filename : string|null = null
Return values
Response

toMailAttachment()

public toMailAttachment() : Attachment
Return values
Attachment

toResponse()

public toResponse(Request $request) : Response
Parameters
$request : Request
Return values
Response

xml()

The e-invoice XML, also the one embedded in the PDF.

public xml() : string
Tags
throws
LogicException

when the format produces no XML (see hasXml())

Return values
string
On this page

Search results