mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-28 01:41:14 -06:00
Improve logging #1607
This commit is contained in:
parent
53ed5b2975
commit
b17f2f5d1f
@ -92,12 +92,13 @@ class TransactionJournalFactory
|
||||
/** @var TransactionFactory $factory */
|
||||
$factory = app(TransactionFactory::class);
|
||||
$factory->setUser($this->user);
|
||||
|
||||
$totalAmount= '0';
|
||||
Log::debug(sprintf('Found %d transactions in array.', \count($data['transactions'])));
|
||||
/** @var array $trData */
|
||||
foreach ($data['transactions'] as $index => $trData) {
|
||||
Log::debug(sprintf('Now storing transaction %d of %d', $index + 1, \count($data['transactions'])));
|
||||
$factory->createPair($journal, $trData);
|
||||
$totalAmount = bcadd($totalAmount, $trData['amount'] ?? '0');
|
||||
}
|
||||
$journal->completed = true;
|
||||
$journal->save();
|
||||
@ -127,6 +128,8 @@ class TransactionJournalFactory
|
||||
// invalidate cache.
|
||||
app('preferences')->mark();
|
||||
|
||||
$journal->temp_amount = $totalAmount;
|
||||
|
||||
return $journal;
|
||||
}
|
||||
|
||||
|
@ -469,7 +469,7 @@ class ImportArrayStorage
|
||||
continue;
|
||||
}
|
||||
|
||||
Log::info(sprintf('Stored #%d: "%s" (ID #%d)', $index, $journal->description, $journal->id));
|
||||
Log::info(sprintf('Stored #%d: "%s" %s (ID #%d)', $index, $journal->description, round($journal->temp_amount, 2), $journal->id));
|
||||
Log::debug(sprintf('Stored as journal #%d', $journal->id));
|
||||
$collection->push($journal);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user