Skip to content

AssociatedDocument

Referencia al documento que se corrige o recibe.

Se construye con AssociatedDocument.electronic, AssociatedDocument.printed o AssociatedDocument.none, que completan los campos que corresponden a cada tipo.

Constructors

Constructor

ts
new AssociatedDocument(options): AssociatedDocument;

Parameters

ParameterType
optionsAssociatedDocumentOptions

Returns

AssociatedDocument

Properties

type

ts
readonly type: 
  | "electronic_invoice"
  | "printed_invoice"
  | "retention_certificate"
  | "none";

cdc

ts
readonly cdc: string | undefined;

printedType

ts
readonly printedType: 2 | 1 | 3 | 5 | 4 | undefined;

stampIdentifier

ts
readonly stampIdentifier: string | undefined;

establishmentCode

ts
readonly establishmentCode: string | undefined;

dispatchPointCode

ts
readonly dispatchPointCode: string | undefined;

number

ts
readonly number: string | undefined;

documentDate

ts
readonly documentDate: string | Date | undefined;

Methods

electronic()

ts
static electronic(cdc): AssociatedDocument;

Una factura electrónica, referida por su CDC de 44 caracteres.

Parameters

ParameterType
cdcstring

Returns

AssociatedDocument


printed()

ts
static printed(options): AssociatedDocument;

Un documento preimpreso, de antes de la facturación electrónica.

Parameters

ParameterType
options{ stampIdentifier: string; establishmentCode: string; dispatchPointCode: string; number: string; documentDate: string | Date; printedType?: 2 | 1 | 3 | 5 | 4; }
options.stampIdentifierstring
options.establishmentCodestring
options.dispatchPointCodestring
options.numberstring
options.documentDatestring | Date
options.printedType?2 | 1 | 3 | 5 | 4

Returns

AssociatedDocument


none()

ts
static none(): AssociatedDocument;

Sin documento asociado. Solo lo aceptan los recibos y las remisiones.

Returns

AssociatedDocument


toApi()

ts
toApi(): {
[key: string]: unknown;
};

Returns

ts
{
[key: string]: unknown;
}