git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/accounting/accounting-summary-access@169860 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
fc2fb78a66
commit
ec02210e55
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue