bugfix for budgets
This commit is contained in:
@@ -21,12 +21,12 @@ public interface CategoryRepository extends PagingAndSortingRepository<Category,
|
||||
|
||||
// http://localhost:8084/api/categories/search/expenseLevelYear?accountId=1&categoryId=1
|
||||
@RestResource(path = "expenseLevelYear")
|
||||
@Query("SELECT sum(t.amount) FROM Transaction t WHERE t.account.id = :accountId AND t.category.id = :categoryId and DATE > (CURRENT_DATE() - DAY_OF_YEAR(CURRENT_DATE()))")
|
||||
@Query("SELECT sum(t.amount) FROM Transaction t WHERE t.account.id = :accountId AND t.category.id = :categoryId and DATE > (CURRENT_DATE() - DAY_OF_YEAR(CURRENT_DATE()) + 1)")
|
||||
Double getYearExpenseLevelForCategory(@Param("accountId") Long accountId, @Param("categoryId") Long categoryId);
|
||||
|
||||
// http://localhost:8084/api/categories/search/expenseLevelMonth?accountId=2&categoryId=5
|
||||
@RestResource(path = "expenseLevelMonth")
|
||||
@Query("SELECT sum(t.amount) FROM Transaction t WHERE t.account.id = :accountId AND t.category.id = :categoryId and DATE > (CURRENT_DATE() - DAY_OF_MONTH(CURRENT_DATE()))")
|
||||
@Query("SELECT sum(t.amount) FROM Transaction t WHERE t.account.id = :accountId AND t.category.id = :categoryId and DATE > (CURRENT_DATE() - DAY_OF_MONTH(CURRENT_DATE()) + 1)")
|
||||
Double getMonthExpenseLevelForCategory(@Param("accountId") Long accountId, @Param("categoryId") Long categoryId);
|
||||
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
||||
|
||||
Reference in New Issue
Block a user