Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
praslnx8 committed Mar 30, 2024
1 parent a643a29 commit 82e9d27
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions lib/domain/models/investment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,18 @@ class Investment {
final value = this.value;
final irr = this.irr;
if (value != null) {
final payments = getPayments(till: DateTime.now());
final paymentTillNow = getPayments(till: DateTime.now());
final totalPayments = getPayments(
till: futureDate, considerFuturePayments: considerFuturePayments);
final irr = IRRCalculator().calculateIRR(
payments: payments, value: value, valueUpdatedOn: DateTime.now());
return IRRCalculator().calculateValueOnIRR(
irr: irr,
futureDate: futureDate,
currentValue: value,
currentValueUpdatedOn: DateTime.now());
payments: paymentTillNow,
value: value,
valueUpdatedOn: DateTime.now());
return IRRCalculator().calculateFutureValueOnIRR(
irr: irr,
payments: totalPayments,
futureDate: futureDate,
);
} else if (irr != null) {
final payments = getPayments(
till: futureDate, considerFuturePayments: considerFuturePayments);
Expand Down

0 comments on commit 82e9d27

Please sign in to comment.