Class TimereportDay
java.lang.Object
ch.tocco.nice2.optional.timereport.impl.util.entities.TimereportDay
-
Constructor Summary
ConstructorDescriptionTimereportDay
(Entity timereportDay, TimereportService timereportService, Context context) TimereportDay
(Entity contract, org.joda.time.LocalDate date, Duration targetTime, Duration balance, TimereportService timereportService, Context context) -
Method Summary
Modifier and TypeMethodDescriptionorg.joda.time.LocalDate
getDate()
The method returns the day total for the Timereport_day.getSummaryString
(TextResources textResources) void
removeRecord
(TimereportRecord record) Remove a Timereport_record from the database.void
setBalance
(Duration balance) void
setTargetTime
(Duration targetTime) void
Update the balance for the timereport day.void
Update all the day totals for the Timereport_day.void
updateVacation
(Duration oldValue, Duration newValue) update the vacation balance
-
Constructor Details
-
TimereportDay
-
TimereportDay
public TimereportDay(Entity contract, org.joda.time.LocalDate date, Duration targetTime, Duration balance, TimereportService timereportService, Context context)
-
-
Method Details
-
getBalance
-
setBalance
-
setTargetTime
-
getTargetTime
-
getDate
public org.joda.time.LocalDate getDate() -
updateBalance
public void updateBalance()Update the balance for the timereport day. The method also updates all the subsequent timereport days' balance. -
updateVacation
update the vacation balance- Parameters:
oldValue
- the old day_total_vacation valuenewValue
- the new day_total_vacation value
-
updateDayTotals
public void updateDayTotals()Update all the day totals for the Timereport_day. The method completely recomputes all the values and writes the results to the database -
getDayTotal
The method returns the day total for the Timereport_day. It does however not recompute the day totals. UseupdateDayTotals()
if you're not sure that there are no changes on the db- Returns:
- the day total for the Timereport_day, i.e. day_total_productive + day_total_unproductive
-
getDayTotalProductive
-
getDayTotalUnproductive
-
removeRecord
Remove a Timereport_record from the database. The removal causes day totals to recompute- Parameters:
record
- the Timereport_record to be removed
-
getDayTotalVacation
-
getContract
-
getSummaryString
-