diff --git a/src/main/java/org/gcube/accounting/accounting/summary/access/impl/AccountingDaoImpl.java b/src/main/java/org/gcube/accounting/accounting/summary/access/impl/AccountingDaoImpl.java index 683db2a..ae15c8d 100644 --- a/src/main/java/org/gcube/accounting/accounting/summary/access/impl/AccountingDaoImpl.java +++ b/src/main/java/org/gcube/accounting/accounting/summary/access/impl/AccountingDaoImpl.java @@ -67,12 +67,12 @@ public class AccountingDaoImpl implements AccountingDao{ if(fromDate.isAfter(toDate)) throw new ParameterException("Irregular time interval: \"From\" parameter cannot be after \"To\" parameter."); int timeSlices=getRangeSize(fromDate, toDate, resolution); - if(timeSlices==0) { - log.debug("Time slices is {}. Going to increment \"To\" parameter.",timeSlices); - toDate=increment(toDate,resolution,1); - timeSlices=getRangeSize(fromDate, toDate, resolution); - if(timeSlices==0) throw new RuntimeException("Unexpected Exception"); - } +// if(timeSlices==0) { +// log.debug("Time slices is {}. Going to increment \"To\" parameter.",timeSlices); +// toDate=increment(toDate,resolution,1); +// timeSlices=getRangeSize(fromDate, toDate, resolution); +// if(timeSlices==0) throw new RuntimeException("Unexpected Exception"); +// } Connection conn=connectionManager.getConnection(); @@ -245,7 +245,7 @@ public class AccountingDaoImpl implements AccountingDao{ Period p=Period.between(from.toLocalDate(), to.toLocalDate()); switch(resolution) { - case MONTHLY : return p.getMonths()+(p.getYears()*12); + case MONTHLY : return p.getMonths()+(p.getYears()*12)+1; // +1 to include upper bound default : throw new ParameterException("Invalid resolution "+resolution); }