feat: show report on payment method
All checks were successful
Deploy / build-and-deploy (push) Successful in 2m37s
All checks were successful
Deploy / build-and-deploy (push) Successful in 2m37s
This commit is contained in:
parent
b5295d1c73
commit
047e392ac3
4 changed files with 70 additions and 0 deletions
|
|
@ -61,6 +61,11 @@ func (s *ReportService) GetSpendingReport(spaceID string, from, to time.Time) (*
|
|||
}
|
||||
}
|
||||
|
||||
byPaymentMethod, err := s.expenseRepo.GetExpensesByPaymentMethod(spaceID, from, to)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
totalIncome, totalExpenses, err := s.expenseRepo.GetIncomeVsExpenseSummary(spaceID, from, to)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -68,6 +73,7 @@ func (s *ReportService) GetSpendingReport(spaceID string, from, to time.Time) (*
|
|||
|
||||
return &model.SpendingReport{
|
||||
ByTag: byTag,
|
||||
ByPaymentMethod: byPaymentMethod,
|
||||
DailySpending: daily,
|
||||
MonthlySpending: monthly,
|
||||
TopExpenses: topWithTags,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue