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