mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Some better feedback in the import process.
This commit is contained in:
@@ -50,6 +50,7 @@ class ImportValidator
|
||||
*/
|
||||
public function clean(): Collection
|
||||
{
|
||||
Log::notice(sprintf('Started validating %d entry(ies).', $this->entries->count()));
|
||||
$newCollection = new Collection;
|
||||
/** @var ImportEntry $entry */
|
||||
foreach ($this->entries as $index => $entry) {
|
||||
@@ -71,6 +72,7 @@ class ImportValidator
|
||||
|
||||
$newCollection->put($index, $entry);
|
||||
}
|
||||
Log::notice(sprintf('Finished validating %d entry(ies).', $newCollection->count()));
|
||||
|
||||
return $newCollection;
|
||||
}
|
||||
@@ -100,7 +102,7 @@ class ImportValidator
|
||||
{
|
||||
if ($entry->fields['amount'] == 0) {
|
||||
$entry->valid = false;
|
||||
Log::error('Amount of transaction is zero, cannot handle.');
|
||||
Log::warning('Amount of transaction is zero, cannot handle.');
|
||||
|
||||
return $entry;
|
||||
}
|
||||
@@ -229,7 +231,7 @@ class ImportValidator
|
||||
// default import is null? should not happen. Entry cannot be imported.
|
||||
// set error message and block.
|
||||
$entry->valid = false;
|
||||
Log::error('Cannot import entry. Asset account is NULL and import account is also NULL.');
|
||||
Log::warning('Cannot import entry. Asset account is NULL and import account is also NULL.');
|
||||
|
||||
}
|
||||
Log::debug('Asset account is OK.', ['id' => $entry->fields['asset-account']->id, 'name' => $entry->fields['asset-account']->name]);
|
||||
@@ -379,7 +381,7 @@ class ImportValidator
|
||||
|
||||
return $entry;
|
||||
}
|
||||
Log::error(sprintf('Opposing account is of type %s, cannot handle this.', $type));
|
||||
Log::warning(sprintf('Opposing account is of type %s, cannot handle this.', $type));
|
||||
$entry->valid = false;
|
||||
|
||||
return $entry;
|
||||
|
Reference in New Issue
Block a user