#949: IRechnungsPosition.kt

projectforge-business/src/main/kotlin/org/projectforge/business/fibu/IRechnungsPosition.kt Type: Interface · Purpose: Abstract contract for invoice position items used by RechnungCalculator · Source: projectforge-business/src/main/kotlin/org/projectforge/business/fibu/IRechnungsPosition.kt 34 lines · 9 code · 22 comments · 3 blank
Core interface defining the contract for individual line items within an invoice. Works in tandem with IRechnung to decouple the invoice calculation engine from concrete JPA entity types.

Interface Design

PropertyTypeDescription
idLong?Database identifier (nullable for new positions)
deletedBooleanSoft-delete flag
mengeBigDecimal?Quantity of the line item
einzelNettoBigDecimal?Net unit price of a single item
vatBigDecimal?VAT rate as percentage (e.g. 19.00)

Implementors

Design Rationale

Introduced alongside IRechnung (commit 07cb34acb) to enable RechnungCalculator to compute net/gross totals, VAT amounts, and cost summaries without depending on concrete entity types. The deleted property allows the calculator to skip soft-deleted positions. Using BigDecimal for financial amounts ensures precision (no floating-point errors).

Architecture Analysis

Resides in projectforge-business, the core module containing domain logic, services, and persistence. Defines a contract/interface that multiple implementations can satisfy, enabling polymorphic behavior and testability.

Git History

CommitWhat changed
868d6abb752025 -> 2026
63081666f6Source file headers: 2024-> 2025.
b47c21af64Refactored caching and calculations with invoices (not yet finished)
41b5c26459Migration stuff in progress...
b6092df092Copyright 2023 -> 2024
ab45d51fa4Copyright 2001-2022 -> 2001-2023.
5f7ef41b8cCopyright 2021 -> 2022
ceb63e8a1bSource code header: (C) 2001-2021.
07cb34acbaIRechnung, IRechnungsPosition introduced. DTOs fro Eingangsrechnung{sPosition}DO added.