#894: AuftragFilter.kt

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

Type: Search filter class

Package: org.projectforge.business.fibu

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

201 lines · 135 code · 45 comments · 21 blank

Main search filter for the order book (Auftragsbuch). Extends BaseSearchFilter, implements Serializable and SearchFilterWithPeriodOfPerformance. Supports filtering orders by user assignment, date ranges, period of performance, order status, position type (AuftragsPositionsArt), position payment type, invoiced status, and project membership. Used both by the backend DAO for database queries and by the frontend for programmatic result filtering via match().

Class Definition

@XStreamAlias("AuftragFilter")
class AuftragFilter @JvmOverloads constructor(filter: BaseSearchFilter? = null) : BaseSearchFilter(filter),
    Serializable, SearchFilterWithPeriodOfPerformance

Filter Properties

PropertyTypeDefaultDescription
userPFUserDO?nullFilter by assigned user (project manager, head of business, sales manager, or contact person)
startDateLocalDate?nullFilter by creation date (from)
endDateLocalDate?nullFilter by creation date (to)
periodOfPerformanceStartDateLocalDate?nullPeriod of performance lower bound
periodOfPerformanceEndDateLocalDate?nullPeriod of performance upper bound
auftragsStatusesMutableList<AuftragsStatus>emptyFilter by order/position status values
auftragsPositionsArtenArrayList<AuftragsPositionsArt>emptyFilter by position type categories
auftragFakturiertFilterStatusAuftragFakturiertFilterStatus?ALLFilter by invoiced status (ALL / ZU_FAKTURIEREN / FAKTURIERT / NICHT_FAKTURIERT)
auftragsPositionsPaymentTypeAuftragsPositionsPaymentType?nullFilter by position payment type (null = all)
projectListCollection<ProjektDO>?nullFilter by project membership

Match Methods (Programmatic Filtering)

match(auftrag): Boolean

Checks if an order passes all active filters. Evaluates in order:

  1. matchUser — user assignment
  2. Creation date range (erfassungsDatum against startDate/endDate)
  3. Period of performance overlap
  4. matchProjectList — project membership
  5. matchAuftragsStatus — status matching
  6. matchAuftragsPositionsArten — position type matching

Short-circuits: returns false immediately on the first non-matching criterion.

matchUser(auftrag): Boolean

Returns true if the filter's user is null, or if the user's ID matches any of: projectManager.id, headOfBusinessManager.id, contactPerson.id, or salesManager.id.

matchProjectList(auftrag): Boolean

Returns true if projectList is null or empty, or if the order's projekt.id is found in the list.

matchAuftragsStatus(auftrag): Boolean

Returns true if auftragsStatuses is empty, or if the order's status matches, or if any non-deleted position's status matches.

matchAuftragsPositionsArten(auftrag): Boolean

Returns true if auftragsPositionsArten is empty, or if any non-deleted position has a matching art.

Invoiced Status Filtering

filterFakturiert(list): List<AuftragDO> — Filters a result list by invoiced status using AuftragsCache:

StatusCondition
ALL or nullNo filtering
ZU_FAKTURIERENorderInfo.toBeInvoiced == true
FAKTURIERTorderInfo.isVollstaendigFakturiert == true
NICHT_FAKTURIERTorderInfo.notYetInvoicedSum > BigDecimal.ZERO

Reset

reset() clears all filter fields and returns this for fluent chaining.

Git History

868d6abb7 2025 -> 2026
26f08992e WIP: order forecast and snapshots.
7b32b554a WIP: Forecast of orders... AuftragFilter refactored.
63081666f Source file headers: 2024-> 2025.
9c633d4ce AuftragDao/AuftragFilter: to-be-invoiced and fully-invoiced fixed.
9aff90908 Migration stuff in progress...
3f25c773a Migration stuff in progress...
67ce75fe9 Migration stuff in progress...
fba4da3f5 ForecastExport now usable for scripts. AuftragFilter.projectList added...
b6092df09 Copyright 2023 -> 2024
ab45d51fa Copyright 2001-2022 -> 2001-2023.
9a65e1bc0 AuftragDO: statistics refactored (not yet invoiced, to be invoiced, invoiced etc.)
013c514bd AuftragsCache for much better performance of order book's list view.
9ec78f80a AuftragDO/AuftragFilter: ignore deleted positions and payment Schedules for orders to be invoiced.
5f7ef41b8 Copyright 2021 -> 2022
ceb63e8a1 Source code header: (C) 2001-2021.
d89920003 Order book filter "to be invoiced" added.
78b436d9e Replace instances of java.util.date and java.sql.Date with java.time.LocalDate
7c79f1922 Copyright of source header -> 2020.
b0a4e8463 tidy up
9448cfc6e AuftragDao: JPA
706ed61a0 AuftragDao -> JPA
bf525ef55 AuftragFilter.java -> Kotlin

#894: AuftragFilter.kt

Type: Search filter class

Package: org.projectforge.business.fibu

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

Main search filter for the order book (Auftragsbuch). Extends BaseSearchFilter, implements Serializable and SearchFilterWithPeriodOfPerformance. Supports filtering orders by user assignment, date ranges, period of performance, order status, position type (AuftragsPositionsArt), position payment type, invoiced status, and project membership. Used both by the backend DAO for database queries and by the frontend for programmatic result filtering via match().

Class Definition

@XStreamAlias("AuftragFilter")
class AuftragFilter @JvmOverloads constructor(filter: BaseSearchFilter? = null) : BaseSearchFilter(filter),
    Serializable, SearchFilterWithPeriodOfPerformance

Filter Properties

PropertyTypeDefaultDescription
userPFUserDO?nullFilter by assigned user (project manager, head of business, sales manager, or contact person)
startDateLocalDate?nullFilter by creation date (from)
endDateLocalDate?nullFilter by creation date (to)
periodOfPerformanceStartDateLocalDate?nullPeriod of performance lower bound
periodOfPerformanceEndDateLocalDate?nullPeriod of performance upper bound
auftragsStatusesMutableList<AuftragsStatus>emptyFilter by order/position status values
auftragsPositionsArtenArrayList<AuftragsPositionsArt>emptyFilter by position type categories
auftragFakturiertFilterStatusAuftragFakturiertFilterStatus?ALLFilter by invoiced status (ALL / ZU_FAKTURIEREN / FAKTURIERT / NICHT_FAKTURIERT)
auftragsPositionsPaymentTypeAuftragsPositionsPaymentType?nullFilter by position payment type (null = all)
projectListCollection<ProjektDO>?nullFilter by project membership

Match Methods (Programmatic Filtering)

match(auftrag): Boolean

Checks if an order passes all active filters. Evaluates in order:

  1. matchUser — user assignment
  2. Creation date range (erfassungsDatum against startDate/endDate)
  3. Period of performance overlap
  4. matchProjectList — project membership
  5. matchAuftragsStatus — status matching
  6. matchAuftragsPositionsArten — position type matching

Short-circuits: returns false immediately on the first non-matching criterion.

matchUser(auftrag): Boolean

Returns true if the filter's user is null, or if the user's ID matches any of: projectManager.id, headOfBusinessManager.id, contactPerson.id, or salesManager.id.

matchProjectList(auftrag): Boolean

Returns true if projectList is null or empty, or if the order's projekt.id is found in the list.

matchAuftragsStatus(auftrag): Boolean

Returns true if auftragsStatuses is empty, or if the order's status matches, or if any non-deleted position's status matches.

matchAuftragsPositionsArten(auftrag): Boolean

Returns true if auftragsPositionsArten is empty, or if any non-deleted position has a matching art.

Invoiced Status Filtering

filterFakturiert(list): List<AuftragDO> — Filters a result list by invoiced status using AuftragsCache:

StatusCondition
ALL or nullNo filtering
ZU_FAKTURIERENorderInfo.toBeInvoiced == true
FAKTURIERTorderInfo.isVollstaendigFakturiert == true
NICHT_FAKTURIERTorderInfo.notYetInvoicedSum > BigDecimal.ZERO

Reset

reset() clears all filter fields and returns this for fluent chaining.

Git History

868d6abb7 2025 -> 2026
26f08992e WIP: order forecast and snapshots.
7b32b554a WIP: Forecast of orders... AuftragFilter refactored.
63081666f Source file headers: 2024-> 2025.
9c633d4ce AuftragDao/AuftragFilter: to-be-invoiced and fully-invoiced fixed.
9aff90908 Migration stuff in progress...
3f25c773a Migration stuff in progress...
67ce75fe9 Migration stuff in progress...
fba4da3f5 ForecastExport now usable for scripts. AuftragFilter.projectList added...
b6092df09 Copyright 2023 -> 2024
ab45d51fa Copyright 2001-2022 -> 2001-2023.
9a65e1bc0 AuftragDO: statistics refactored (not yet invoiced, to be invoiced, invoiced etc.)
013c514bd AuftragsCache for much better performance of order book's list view.
9ec78f80a AuftragDO/AuftragFilter: ignore deleted positions and payment Schedules for orders to be invoiced.
5f7ef41b8 Copyright 2021 -> 2022
ceb63e8a1 Source code header: (C) 2001-2021.
d89920003 Order book filter "to be invoiced" added.
78b436d9e Replace instances of java.util.date and java.sql.Date with java.time.LocalDate
7c79f1922 Copyright of source header -> 2020.
b0a4e8463 tidy up
9448cfc6e AuftragDao: JPA
706ed61a0 AuftragDao -> JPA
bf525ef55 AuftragFilter.java -> Kotlin