-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MonthlyEmployeeReport: show weekly net and gross hours.
Fix select in AuftragDao.positionen.status Scripting: Add PFCaches as variable. GlobalDefaultExceptionHandling: Exception handling improved.
- Loading branch information
Showing
10 changed files
with
139 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 0 additions & 106 deletions
106
...rge-business/src/main/java/org/projectforge/business/fibu/MonthlyEmployeeReportEntry.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
...rge-business/src/main/kotlin/org/projectforge/business/fibu/MonthlyEmployeeReportEntry.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
//////////////////////////////////////////////////////////////////////////// | ||
// Project ProjectForge Community Edition | ||
// www.projectforge.org | ||
// | ||
// Copyright (C) 2001-2025 Micromata GmbH, Germany (www.micromata.com) | ||
// | ||
// ProjectForge is dual-licensed. | ||
// | ||
// This community edition is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU General Public License as published | ||
// by the Free Software Foundation; version 3 of the License. | ||
// | ||
// This community edition is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
// Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License along | ||
// with this program; if not, see http://www.gnu.org/licenses/. | ||
// | ||
////////////////////////////////////////////////////////////////////////// | ||
|
||
package org.projectforge.business.fibu | ||
|
||
import org.projectforge.business.PfCaches.Companion.instance | ||
import org.projectforge.business.fibu.kost.Kost2DO | ||
import org.projectforge.business.task.TaskDO | ||
import java.io.Serializable | ||
import java.math.BigDecimal | ||
|
||
/** | ||
* Repräsentiert einen Eintrag innerhalb eines Wochenberichts eines Mitarbeiters zu einem Kostenträger (Anzahl Stunden). | ||
* @author Kai Reinhard ([email protected]) | ||
*/ | ||
class MonthlyEmployeeReportEntry : Serializable { | ||
/** | ||
* Only given, if task is not given and vice versa. | ||
*/ | ||
var kost2: Kost2DO? = null | ||
private set | ||
|
||
/** | ||
* Only given, if kost2 is not given and vice versa. | ||
*/ | ||
var task: TaskDO? = null | ||
private set | ||
|
||
var millis: Long = 0 | ||
private set | ||
|
||
constructor(kost2: Kost2DO?) { | ||
this.kost2 = kost2 | ||
} | ||
|
||
constructor(task: TaskDO?) { | ||
this.task = task | ||
} | ||
|
||
fun addMillis(millis: Long) { | ||
this.millis += millis | ||
} | ||
|
||
/** | ||
* If this entry has a kost2 with a working time fraction set or a kost2art with a working time fraction set then the fraction of millis | ||
* will be returned. | ||
*/ | ||
val workFractionMillis: Long | ||
get() = workFraction.multiply(millis.toBigDecimal()).toLong() | ||
|
||
val workFraction: BigDecimal | ||
get() { | ||
val useKost2 = instance.getKost2IfNotInitialized(kost2) ?: return BigDecimal.ONE | ||
useKost2.workFraction?.let { | ||
return it | ||
} | ||
return instance.getKost2ArtIfNotInitialized(useKost2.kost2Art)?.workFraction ?: BigDecimal.ONE | ||
} | ||
|
||
val formattedDuration: String | ||
get() = MonthlyEmployeeReport.getFormattedDuration(millis) | ||
|
||
companion object { | ||
private const val serialVersionUID = 7290000602224467755L | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.