Fix commands

This commit is contained in:
James Cole 2024-05-16 07:16:47 +02:00
parent b8d1d7a8c0
commit 7ca39fdb21
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
3 changed files with 5 additions and 5 deletions

View File

@ -27,6 +27,6 @@ class CorrectAccountBalance extends Command
private function correctBalanceAmounts(): void
{
AccountBalanceCalculator::recalculate(null, null);
AccountBalanceCalculator::recalculateAll();
}
}

View File

@ -40,12 +40,12 @@ class TransactionObserver
public function updated(Transaction $transaction): void
{
app('log')->debug('Observe "updated" of a transaction.');
AccountBalanceCalculator::recalculateForAccount($transaction->account);
AccountBalanceCalculator::recalculateForJournal($transaction->transactionJournal);
}
public function created(Transaction $transaction): void
{
app('log')->debug('Observe "created" of a transaction.');
AccountBalanceCalculator::recalculateForAccount($transaction->account);
AccountBalanceCalculator::recalculateForJournal($transaction->transactionJournal);
}
}

View File

@ -46,7 +46,7 @@ class AccountBalanceCalculator
{
$object = new self;
$object->recalculateLatest(null);
$object->recalculateJournals(null, null);
//$object->recalculateJournals(null, null);
}
public static function recalculateForJournal(TransactionJournal $transactionJournal): void
@ -54,7 +54,7 @@ class AccountBalanceCalculator
$object = new self;
foreach ($transactionJournal->transactions as $transaction) {
$object->recalculateLatest($transaction->account);
$object->recalculateJournals($transaction->account, $transactionJournal);
//$object->recalculateJournals($transaction->account, $transactionJournal);
}
}