UML model for invoices

Excerpt from the class model for invoices and description of the calculation of invoice totals

Operating mode

Cloud Suite

|

ON-PREMISES

Modules

Services & CRM

Budget & Phases

Purchases

Resource Planning

Business Intelligence

Created: 04.07.2008
Updated: 26.06.2025 | English models added.

Class model

Invoice totals

Calculating totals

An invoice has three lists of totals: totaleLeistungen, totaleSpesen and totaleAuslagen. These members are all derived ObjectLists. Behind them are the persistent lists xTotaleLeistungen, xTotaleSpesen and xTotaleAuslagen.

If you call up one of the derived Objectlists of an open invoice, the total is recalculated. On charged invoices, the content of the persistent x list is used.

The totals are created based on the services, expenses and outlays on the invoice. The following description refers to the calculation of the total services. However, the case is the same for expenses and outlays.

All the services on the invoice and any fixed-price phases on the invoice are reviewed.

For each service, the grouping properties for calculation totals are compiled and a corresponding total is requested. In this context, requested means that an already existing total (already created due to a service further up in the list) is searched for. If none is found, a new one is created.

The grouping properties are as follows:

  • VATCode
  • VATRate
  • revenue account
  • cost unit

The following values of each service are added to the total:

  • FeeExt
  • FeeInt
  • MinutesInt
  • MinutesExt
  • FeeCost

Fixed-price phases with total 0

If the total of the services on a fixed-price phase is 0 (e.g. no services on the phase), a separate total for the phase is requested, with the following grouping properties:

  • Rechnung.leistMWSTCode
  • Rechnung.leistMWSTSatz
  • Phase.ertragskontoLeistungen, if specified, otherwise Projekt.ertragskontoLeistungen
  • Phase.kostenstelleLeistungen, if specified, otherwise Projekt.kostenstelleLeistungen

The PlanFeeServicesExt of the phase counts as FeeExt, the total of the MinutesInt on the services of the phase counts as MinutesInt, and the PlanCostServices is used as Costs.

Fixed-price invoices

If an invoice is a fixed price, with a fixed amount <> 0, but the total of its services is 0, then a service total is requested for the invoice with the following grouping properties:

  • Rechnung.leistMWSTCode,
  • Rechnung.leistMWSTSatz,
  • Projekt.ertragskontoLeistungen,
  • Projekt.kostenstelleLeistungen

As FeeExt, the fixed price of the invoice is used; as MinutesInt, the sum of MinutesInt on services of the invoice is used.

FeeCost is not used.

Handling discounts on invoices

If an invoice has a discount on it and the TotalFeeServicesExt of the invoice is <> 0, then the discount amount is distributed proportionally to all service totals, rounded according to the rounding rule of the currency. The FeeExt minus the discount is saved in the separate attributes FeeExtDiscount and VATAmountDiscount of the total.  Separate attributes are necessary due to backwards compatibility.

There are rounding differences due to the rounding of the discount portions, which are then added to the invoice total with the highest service value.

There is also the special case where an invoice has no service value, but a discount. We also deal with this. A total is requested, like with a fixed-price invoice, and only FeeExtDiscount and VATAmountDiscount are set there.

To ensure that discounts are always considered correctly, you should always use FeeExtDiscount and VATAmountDiscount for service totals.

Handling expenses and outlays

Expenses and outlays are handled in the same way, except that no minute values are added and no discounts are considered.

For expenses and outlays, rounding differences may occur in the VAT amounts (if the system setting “Round expenses and outlays” is deactivated), and these are also added to the total with the highest value.

Netherlands

United Kingdom