Skip to content

Commit

Permalink
hide sold assets if they are not sold within the selected interval
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgunozerk committed Feb 5, 2024
1 parent ca46478 commit 6dd6d9a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/controllers/report_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ class ReportController extends GetxController {
.typeMap
.entries
.expand((typeEntry) => typeEntry.value.entries
// find the sold assets and get their report
.where((assetEntry) => assetEntry.value.amount == 0)
.map((assetEntry) {
AssetType assetType = typeEntry.key;
Expand All @@ -359,6 +360,9 @@ class ReportController extends GetxController {

return AssetItem(assetId, assetReport, category, assetType);
}))
.where((assetItem) =>
// if the asset is sold long before the selected interval, no need to display it
assetItem.report.startValue != 0 || assetItem.report.deposit != 0)
.toList();
}

Expand Down

0 comments on commit 6dd6d9a

Please sign in to comment.