diff --git a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaBalanceCmd.java b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaBalanceCmd.java index edfce72fe08..18e56b54291 100644 --- a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaBalanceCmd.java +++ b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaBalanceCmd.java @@ -112,7 +112,7 @@ public class QuotaBalanceCmd extends BaseCmd { @Override public long getEntityOwnerId() { - Long accountId = _accountService.finalyzeAccountId(accountName, domainId, null, true); + Long accountId = _accountService.getActiveAccountByName(accountName, domainId).getAccountId(); if (accountId == null) { return CallContext.current().getCallingAccount().getId(); } diff --git a/plugins/database/quota/src/org/apache/cloudstack/quota/QuotaServiceImpl.java b/plugins/database/quota/src/org/apache/cloudstack/quota/QuotaServiceImpl.java index 30069dcb190..be0935a0702 100644 --- a/plugins/database/quota/src/org/apache/cloudstack/quota/QuotaServiceImpl.java +++ b/plugins/database/quota/src/org/apache/cloudstack/quota/QuotaServiceImpl.java @@ -174,7 +174,7 @@ public class QuotaServiceImpl extends ManagerBase implements QuotaService, Confi } else if (endDate.after(startOfNextDay(new Date()))) { throw new InvalidParameterValueException("Incorrect Date Range. End date:" + endDate + " should not be in future. "); } else if (startDate.before(endDate)) { - Date adjustedEndDate = startOfNextDay(endDate); + Date adjustedEndDate = computeAdjustedTime(startOfNextDay(endDate)); s_logger.debug("Getting quota balance records for account: " + accountId + ", domainId: " + domainId + ", between " + adjustedStartDate + " and " + adjustedEndDate); List qbrecords = _quotaBalanceDao.findQuotaBalance(accountId, domainId, adjustedStartDate, adjustedEndDate); s_logger.info("Found records size=" + qbrecords.size());