Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

InvoiceCalculator

OfficeIMO.Invoicing

Namespace
OfficeIMO.Invoicing
Assembly
OfficeIMO.Invoicing
Source revision
ba882f6b0d07 with working tree changes
Modifiers
static

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 required
public static decimal RoundAmount(decimal value) #

Rounds to two decimal places using XPath round semantics (ties towards positive infinity).

Parameters

value decimal required

Returns

decimal
UpdateDeclaredAmounts 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 required
public 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 required
Invoice to update after editing.
taxExchangeRate decimal? required
Accounting-currency units per invoice-currency unit, chosen by the caller for the applicable tax point.