// SPDX-License-Identifier: EUPL-1.2 // Business terms a validation profile can require. No imports, so the profile editor can use // this list without loading the rule engine. const CUSTOMER_PARTY = "cac:AccountingCustomerParty/cac:Party"; /** Optional fields a company may require on every invoice it accepts. */ export const REQUIRABLE_TERMS = { "BT-9": { label: "Payment due date", invoice: "cbc:DueDate", creditNote: "cac:PaymentMeans/cbc:PaymentDueDate" }, "BT-10": { label: "Buyer reference", invoice: "cbc:BuyerReference", creditNote: "cbc:BuyerReference" }, "BT-12": { label: "Contract reference", invoice: "cac:ContractDocumentReference/cbc:ID", creditNote: "cac:ContractDocumentReference/cbc:ID" }, "BT-13": { label: "Purchase order reference", invoice: "cac:OrderReference/cbc:ID", creditNote: "cac:OrderReference/cbc:ID" }, "BT-19": { label: "Buyer accounting reference", invoice: "cbc:AccountingCost", creditNote: "cbc:AccountingCost" }, "BT-20": { label: "Payment terms", invoice: "cac:PaymentTerms/cbc:Note", creditNote: "cac:PaymentTerms/cbc:Note" }, "BT-48": { label: "Buyer VAT identifier", invoice: `${CUSTOMER_PARTY}/cac:PartyTaxScheme/cbc:CompanyID`, creditNote: `${CUSTOMER_PARTY}/cac:PartyTaxScheme/cbc:CompanyID` }, "BT-72": { label: "Actual delivery date", invoice: "cac:Delivery/cbc:ActualDeliveryDate", creditNote: "cac:Delivery/cbc:ActualDeliveryDate" }, "BT-84": { label: "Payment account identifier", invoice: "cac:PaymentMeans/cac:PayeeFinancialAccount/cbc:ID", creditNote: "cac:PaymentMeans/cac:PayeeFinancialAccount/cbc:ID" } } as const; export type RequirableTerm = keyof typeof REQUIRABLE_TERMS; export const REQUIRABLE_TERM_IDS = Object.keys(REQUIRABLE_TERMS) as RequirableTerm[];