Class Contract
java.lang.Object
ch.tocco.nice2.optional.timereport.impl.util.entities.Contract
Java representation for
Contract
Entity for convenience.-
Constructor Summary
ConstructorDescriptionContract
(Entity contract, TimereportService timereportService, Context context) -
Method Summary
Modifier and TypeMethodDescriptiondurationIn100PcDays
(Duration duration) durationInDays
(Duration duration) getAllVacationTime
(@Nullable Integer year) getContractTargetTime
(org.joda.time.LocalDate date) The method takes calendars attached to the Timereport_scheme into accountorg.joda.time.LocalDate
long
getIdNumber
(EntityList contractList) getOrCreateVacationTime
(int year) Get a Vacation_time entity for the specified date (year) or create a new onegetSchemaTargetTime
(org.joda.time.LocalDate date) Get the contract's target time.@Nullable org.joda.time.LocalDate
getVacationBalance
(int year) double
getWorkloadForYear
(int year) void
setDirty
(boolean dirty) toString()
void
updateTimereportDays
(org.joda.time.LocalDate endDate) Method used in TimereportDayGeneratorBatchJob.void
-
Constructor Details
-
Contract
-
-
Method Details
-
getContractTargetTime
The method takes calendars attached to the Timereport_scheme into account- Parameters:
date
- date to get the target time for- Returns:
- target time for a specific date
- Throws:
PersistException
- -
-
getSchemaTargetTime
- Throws:
PersistException
-
getSchemaTargetTime
- Throws:
PersistException
-
getSchemaVacationTime
- Throws:
PersistException
-
getAllCalendars
- Throws:
PersistException
-
getWorkloadForYear
- Throws:
PersistException
-
getTargetTime
Get the contract's target time. It depends on the Timereport_scheme's target time and the Contract's workload- Returns:
- the target time
- Throws:
PersistException
- -
-
getBalanceCorrection
- Throws:
PersistException
-
getVacationBalanceCorrection
- Throws:
PersistException
-
getFromDate
- Throws:
PersistException
-
getUntilDate
- Throws:
PersistException
-
setDirty
public void setDirty(boolean dirty) -
updateTimereportDays
public void updateTimereportDays(org.joda.time.LocalDate endDate) Method used in TimereportDayGeneratorBatchJob. The method creates Timereport_day entities for a contract in the timeframe[valid_from, today + days] ∪ [first, last]
wheredays
is the system property defining the amount of days to generate Timereport_day entities into the future andfirst
,last
is the first and last date of existing Timereport_days (these dates may vary from the contract validity dates after these dates have been modified). -
getTimereportDayEntityList
-
updateVacationTime
public void updateVacationTime() -
getOrCreateVacationTime
Get a Vacation_time entity for the specified date (year) or create a new one- Parameters:
year
- year- Returns:
- Vacation_time entity for the specified date (year)
-
getAllVacationTime
-
getVacationBalanceToDate
-
durationInDays
-
durationIn100PcDays
-
getVacationBalance
-
getContract
-
getWorkload
- Throws:
PersistException
-
toString
-
getIdNumber
-