RenderedInvoice
in package
implements
Attachable, Responsable
uses
DeliversFile
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
__construct()
public
__construct(RenderedInvoice $result) : mixed
Parameters
- $result : RenderedInvoice
as()
The result for another format of the same run.
public
as(string $format) : self
Parameters
- $format : string
Tags
Return values
selfcancel()
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
selfcontents()
The main output: PDF, otherwise XML, HTML or JSON.
public
contents() : string
Return values
stringcore()
The result of the core, e.g. for save() to a local path.
public
core() : RenderedInvoice
Return values
RenderedInvoicedata()
The calculated invoice data of the run (totals, VAT breakdown, due date).
public
data() : InvoiceData
Return values
InvoiceDatadownload()
public
download([string|null $filename = null ]) : Response
Parameters
- $filename : string|null = null
Return values
Responsefilename()
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
stringformat()
Key of the format of this result, e.g. "zugferd".
public
format() : string
Return values
stringformats()
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
boolhasXml()
Whether this format produced XML (also the XML embedded in a PDF).
public
hasXml() : bool
Return values
boolhtml()
The rendered template, as mPDF received it.
public
html() : string
Tags
Return values
stringjson()
The invoice as JSON (InvoiceData::toJson()).
public
json() : string
Return values
stringmimeType()
MIME type of the main output (contents()).
public
mimeType() : string
Return values
stringpdf()
The PDF.
public
pdf() : string
Tags
Return values
stringprofile()
Profile of the XML; null for formats without XML.
public
profile() : Profile|null
Return values
Profile|nullsave()
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
Return values
string —the stored path
stream()
public
stream([string|null $filename = null ]) : Response
Parameters
- $filename : string|null = null
Return values
ResponsetoMailAttachment()
public
toMailAttachment() : Attachment
Return values
AttachmenttoResponse()
public
toResponse(Request $request) : Response
Parameters
- $request : Request
Return values
Responsevalidation()
Validation result of this format; in the mode "warn" it may contain errors, empty in the mode "off".
public
validation() : ValidationResult
Return values
ValidationResultxml()
The e-invoice XML, also the one embedded in the PDF.
public
xml() : string