java.lang.Object
ch.tocco.nice2.optional.timereport.impl.util.entities.Contract

public class Contract extends Object
Java representation for Contract Entity for convenience.
  • Constructor Details

  • Method Details

    • getContractTargetTime

      public Duration getContractTargetTime(org.joda.time.LocalDate date) throws PersistException
      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

      public Duration getSchemaTargetTime(org.joda.time.LocalDate date) throws PersistException
      Throws:
      PersistException
    • getSchemaTargetTime

      public Duration getSchemaTargetTime() throws PersistException
      Throws:
      PersistException
    • getSchemaVacationTime

      public Duration getSchemaVacationTime() throws PersistException
      Throws:
      PersistException
    • getAllCalendars

      public List<Calendar> getAllCalendars() throws PersistException
      Throws:
      PersistException
    • getWorkloadForYear

      public double getWorkloadForYear(int year) throws PersistException
      Throws:
      PersistException
    • getTargetTime

      public Duration getTargetTime() throws PersistException
      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

      public Duration getBalanceCorrection() throws PersistException
      Throws:
      PersistException
    • getVacationBalanceCorrection

      public Duration getVacationBalanceCorrection() throws PersistException
      Throws:
      PersistException
    • getFromDate

      public org.joda.time.LocalDate getFromDate() throws PersistException
      Throws:
      PersistException
    • getUntilDate

      @Nullable public @Nullable org.joda.time.LocalDate getUntilDate() throws PersistException
      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] where days is the system property defining the amount of days to generate Timereport_day entities into the future and first, 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

      public EntityList getTimereportDayEntityList()
    • updateVacationTime

      public void updateVacationTime()
    • getOrCreateVacationTime

      public VacationTime getOrCreateVacationTime(int year)
      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

      public VacationTime[] getAllVacationTime(@Nullable @Nullable Integer year)
    • getVacationBalanceToDate

      public Duration getVacationBalanceToDate(Integer year)
    • durationInDays

      public Double durationInDays(Duration duration)
    • durationIn100PcDays

      public Double durationIn100PcDays(Duration duration)
    • getVacationBalance

      public Duration getVacationBalance(int year)
    • getContract

      public Entity getContract()
    • getWorkload

      public Double getWorkload() throws PersistException
      Throws:
      PersistException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getIdNumber

      public long getIdNumber(EntityList contractList)