mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-10 17:09:42 +00:00
Remove statistics when creating a new journal.
This commit is contained in:
@@ -74,4 +74,9 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface
|
||||
{
|
||||
return $model->primaryPeriodStatistics()->where('start', '>=', $start)->where('end', '<=', $end)->get();
|
||||
}
|
||||
|
||||
public function deleteStatisticsForModel(Model $model, Carbon $date): void
|
||||
{
|
||||
$model->primaryPeriodStatistics()->where('start', '<=', $date)->where('end', '>=', $date)->delete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,4 +37,6 @@ interface PeriodStatisticRepositoryInterface
|
||||
public function saveStatistic(Model $model, int $currencyId, Carbon $start, Carbon $end, string $type, int $count, string $amount): PeriodStatistic;
|
||||
|
||||
public function allInRangeForModel(Model $model, Carbon $start, Carbon $end): Collection;
|
||||
|
||||
public function deleteStatisticsForModel(Model $model, Carbon $date): void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user