Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Fix display Overdue transactions from previous month
Browse files Browse the repository at this point in the history
  • Loading branch information
ILIYANGERMANOV committed May 1, 2022
1 parent cba5055 commit 73154a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import com.ivy.wallet.domain.data.core.Transaction
import com.ivy.wallet.domain.pure.data.ClosedTimeRange
import com.ivy.wallet.domain.pure.data.IncomeExpensePair
import com.ivy.wallet.domain.pure.transaction.isOverdue
import com.ivy.wallet.utils.beginningOfIvyTime
import java.time.LocalDateTime
import javax.inject.Inject

class OverdueAct @Inject constructor(
Expand All @@ -14,7 +16,10 @@ class OverdueAct @Inject constructor(

override suspend fun Input.compose(): suspend () -> Output = suspend {
DueTrnsInfoAct.Input(
range = range,
range = ClosedTimeRange(
from = beginningOfIvyTime(),
to = toRange
),
baseCurrency = baseCurrency,
dueFilter = ::isOverdue
)
Expand All @@ -26,7 +31,7 @@ class OverdueAct @Inject constructor(
}

data class Input(
val range: ClosedTimeRange,
val toRange: LocalDateTime,
val baseCurrency: String
)

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/ivy/wallet/ui/home/HomeViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class HomeViewModel @Inject constructor(
updateState {
val result = overdueAct(
OverdueAct.Input(
range = timeRange,
toRange = timeRange.to,
baseCurrency = baseCurrency
)
)
Expand Down

0 comments on commit 73154a2

Please sign in to comment.