Skip to content

Commit

Permalink
fix: stats_tab data ignoring when isPending is not present
Browse files Browse the repository at this point in the history
  • Loading branch information
sadespresso committed Nov 18, 2024
1 parent 84447dc commit cc66565
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
28 changes: 15 additions & 13 deletions lib/objectbox/actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,14 @@ extension MainActions on ObjectBox {
bool ignoreTransfers = true,
String? currencyOverride,
}) async {
final Condition<Transaction> dateFilter =
Transaction_.transactionDate.betweenDate(from, to);
final Condition<Transaction> dateFilter = Transaction_.transactionDate
.betweenDate(from, to)
.and(Transaction_.isPending
.isNull()
.or(Transaction_.isPending.notEquals(true)));

final Query<Transaction> transactionsQuery = ObjectBox()
.box<Transaction>()
.query(dateFilter.and(Transaction_.isPending.notEquals(true)))
.build();
final Query<Transaction> transactionsQuery =
ObjectBox().box<Transaction>().query(dateFilter).build();

final List<Transaction> transactions = await transactionsQuery.findAsync();

Expand Down Expand Up @@ -181,13 +182,14 @@ extension MainActions on ObjectBox {
bool omitZeroes = true,
String? currencyOverride,
}) async {
final Condition<Transaction> dateFilter =
Transaction_.transactionDate.betweenDate(from, to);

final Query<Transaction> transactionsQuery = ObjectBox()
.box<Transaction>()
.query(dateFilter.and(Transaction_.isPending.notEquals(true)))
.build();
final Condition<Transaction> dateFilter = Transaction_.transactionDate
.betweenDate(from, to)
.and(Transaction_.isPending
.isNull()
.or(Transaction_.isPending.notEquals(true)));

final Query<Transaction> transactionsQuery =
ObjectBox().box<Transaction>().query(dateFilter).build();

final List<Transaction> transactions = await transactionsQuery.findAsync();

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A personal finance managing app

publish_to: "none" # Remove this line if you wish to publish to pub.dev

version: "0.8.1+80"
version: "0.8.1+81"

environment:
sdk: ">=3.5.0 <4.0.0"
Expand Down

0 comments on commit cc66565

Please sign in to comment.