Class
InvoiceCalculator
OfficeIMO.Invoicing
Shared decimal arithmetic for invoice XML, validation and visible presentation.
Inheritance
- object
- InvoiceCalculator
Methods
public static InvoiceCalculation Calculate(Invoice invoice) #Calculates line totals, category-level VAT and the amount due, or returns retained declared values for an aggregate-only invoice.
Parameters
- invoice OfficeIMO.Invoicing.Invoice
Returns
InvoiceCalculationpublic static decimal RoundAmount(decimal value) #Rounds to two decimal places using XPath round semantics (ties towards positive infinity).
Parameters
- value decimal
Returns
decimalUpdateDeclaredAmounts 2 overloads
public static InvoiceCalculation UpdateDeclaredAmounts(Invoice invoice) #Explicitly replaces source-declared amounts after editing prices, quantities, taxes or adjustments.
Parameters
- invoice OfficeIMO.Invoicing.Invoice
Returns
InvoiceCalculationpublic static InvoiceCalculation UpdateDeclaredAmounts(Invoice invoice, decimal? taxExchangeRate) #Recalculates declared amounts. An explicit positive rate converts invoice VAT to accounting currency; without a rate, a changed VAT total invalidates its retained foreign-currency amount.
Parameters
- invoice OfficeIMO.Invoicing.Invoice
- Invoice to update after editing.
- taxExchangeRate decimal?
- Accounting-currency units per invoice-currency unit, chosen by the caller for the applicable tax point.
Returns
InvoiceCalculation