mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-09 22:26:04 +00:00
Add statistics routine to update event.
This commit is contained in:
@@ -72,12 +72,26 @@ class UpdatedGroupEventHandler
|
||||
$dest = $journal->transactions()->where('amount', '>', '0')->first();
|
||||
$repository->deleteStatisticsForModel($source->account, $journal->date);
|
||||
$repository->deleteStatisticsForModel($dest->account, $journal->date);
|
||||
foreach ($journal->categories as $category) {
|
||||
|
||||
$categories = $journal->categories;
|
||||
$tags = $journal->tags;
|
||||
$budgets = $journal->budgets;
|
||||
|
||||
foreach ($categories as $category) {
|
||||
$repository->deleteStatisticsForModel($category, $journal->date);
|
||||
}
|
||||
foreach ($journal->tags as $tag) {
|
||||
foreach ($tags as $tag) {
|
||||
$repository->deleteStatisticsForModel($tag, $journal->date);
|
||||
}
|
||||
foreach ($budgets as $budget) {
|
||||
$repository->deleteStatisticsForModel($budget, $journal->date);
|
||||
}
|
||||
if (0 === $categories->count()) {
|
||||
$repository->deleteStatisticsForPrefix($journal->userGroup, 'no_category', $journal->date);
|
||||
}
|
||||
if (0 === $budgets->count()) {
|
||||
$repository->deleteStatisticsForPrefix($journal->userGroup, 'no_budget', $journal->date);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user