#888: AbstractRechnungsPositionDO.kt

projectforge-business/src/main/kotlin/org/projectforge/business/fibu/AbstractRechnungsPositionDO.kt

Type: Abstract JPA @MappedSuperclass entity

Package: org.projectforge.business.fibu

Full path: projectforge-business/src/main/kotlin/org/projectforge/business/fibu/AbstractRechnungsPositionDO.kt

141 lines · 88 code · 29 comments · 24 blank

Abstract base class for invoice position entities in ProjectForge. Serves as the shared superclass for both outgoing invoice positions (RechnungsPositionDO) and incoming invoice positions (EingangsrechnungsPositionDO). Provides common fields such as position number, text, quantity (menge), unit net price (einzelNetto), and VAT rate (vat), along with logic for managing cost assignments (KostZuweisungDO).

Class Hierarchy

Extends DefaultBaseDO, implements DisplayNameCapable and IRechnungsPosition. Annotated with @MappedSuperclass so it is not itself a database table — concrete subclasses provide their own JPA mappings.

Key Properties

PropertyTypeDB ColumnDescription
numberShortnumberPosition number, starting at 1
textString?s_text (1000)Invoice line item description
mengeBigDecimal?mengeQuantity (precision 18, scale 5)
einzelNettoBigDecimal?einzel_nettoUnit net price (precision 18, scale 2)
vatBigDecimal?vatVAT rate (precision 10, scale 5)
kostZuweisungenMutableList<KostZuweisungDO>?transientCost assignment list (abstract, provided by subclass)
infoRechnungPosInfotransientCalculated invoice position info (set via RechnungCalculator)

Cost Assignment Management

The class provides methods for managing KostZuweisungDO cost assignments bound to each invoice position:

Computed Properties

PropertyTypeDescription
displayNameStringReturns the position number as a string
isEmptyBooleanTrue if text is blank and einzelNetto is null or zero
isInfoInitializedBooleanTrue if the lateinit info has been initialized

Equality & HashCode

Equality is based on number and rechnungId (the parent invoice ID). The rechnungId is an abstract property implemented by concrete subclasses.

Design Notes

Git History

868d6abb7 2025 -> 2026
63081666f Source file headers: 2024-> 2025.
5f9bbfbd3 Fix typos in projectforge-business directory
197d60efa Finance: incoming invoices fixed.
ff2cc4cfa Migration stuff in progress... (all tests of all packages: OK).
ba2479571 Migration stuff in progress...
b47c21af6 Refactored caching and calculations with invoices (not yet finished)
4c04cfd65 MAJOR-CHANGE! Migration of integer id's to Long id's (including fk's etc.)
06828f490 Migration stuff in progress...
b6092df09 Copyright 2023 -> 2024
ab45d51fa Copyright 2001-2022 -> 2001-2023.
5f7ef41b8 Copyright 2021 -> 2022
a7fceb731 Some compiler warnings fixed.
ceb63e8a1 Source code header: (C) 2001-2021.
a1cf6f591 Code Cleanup
07cb34acb IRechnung, IRechnungsPosition introduced. DTOs fro Eingangsrechnung{sPosition}DO added.
552603f75 Rename setter methods in RechnungDO to avoid conflicts with Jackson
b78b870bd ShortDisplayNameCapable -> DisplayNameCapable.
7c79f1922 Copyright of source header -> 2020.
8241700f0 ShortDisplayNameCapable converted to Kotlin. DO classes implementing ShortDisplayNameCapable refactored.
7588a4be8 AbstractRechnungsPositionsDO.isEmpty fixed.
bc7b1761c Eingangsrechnungen: Kostzuweisungen fixed.
e63a1e98e AuftragsPositionDO: Bug fix KostZuweisungen handled now in update method.
8675a1dbe Found big performance issue: Declared all Kotlin JPA entities and their properties as open. Lazy loading wasn't supported by Hibernate...
483b8409d Heavy WIP: refactoring of (Eingangs)Rechnung*.
a55ef0c14 Heavy WIP: refactoring of (Eingangs)Rechnung*.
812b5b751 Heavy WIP: refactoring of (Eingangs)Rechnung*.
339e017b4 ElementRegistry: @PropertyInfo is now also supported for getter methods of read-only vals.
dd1dc1bef EingangsrechnungRest: Add position list to edit page
c9c80e385 AbstractRechnungsPositionDO.kt: Resolve warnings
f2b55f6aa RechnungsPositionDO.java -> RechnungsPositionDO.kt (initial Kotlin conversion)