AbstractRechnungsStatistik.ktAbstract statistics calculator for invoices. Aggregates financial metrics across a collection of invoices (outgoing or incoming): gross (brutto), net (netto), with cash discount (bruttoMitSkonto), paid (gezahlt), open (offen), overdue (ueberfaellig), and cash discount amounts (skonto). Also tracks payment term averages and provides Markdown-formatted output for Wicket UI display. Supports multi-currency conversion with warning tracking.
T : AbstractRechnungDO? — The concrete invoice type (e.g., RechnungDO or EingangsrechnungDO).
| Property | Type | Description |
|---|---|---|
brutto | BigDecimal | Total gross sum across all invoices |
netto | BigDecimal | Total net sum |
bruttoMitSkonto | BigDecimal | Total gross with discount applied |
gezahlt | BigDecimal | Total amount paid |
offen | BigDecimal | Total outstanding (not yet paid) |
ueberfaellig | BigDecimal | Total overdue amount |
skonto | BigDecimal | Accepted shortfall (discounts granted by customer) |
counter | Int | Total number of invoices counted |
counterBezahlt | Int | Number of fully paid invoices |
add(rechnung: T)The primary entry point. For each invoice added:
rechnungCache.getRechnungInfo(rechnung)currencyConversionService.convert()currencyConversionWarnings and the original (unconverted) amount is used as fallbackskonto) when paid amount is less than grosszahlungsZielSum) and actual (tatsaechlichesZahlungsZiel)rechnungInfo.isUeberfaelligThe private convertToSystemCurrency() method handles multi-currency scenarios:
useFallbackToOldestRate = true for historical invoices where an exact exchange rate may not exist"invoiceRef (date): USD → EUR"| Property | Type | Description |
|---|---|---|
zahlungszielAverage | Int | Average contractual payment term in days |
tatsaechlichesZahlungzielAverage | Int | Weighted average actual payment duration in days |
asMarkdown | String | Markdown table with all financial metrics, colored for open (blue) and overdue (red) amounts |
hasCurrencyConversionWarnings | Boolean | True if any currency conversion failures occurred |
currencyConversionWarningsList | List<String> | List of warning messages for Wicket display |