Commit 5e61ab81 authored by seykron's avatar seykron

Closes #29: fixes error when the required balance is in the future

parent 5314f39a
......@@ -105,11 +105,6 @@ class BalanceService(
.withTimeAtStartOfDay()
.withZone(DateTimeZone.UTC)
require(year <= currentDate.year &&
month <= currentDate.monthOfYear) {
"The required date must not be in the future"
}
val balance: Balance = Balance.new(
previousSignature = blockSignatureDAO.lastSignature(account.id),
account = account,
......@@ -121,7 +116,7 @@ class BalanceService(
)
return balanceDAO.getByPeriod(account.id, from, to) ?:
if (currentDate.year == year && currentDate.monthOfYear == month)
if (year >= currentDate.year && month >= currentDate.monthOfYear)
// Current month.
balance
else
......
package be.rlab.domino.domain.persistence
import be.rlab.domino.domain.model.Account
import be.rlab.domino.domain.model.Balance
import be.rlab.domino.util.persistence.AbstractEntityClass
import org.jetbrains.exposed.dao.EntityID
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment