#948: IRechnung.kt

projectforge-business/src/main/kotlin/org/projectforge/business/fibu/IRechnung.kt Type: Interface · Purpose: Abstract contract for invoice-like objects used by RechnungCalculator · Source: projectforge-business/src/main/kotlin/org/projectforge/business/fibu/IRechnung.kt 35 lines · 7 code · 25 comments · 3 blank
Core interface needed by RechnungCalculator for polymorphic invoice calculations. Provides a unified API over outgoing invoices (RechnungDO) and incoming invoices (EingangsrechnungDO), exposing payment amount, positions, and currency.

Interface Design

PropertyTypeDescription
zahlBetragBigDecimal?Total payment amount (nullable)
positionenList?List of invoice positions
currencyString?ISO currency code (e.g. "EUR", "USD")

Implementors

Design Rationale

Introduced together with IRechnungsPosition to decouple the RechnungCalculator from concrete entity types. This allows the same calculation logic (net/gross sums, VAT, currency conversion) to operate on any invoice-like DTO without JPA entity dependencies. The currency field was added later to support multi-currency invoice processing.

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
4d4c6b449bCurrency field added to invoices (incoming and outgoing)
63081666f6Source file headers: 2024-> 2025.
b47c21af64Refactored caching and calculations with invoices (not yet finished)
b6092df092Copyright 2023 -> 2024
ab45d51fa4Copyright 2001-2022 -> 2001-2023.
2dc192b7a5AG grid: auto-format of currency, Formatter works now also with AG grid (rating, dates, timestamps). Currency rendering by client (Formatter.jsx) added.
5f7ef41b8cCopyright 2021 -> 2022
4c615b323aNothing real: compiler warnings fixed.
ceb63e8a1bSource code header: (C) 2001-2021.
07cb34acbaIRechnung, IRechnungsPosition introduced. DTOs fro Eingangsrechnung{sPosition}DO added.