Skip to content

Commit

Permalink
statement total api 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
onaries committed Jun 24, 2024
1 parent da15bba commit 5112d29
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,7 @@ async def get_statement_total(mode: int, date: date, db: Session = Depends(get_d
.filter(extract("year", Statement.date) == date.year)
.filter(extract("month", Statement.date) == date.month)
.filter(and_(Statement.category_id == 57, Statement.category_id == 58))
.first()
)

discount_sum = (
Expand All @@ -1029,7 +1030,7 @@ async def get_statement_total(mode: int, date: date, db: Session = Depends(get_d
data.expense = i[1]
data.expense_saving = i[2]
elif i[0] == 3:
data.saving = i[1] + expense_saving_sum
data.saving = i[1] + expense_saving_sum[0]

data.discount = discount_sum[0] if discount_sum[0] else 0

Expand Down

0 comments on commit 5112d29

Please sign in to comment.