import { AutoEncoder } from '@simonbackx/simple-encoding'; import { BalanceItem, VATExcemptReason } from '../BalanceItem.js'; export declare class InvoicedBalanceItem extends AutoEncoder { id: string; balanceItemId: string; name: string; description: string; /** * Price of the balance that was actually invoiced. Always includes VAT. * * This only explains the due balance that was invoiced so we don't invoice items multiple times. It does not correspond to the visible unit price or price on the invoice. * * - E.g. if balance item price is 5 euro including VAT (=balanceInvoicedAmount), then unit price would be 4,13 euro. You'll see this causes a rounding issue if the amount is 2, because then the price including VAT of the invoice would be 9,99 instead of 10. * - E.g. if balance item price is 0,242 euro including VAT (=balanceInvoicedAmount), then unit price would be 0,20 euro (no rounding issue) * - E.g. if balance item price is 0,243 euro including VAT (=balanceInvoicedAmount), then unit price would also be 0,20 euro (rounding issue) * * Any rounding issues are fixed on the invoice level. */ balanceInvoicedAmount: number; /** * quantity per ten thousand * We need to support 4 decimals in case of partial payments. * E.g. 10 euro of 30 euro was paid and is invoiced, then the amount would be 0.3333, stored as 3333 * Mostly for legal reasons, to be able to say wat was actually bought without faking an amount */ quantity: number; /** * Price per piece * Always excludes VAT */ unitPrice: number; /** * This is duplicated to allow altering the vat percentage of the corresponding balance item later, so * mistakes can be corrected and credited. */ VATPercentage: number; /** * Note: does not apply to unitPrice, only to the balance item at the time of invoicing */ VATIncluded: boolean; /** * This is duplicated to allow altering the vat percentage of the corresponding balance item later, so * mistakes can be corrected and credited. */ VATExcempt: VATExcemptReason | null; /** * This should be rounded to 2 decimals to match PEPPOL requirements * = LineExtensionAmount */ get totalWithoutVAT(): number; /** * Total without VAT, but not rounded */ get preciseTotalWithoutVAT(): number; /** * Debug helper */ addedToUnitPriceToCorrectVAT: number; /** * Creates a default configuration for a balance item that needs to be invoiced. The result can still be adjusted to correct rounding issues, because * a balanace item cannot always be perfectly represented on an invoice (on an invoice rounding happens on invoice level, while balance items can have any price that is not really rounded at any time unless when paid). * * @param balanceItem * @param amount paid (or to be paid) price, should always include VAT if there is VAT */ static createFor(balanceItem: BalanceItem, amount: number): InvoicedBalanceItem; /** * Important, this influences VAT calculatio. Items are grouped by key and VAT is calculated per group. */ static getVATUniqueKey(item: InvoicedBalanceItem): string; static groupPerVATCategory(items: InvoicedBalanceItem[]): InvoicedBalanceItem[][]; } //# sourceMappingURL=InvoicedBalanceItem.d.ts.map