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
Attributes
- #[Length]
- $max: 60
- #[NotBlank]
$issueDate
Fecha de expedición de la factura
public
DateTimeImmutable
$issueDate
NOTE: Time part will be ignored.
Tags
Attributes
- #[NotBlank]
$issuerId
Número de identificación fiscal (NIF) del obligado a expedir la factura
public
string
$issuerId
Tags
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
equals()
Compare instance against another invoice identifier
public
equals(InvoiceIdentifier $other) : bool
Parameters
- $other : InvoiceIdentifier
-
Other invoice identifier
Return values
bool —Whether instances are equal
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
Return values
self —New invoice identifier instance
validate()
Validate this instance
public
final validate() : void