@fin.cx/einvoice
Version:
A TypeScript module for creating, manipulating, and embedding XML data within PDF files specifically tailored for electronic invoice (einvoice) packages.
50 lines (49 loc) • 1.52 kB
TypeScript
import { CIIBaseDecoder } from '../cii.decoder.js';
import type { TCreditNote, TDebitNote } from '../../../interfaces/common.js';
/**
* Decoder for ZUGFeRD v1 invoice format
*/
export declare class ZUGFeRDV1Decoder extends CIIBaseDecoder {
/**
* Constructor
* @param xml XML string to decode
* @param skipValidation Whether to skip EN16931 validation
*/
constructor(xml: string, skipValidation?: boolean);
/**
* Decodes a ZUGFeRD v1 credit note
* @returns Promise resolving to a TCreditNote object
*/
protected decodeCreditNote(): Promise<TCreditNote>;
/**
* Decodes a ZUGFeRD v1 debit note (invoice)
* @returns Promise resolving to a TDebitNote object
*/
protected decodeDebitNote(): Promise<TDebitNote>;
/**
* Extracts common invoice data from ZUGFeRD v1 XML
* @returns Common invoice data
*/
private extractCommonData;
/**
* Extracts party information from ZUGFeRD v1 XML
* @param partyXPath XPath to the party node
* @returns Party information as TContact
*/
private extractParty;
/**
* Extracts invoice items from ZUGFeRD v1 XML
* @returns Array of invoice items
*/
private extractItems;
/**
* Extracts notes from ZUGFeRD v1 XML
* @returns Array of notes
*/
private extractNotes;
/**
* Creates a default date for empty date fields
* @returns Default date object compatible with TContact
*/
private createDefaultDate;
}