UML model Invoices

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

Product line

Standard

|

Expert

Operating mode

Cloud Suite

|

ON-PREMISES

Modules

Services & CRM

Budget & Phases

Purchases

Resource Planning

Business Intelligence

Created: 04.07.2008
Machine translated
Updated: 04.08.2017 | Pictures replaced. Designations consistently in lower case.

Class model

Invoice totals

Calculation of totals

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

By calling one of the derived members of an open invoice, the appropriate total is recalculated. On charged invoices, the contents of the persistent x-members are used.

The totals are created on the basis of the services, expenses and outlays on the invoice. The following description deals with the calculation of the total services, the case for expenses and outlays is analogous.

All services of the invoice, as well as any flat-rate 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. If none is found, a new one is created.

The grouping properties are as follows:

  • VAT code
  • VAT rate
  • debtor account
  • cost unit

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

  • wertExt
  • wertInt
  • minutenInt
  • minutenExt
  • kosten

Fixed-price phases with total 0

If the sum 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:

  • VAT code of the invoice
  • VAT rate of the invoice
  • revenueAccountServices of the phase, if specified, otherwise revenueAccountServices of the project
  • costUnitServices of the phase, if specified, otherwise costUnitServices of the project

The planFeeServicesExt of the phase counts as wertExt, the sum of the minutesInt on the services of the phase counts as minutenInt, and the planCostServices is used as kosten.

Fixed-Price Invoices

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

  • Invoice.VAT code,
  • Invoice VAT rate,
  • Project income account services,
  • Project cost centreServices

As ValueExt, the fixed amount of the invoice is used as MinutesInt, the sum of MinutesInt on services of the invoice is used.

Value Cost is not used.

Treatment of discount on invoice

If an invoice has a discount on it and the ServiceVertExt 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 value text minus the discount is saved in the separate attributes ValueTextDiscount and VATAmountDiscount of the total. The use of the separate attributes is necessary due to backward 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. In this case, a total is requested as in the case of a fixed-price invoice and only ValueExtDiscount and VATAmountDiscount are set there.

To ensure that discounts are always taken into account correctly, ValueExtDiscount and VATAmountDiscount should always be used for service totals.

Treatment of expenses and outlays

Treatment of expenses and outlays is analogous, except that no minute values are added and no discounts are taken into account.

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