Verifactu-PHP

InvoiceIdentifier extends Model
in package

Identificador de factura

Table of Contents

Properties

$invoiceNumber  : string
Nº Serie + Nº Factura que identifica a la factura emitida
$issueDate  : DateTimeImmutable
Fecha de expedición de la factura
$issuerId  : string
Número de identificación fiscal (NIF) del obligado a expedir la factura

Methods

__construct()  : mixed
Class constructor
equals()  : bool
Compare instance against another invoice identifier
export()  : void
Export model to XML
fromXml()  : self
Import instance from XML element
validate()  : void
Validate this instance

Properties

$invoiceNumber

Nº Serie + Nº Factura que identifica a la factura emitida

public string $invoiceNumber
Tags
field

IDFactura/NumSerieFactura

Attributes
#[Length]
$max: 60
#[NotBlank]

$issueDate

Fecha de expedición de la factura

public DateTimeImmutable $issueDate

NOTE: Time part will be ignored.

Tags
field

IDFactura/FechaExpedicionFactura

Attributes
#[NotBlank]

$issuerId

Número de identificación fiscal (NIF) del obligado a expedir la factura

public string $issuerId
Tags
field

IDFactura/IDEmisorFactura

Attributes
#[Length]
$exactly: 9
#[NotBlank]

Methods

__construct()

Class constructor

public __construct([string|null $issuerId = null ][, string|null $invoiceNumber = null ][, DateTimeImmutable|null $issueDate = null ]) : mixed
Parameters
$issuerId : string|null = null

Issuer ID

$invoiceNumber : string|null = null

Invoice number

$issueDate : DateTimeImmutable|null = null

Issue date

export()

Export model to XML

public export(UXML $xml, bool $isCancellation) : void

NOTE: Writes properties directly to the provided XML element, without creating a child node to wrap them. This is done as invoice identifiers appear in several different XML nodes.

Parameters
$xml : UXML

XML element

$isCancellation : bool

Whether to add cancellation suffix to properties

fromXml()

Import instance from XML element

public static fromXml(UXML $xml) : self
Parameters
$xml : UXML

XML element

Tags
throws
ImportException

if failed to parse XML

Return values
self

New invoice identifier instance


        
On this page

Search results