node-zugferd
Version:
A Node.js library for creating ZUGFeRD/Factur-X compliant documents. Generating XML and embedding it into PDF/A files, enabling seamless e-invoicing and digital document compliance.
399 lines (397 loc) • 9.29 kB
JavaScript
// src/codelists/index.ts
var getByPath = (obj, path) => path.split(".").reduce((acc, key) => acc?.[key], obj);
var createEnum = (data, options) => {
return Object.fromEntries(
data.map((item) => [
getByPath(item, options.keyProp),
getByPath(item, options.valueProp)
])
);
};
// src/codelists/untdid-1001.gen.ts
var PUBLISHED = /* @__PURE__ */ new Date("2025-01-01T00:00:00.000Z");
var UNTDID_1001 = [
{
key: "REQUEST_FOR_PAYMENT",
name: "Request for payment",
value: "71",
interpretation: "Invoice"
},
{
key: "DEBIT_NOTE_RELATED_TO_GOODS_OR_SERVICES",
name: "Debit note related to goods or services",
value: "80",
interpretation: "Invoice"
},
{
key: "CREDIT_NOTE_RELATED_TO_GOODS_OR_SERVICES",
name: "Credit note related to goods or services",
value: "81",
interpretation: "Credit Note"
},
{
key: "METERED_SERVICES_INVOICE",
name: "Metered services invoice",
value: "82",
interpretation: "Invoice"
},
{
key: "CREDIT_NOTE_RELATED_TO_FINANCIAL_ADJUSTMENTS",
name: "Credit note related to financial adjustments",
value: "83",
interpretation: "Credit Note"
},
{
key: "DEBIT_NOTE_RELATED_TO_FINANCIAL_ADJUSTMENTS",
name: "Debit note related to financial adjustments",
value: "84",
interpretation: "Invoice"
},
{
key: "TAX_NOTIFICATION",
name: "Tax notification",
value: "102",
interpretation: "Invoice"
},
{
key: "INVOICING_DATA_SHEET",
name: "Invoicing data sheet",
value: "130",
interpretation: "Invoice"
},
{
key: "DIRECT_PAYMENT_VALUATION",
name: "Direct payment valuation",
value: "202",
interpretation: "Invoice"
},
{
key: "PROVISIONAL_PAYMENT_VALUATION",
name: "Provisional payment valuation",
value: "203",
interpretation: "Invoice"
},
{
key: "PAYMENT_VALUATION",
name: "Payment valuation",
value: "204",
interpretation: "Invoice"
},
{
key: "INTERIM_APPLICATION_FOR_PAYMENT",
name: "Interim application for payment",
value: "211",
interpretation: "Invoice"
},
{
key: "FINAL_PAYMENT_REQUEST_BASED_ON_COMPLETION_OF_WORK",
name: "Final payment request based on completion of work",
value: "218",
interpretation: "Invoice"
},
{
key: "PAYMENT_REQUEST_FOR_COMPLETED_UNITS",
name: "Payment request for completed units",
value: "219",
interpretation: "Invoice"
},
{
key: "SELF_BILLED_CREDIT_NOTE",
name: "Self billed credit note",
value: "261",
interpretation: "Credit Note"
},
{
key: "CONSOLIDATED_CREDIT_NOTE_GOODS_AND_SERVICES",
name: "Consolidated credit note - goods and services",
value: "262",
interpretation: "Credit Note"
},
{
key: "PRICE_VARIATION_INVOICE",
name: "Price variation invoice",
value: "295",
interpretation: "Invoice"
},
{
key: "CREDIT_NOTE_FOR_PRICE_VARIATION",
name: "Credit note for price variation",
value: "296",
interpretation: "Credit Note"
},
{
key: "DELCREDERE_CREDIT_NOTE",
name: "Delcredere credit note",
value: "308",
interpretation: "Credit Note"
},
{
key: "PROFORMA_INVOICE",
name: "Proforma invoice",
value: "325",
interpretation: "Invoice"
},
{
key: "PARTIAL_INVOICE",
name: "Partial invoice",
value: "326",
interpretation: "Invoice"
},
{
key: "COMMERCIAL_INVOICE_WHICH_INCLUDES_A_PACKING_LIST",
name: "Commercial invoice which includes a packing list",
value: "331",
interpretation: "Invoice"
},
{
key: "COMMERCIAL_INVOICE",
name: "Commercial invoice",
value: "380",
interpretation: "Invoice"
},
{
key: "CREDIT_NOTE",
name: "Credit note",
value: "381",
interpretation: "Credit Note"
},
{
key: "COMMISSION_NOTE",
name: "Commission note",
value: "382",
interpretation: "Invoice"
},
{
key: "DEBIT_NOTE",
name: "Debit note",
value: "383",
interpretation: "Invoice"
},
{
key: "CORRECTED_INVOICE",
name: "Corrected invoice",
value: "384",
interpretation: "Invoice"
},
{
key: "CONSOLIDATED_INVOICE",
name: "Consolidated invoice",
value: "385",
interpretation: "Invoice"
},
{
key: "PREPAYMENT_INVOICE",
name: "Prepayment invoice",
value: "386",
interpretation: "Invoice"
},
{
key: "HIRE_INVOICE",
name: "Hire invoice",
value: "387",
interpretation: "Invoice"
},
{
key: "TAX_INVOICE",
name: "Tax invoice",
value: "388",
interpretation: "Invoice"
},
{
key: "SELF_BILLED_INVOICE",
name: "Self-billed invoice",
value: "389",
interpretation: "Invoice"
},
{
key: "DELCREDERE_INVOICE",
name: "Delcredere invoice",
value: "390",
interpretation: "Invoice"
},
{
key: "FACTORED_INVOICE",
name: "Factored invoice",
value: "393",
interpretation: "Invoice"
},
{
key: "LEASE_INVOICE",
name: "Lease invoice",
value: "394",
interpretation: "Invoice"
},
{
key: "CONSIGNMENT_INVOICE",
name: "Consignment invoice",
value: "395",
interpretation: "Invoice"
},
{
key: "FACTORED_CREDIT_NOTE",
name: "Factored credit note",
value: "396",
interpretation: "Credit Note"
},
{
key: "OPTICAL_CHARACTER_READING_OCR_PAYMENT_CREDIT_NOTE",
name: "Optical Character Reading (OCR) payment credit note",
value: "420",
interpretation: "Credit Note"
},
{
key: "DEBIT_ADVICE",
name: "Debit advice",
value: "456",
interpretation: "Invoice"
},
{
key: "REVERSAL_OF_DEBIT",
name: "Reversal of debit",
value: "457",
interpretation: "Invoice"
},
{
key: "REVERSAL_OF_CREDIT",
name: "Reversal of credit",
value: "458",
interpretation: "Credit Note"
},
{
key: "SELF_BILLED_CORRECTIVE_INVOICE_INVOICE_TYPE_CORRECTED",
name: "Self-billed corrective invoice, invoice type, Corrected",
value: "471",
interpretation: "Invoice"
},
{
key: "FACTORED_CORRECTIVE_INVOICE_INVOICE_TYPE_CORRECTED",
name: "Factored Corrective Invoice, invoice type, Corrected",
value: "472",
interpretation: "Invoice"
},
{
key: "SELF_BILLED_FACTORED_CORRECTIVE_INVOICE_INVOICE_TYPE_CORRECTED",
name: "Self billed Factored corrective invoice, invoice type, Corrected",
value: "473",
interpretation: "Invoice"
},
{
key: "SELF_PREPAYMENT_INVOICE_INVOICE_TYPE_ORIGINAL",
name: "Self Prepayment invoice, invoice type, Original",
value: "500",
interpretation: "Invoice"
},
{
key: "SELF_BILLED_FACTORED_INVOICE_INVOICE_TYPE_ORIGINAL",
name: "Self billed factored invoice, invoice type, Original",
value: "501",
interpretation: "Invoice"
},
{
key: "SELF_BILLET_FACTORED_CREDIT_NOTE_CREDIT_NOTE_TYPE_CORRECTED",
name: "Self billet factored Credit Note, Credit note type, Corrected",
value: "502",
interpretation: "Credit Note"
},
{
key: "PREPAYMENT_CREDIT_NOTE_CREDIT_NOTE_TYPE_CORRECTED",
name: "Prepayment credit note, credit note type, Corrected",
value: "503",
interpretation: "Credit Note"
},
{
key: "SELF_BILLED_DEBIT_NOTE",
name: "Self billed debit note",
value: "527",
interpretation: "Invoice"
},
{
key: "FORWARDERS_CREDIT_NOTE",
name: "Forwarder's credit note",
value: "532",
interpretation: "Credit Note"
},
{
key: "FORWARDERS_INVOICE_DISCREPANCY_REPORT",
name: "Forwarder's invoice discrepancy report",
value: "553",
interpretation: "Invoice"
},
{
key: "INSURERS_INVOICE",
name: "Insurer's invoice",
value: "575",
interpretation: "Invoice"
},
{
key: "FORWARDERS_INVOICE",
name: "Forwarder's invoice",
value: "623",
interpretation: "Invoice"
},
{
key: "PORT_CHARGES_DOCUMENTS",
name: "Port charges documents",
value: "633",
interpretation: "Invoice"
},
{
key: "INVOICE_INFORMATION_FOR_ACCOUNTING_PURPOSES",
name: "Invoice information for accounting purposes",
value: "751",
interpretation: "Invoice"
},
{
key: "FREIGHT_INVOICE",
name: "Freight invoice",
value: "780",
interpretation: "Invoice"
},
{
key: "CLAIM_NOTIFICATION",
name: "Claim notification",
value: "817",
interpretation: "Invoice"
},
{
key: "CONSULAR_INVOICE",
name: "Consular invoice",
value: "870",
interpretation: "Invoice"
},
{
key: "PARTIAL_CONSTRUCTION_INVOICE",
name: "Partial construction invoice",
value: "875",
interpretation: "Invoice"
},
{
key: "PARTIAL_FINAL_CONSTRUCTION_INVOICE",
name: "Partial final construction invoice",
value: "876",
interpretation: "Invoice"
},
{
key: "FINAL_CONSTRUCTION_INVOICE",
name: "Final construction invoice",
value: "877",
interpretation: "Invoice"
},
{
key: "CUSTOMS_INVOICE",
name: "Customs invoice",
value: "935",
interpretation: "Invoice"
}
];
var untdid1001Code = UNTDID_1001.map(({ value }) => value);
var Untdid1001 = createEnum(UNTDID_1001, {
keyProp: "key",
valueProp: "value"
});
export {
PUBLISHED,
UNTDID_1001,
Untdid1001,
untdid1001Code
};