Skip to content

Firefly III: a personal finances manager

Remove unused method.

James Coleb2997d0a5aa6
diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.php
index 0413b989e2..2514d06ca7 100644
--- a/app/Repositories/PiggyBank/PiggyBankRepository.php
+++ b/app/Repositories/PiggyBank/PiggyBankRepository.php
@@ -342,33 +342,6 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface, UserGroupInte
return $piggyBank->piggyBankRepetitions()->first();
}
- /**
- * Returns the suggested amount the user should save per month, or "".
- */
- public function getSuggestedMonthlyAmount(PiggyBank $piggyBank): string
- {
- $savePerMonth = '0';
- $currentAmount = $this->getCurrentAmount($piggyBank);
- if (null !== $piggyBank->target_date && $currentAmount < $piggyBank->target_amount) {
- $now = today(config('app.timezone'));
- $startDate = null !== $piggyBank->start_date && $piggyBank->start_date->gte($now) ? $piggyBank->start_date : $now;
- $diffInMonths = (int) $startDate->diffInMonths($piggyBank->target_date);
- $remainingAmount = bcsub((string) $piggyBank->target_amount, $currentAmount);
-
- // more than 1 month to go and still need money to save:
- if ($diffInMonths > 0 && 1 === bccomp($remainingAmount, '0')) {
- $savePerMonth = bcdiv($remainingAmount, (string) $diffInMonths);
- }
-
- // less than 1 month to go but still need money to save:
- if (0 === $diffInMonths && 1 === bccomp($remainingAmount, '0')) {
- $savePerMonth = $remainingAmount;
- }
- }
-
- return $savePerMonth;
- }
-
/**
* Get for piggy account what is left to put in piggies.
*/
diff --git a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php
index bdcd9d138e..6134354fb0 100644
--- a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php
+++ b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php
@@ -111,11 +111,6 @@ interface PiggyBankRepositoryInterface
public function getRepetition(PiggyBank $piggyBank, bool $overrule = false): ?PiggyBankRepetition;
- /**
- * Returns the suggested amount the user should save per month, or "".
- */
- public function getSuggestedMonthlyAmount(PiggyBank $piggyBank): string;
-
/**
* Get for piggy account what is left to put in piggies.
*/
diff --git a/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php b/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php
index 24f4663e7f..dd6a74129b 100644
--- a/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php
+++ b/app/Support/JsonApi/Enrichments/PiggyBankEnrichment.php
@@ -296,7 +296,6 @@ class PiggyBankEnrichment implements EnrichmentInterface
/**
* Returns the suggested amount the user should save per month, or "".
- * TODO same as in repository.
*/
private function getSuggestedMonthlyAmount(?Carbon $startDate, ?Carbon $targetDate, ?string $targetAmount, string $currentAmount): string
{