mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-10 22:52:10 +00:00
Fix #10994
This commit is contained in:
@@ -57,10 +57,12 @@ class PiggyBankEnrichment implements EnrichmentInterface
|
|||||||
private readonly TransactionCurrency $primaryCurrency;
|
private readonly TransactionCurrency $primaryCurrency;
|
||||||
private User $user;
|
private User $user;
|
||||||
private UserGroup $userGroup;
|
private UserGroup $userGroup;
|
||||||
|
private ?Carbon $date;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->primaryCurrency = Amount::getPrimaryCurrency();
|
$this->primaryCurrency = Amount::getPrimaryCurrency();
|
||||||
|
$this->date = now(config('app.timezone'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function enrich(Collection $collection): Collection
|
public function enrich(Collection $collection): Collection
|
||||||
@@ -69,7 +71,6 @@ class PiggyBankEnrichment implements EnrichmentInterface
|
|||||||
$this->collectIds();
|
$this->collectIds();
|
||||||
$this->collectObjectGroups();
|
$this->collectObjectGroups();
|
||||||
$this->collectNotes();
|
$this->collectNotes();
|
||||||
$this->collectCurrentAmounts();
|
|
||||||
|
|
||||||
|
|
||||||
$this->appendCollectedData();
|
$this->appendCollectedData();
|
||||||
@@ -157,8 +158,8 @@ class PiggyBankEnrichment implements EnrichmentInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get suggested per month.
|
// 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['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($item->start_date, $item->target_date, $meta['pc_target_amount'], $meta['pc_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;
|
$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
|
private function collectIds(): void
|
||||||
{
|
{
|
||||||
|
@@ -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 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 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
|
- [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
|
- [Discussion 10974](https://github.com/orgs/firefly-iii/discussions/10974) (Big webhook_messages table) started by @Billos
|
||||||
- #10988
|
- #10988
|
||||||
- [Issue 10990](https://github.com/firefly-iii/firefly-iii/issues/10990) (duplicate piggy event via API) reported by @4e868df3
|
- [Issue 10990](https://github.com/firefly-iii/firefly-iii/issues/10990) (duplicate piggy event via API) reported by @4e868df3
|
||||||
|
- #10994
|
||||||
|
|
||||||
### API
|
### API
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user