mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
33 lines
706 B
PHP
33 lines
706 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace FireflyIII\Console\Commands\Correction;
|
|
|
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
|
use FireflyIII\Support\Models\AccountBalanceCalculator;
|
|
use Illuminate\Console\Command;
|
|
|
|
/**
|
|
* Class CorrectionSkeleton
|
|
*/
|
|
class CorrectAccountBalance extends Command
|
|
{
|
|
use ShowsFriendlyMessages;
|
|
protected $description = 'Recalculate all account balance amounts';
|
|
|
|
protected $signature = 'firefly-iii:correct-account-balance';
|
|
|
|
public function handle(): int
|
|
{
|
|
$this->correctBalanceAmounts();
|
|
|
|
return 0;
|
|
}
|
|
|
|
private function correctBalanceAmounts(): void
|
|
{
|
|
AccountBalanceCalculator::recalculateAll();
|
|
}
|
|
}
|