This commit is contained in:
James Cole
2025-10-03 05:24:24 +02:00
parent 354bbebbee
commit e55af7186c
2 changed files with 13 additions and 4 deletions

View File

@@ -57,10 +57,12 @@ class PiggyBankEnrichment implements EnrichmentInterface
private readonly TransactionCurrency $primaryCurrency;
private User $user;
private UserGroup $userGroup;
private ?Carbon $date;
public function __construct()
{
$this->primaryCurrency = Amount::getPrimaryCurrency();
$this->date = now(config('app.timezone'));
}
public function enrich(Collection $collection): Collection
@@ -69,7 +71,6 @@ class PiggyBankEnrichment implements EnrichmentInterface
$this->collectIds();
$this->collectObjectGroups();
$this->collectNotes();
$this->collectCurrentAmounts();
$this->appendCollectedData();
@@ -157,8 +158,8 @@ class PiggyBankEnrichment implements EnrichmentInterface
}
// get suggested per month.
$meta['save_per_month'] = Steam::bcround($this->getSuggestedMonthlyAmount($item->start_date, $item->target_date, $meta['target_amount'], $meta['current_amount']), $currency->decimal_places);
$meta['pc_save_per_month'] = Steam::bcround($this->getSuggestedMonthlyAmount($item->start_date, $item->target_date, $meta['pc_target_amount'], $meta['pc_current_amount']), $currency->decimal_places);
$meta['save_per_month'] = Steam::bcround($this->getSuggestedMonthlyAmount($this->date, $item->target_date, $meta['target_amount'], $meta['current_amount']), $currency->decimal_places);
$meta['pc_save_per_month'] = Steam::bcround($this->getSuggestedMonthlyAmount($this->date, $item->target_date, $meta['pc_target_amount'], $meta['pc_current_amount']), $currency->decimal_places);
$item->meta = $meta;
@@ -166,7 +167,13 @@ class PiggyBankEnrichment implements EnrichmentInterface
});
}
private function collectCurrentAmounts(): void {}
public function setDate(?Carbon $date): void
{
$this->date = $date;
}
private function collectIds(): void
{

View File

@@ -24,9 +24,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- [Issue 10954](https://github.com/firefly-iii/firefly-iii/issues/10954) (Internal Server Error when trying to access (default) account) reported by @thomaschristory
- [Issue 10956](https://github.com/firefly-iii/firefly-iii/issues/10956) (Manual webhook trigger fail) reported by @dudu7731
- [Issue 10960](https://github.com/firefly-iii/firefly-iii/issues/10960) (404 after deleting subscription) reported by @lindely
- #10965
- [Discussion 10974](https://github.com/orgs/firefly-iii/discussions/10974) (Big webhook_messages table) started by @Billos
- #10988
- [Issue 10990](https://github.com/firefly-iii/firefly-iii/issues/10990) (duplicate piggy event via API) reported by @4e868df3
- #10994
### API