hot fix
This commit is contained in:
@@ -204,6 +204,7 @@ class FinancialService(
|
|||||||
isCategoryChanged: Boolean = false,
|
isCategoryChanged: Boolean = false,
|
||||||
isOldCategory: Boolean = false
|
isOldCategory: Boolean = false
|
||||||
): Double {
|
): Double {
|
||||||
|
return if (transaction.category.type.code == "EXPENSE") {
|
||||||
val sums = getBudgetSumsByCategory(transaction.category.id!!, budget)
|
val sums = getBudgetSumsByCategory(transaction.category.id!!, budget)
|
||||||
val categoryBudget = budget.categories.firstOrNull { it.category.id == transaction.category.id }
|
val categoryBudget = budget.categories.firstOrNull { it.category.id == transaction.category.id }
|
||||||
?: throw NotFoundException("Not found category in budget")
|
?: throw NotFoundException("Not found category in budget")
|
||||||
@@ -217,7 +218,8 @@ class FinancialService(
|
|||||||
} else categoryBudget.currentLimit += difference
|
} else categoryBudget.currentLimit += difference
|
||||||
}
|
}
|
||||||
budgetRepo.save(budget).awaitSingle()
|
budgetRepo.save(budget).awaitSingle()
|
||||||
return 1.0
|
1.0
|
||||||
|
} else 0.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user