[Bug #1162] Fix issues in stretches function dedication chart
Chart was wrong calculated, as for each stretch it takes into account the day after to calculate the non workable days, so if a stretch ends in Friday it showed wrong values. FEA: ItEr75S04BugFixing
This commit is contained in:
parent
ad3e033ed8
commit
e3fe3f1a27
1 changed files with 10 additions and 7 deletions
|
|
@ -129,12 +129,13 @@ public abstract class GraphicForStreches implements IGraphicGenerator {
|
||||||
for (Stretch stretch : stretches) {
|
for (Stretch stretch : stretches) {
|
||||||
BigDecimal amountWork = stretch.getAmountWorkPercentage()
|
BigDecimal amountWork = stretch.getAmountWorkPercentage()
|
||||||
.subtract(previousPercentage).multiply(taskHours);
|
.subtract(previousPercentage).multiply(taskHours);
|
||||||
Integer days = Days.daysBetween(previousDate,
|
LocalDate endDate = stretch.getDateIn(allocation);
|
||||||
stretch.getDateIn(allocation)).getDays();
|
Integer days = Days.daysBetween(previousDate, endDate)
|
||||||
|
.getDays();
|
||||||
|
|
||||||
if (calendar != null) {
|
if (calendar != null) {
|
||||||
days -= calendar.getNonWorkableDays(previousDate,
|
days -= calendar.getNonWorkableDays(previousDate,
|
||||||
stretch.getDateIn(allocation)).size();
|
endDate.minusDays(1)).size();
|
||||||
}
|
}
|
||||||
|
|
||||||
BigDecimal hoursPerDay = BigDecimal.ZERO;
|
BigDecimal hoursPerDay = BigDecimal.ZERO;
|
||||||
|
|
@ -144,11 +145,13 @@ public abstract class GraphicForStreches implements IGraphicGenerator {
|
||||||
}
|
}
|
||||||
|
|
||||||
xymodel.addValue(title, previousDate.toDateTimeAtStartOfDay()
|
xymodel.addValue(title, previousDate.toDateTimeAtStartOfDay()
|
||||||
.getMillis() + 1, hoursPerDay);
|
.getMillis(), hoursPerDay);
|
||||||
xymodel.addValue(title, stretch.getDateIn(allocation)
|
if (days > 0) {
|
||||||
.toDateTimeAtStartOfDay().getMillis(), hoursPerDay);
|
xymodel.addValue(title, endDate.toDateTimeAtStartOfDay()
|
||||||
|
.getMillis() - 1, hoursPerDay);
|
||||||
|
}
|
||||||
|
|
||||||
previousDate = stretch.getDateIn(allocation);
|
previousDate = endDate;
|
||||||
previousPercentage = stretch.getAmountWorkPercentage();
|
previousPercentage = stretch.getAmountWorkPercentage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue