mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Code for #1045
This commit is contained in:
parent
840705f793
commit
707af8bb4e
@ -22,8 +22,10 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Console\Commands;
|
namespace FireflyIII\Console\Commands;
|
||||||
|
|
||||||
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
use FireflyIII\Import\Logging\CommandHandler;
|
use FireflyIII\Import\Logging\CommandHandler;
|
||||||
use FireflyIII\Import\Routine\ImportRoutine;
|
use FireflyIII\Import\Routine\ImportRoutine;
|
||||||
|
use FireflyIII\Import\Routine\RoutineInterface;
|
||||||
use FireflyIII\Models\ImportJob;
|
use FireflyIII\Models\ImportJob;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\MessageBag;
|
use Illuminate\Support\MessageBag;
|
||||||
@ -81,8 +83,16 @@ class Import extends Command
|
|||||||
$handler = new CommandHandler($this);
|
$handler = new CommandHandler($this);
|
||||||
$monolog->pushHandler($handler);
|
$monolog->pushHandler($handler);
|
||||||
|
|
||||||
/** @var ImportRoutine $routine */
|
// actually start job:
|
||||||
$routine = app(ImportRoutine::class);
|
$type = $job->file_type === 'csv' ? 'file' : $job->file_type;
|
||||||
|
$key = sprintf('import.routine.%s', $type);
|
||||||
|
$className = config($key);
|
||||||
|
if (null === $className || !class_exists($className)) {
|
||||||
|
throw new FireflyException(sprintf('Cannot find import routine class for job of type "%s".', $type)); // @codeCoverageIgnore
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @var RoutineInterface $routine */
|
||||||
|
$routine = app($className);
|
||||||
$routine->setJob($job);
|
$routine->setJob($job);
|
||||||
$routine->run();
|
$routine->run();
|
||||||
|
|
||||||
|
@ -245,6 +245,10 @@ class ImportJournal
|
|||||||
$this->notes .= ' ' . $array['value'];
|
$this->notes .= ' ' . $array['value'];
|
||||||
$this->notes = trim($this->notes);
|
$this->notes = trim($this->notes);
|
||||||
break;
|
break;
|
||||||
|
case 'note':
|
||||||
|
$this->notes .= ' ' . $array['value'];
|
||||||
|
$this->notes = trim($this->notes);
|
||||||
|
break;
|
||||||
case 'external-id':
|
case 'external-id':
|
||||||
$this->externalId = $array['value'];
|
$this->externalId = $array['value'];
|
||||||
break;
|
break;
|
||||||
|
@ -89,6 +89,12 @@ return [
|
|||||||
'converter' => 'BillId',
|
'converter' => 'BillId',
|
||||||
'mapper' => 'Bills',
|
'mapper' => 'Bills',
|
||||||
],
|
],
|
||||||
|
'note' => [
|
||||||
|
'mappable' => false,
|
||||||
|
'pre-process-map' => false,
|
||||||
|
'field' => 'note',
|
||||||
|
'converter' => 'Note',
|
||||||
|
],
|
||||||
'bill-name' => [
|
'bill-name' => [
|
||||||
'mappable' => true,
|
'mappable' => true,
|
||||||
'pre-process-map' => false,
|
'pre-process-map' => false,
|
||||||
|
@ -138,6 +138,7 @@ return [
|
|||||||
'column_tags-space' => 'Tags (space separated)',
|
'column_tags-space' => 'Tags (space separated)',
|
||||||
'column_account-number' => 'Asset account (account number)',
|
'column_account-number' => 'Asset account (account number)',
|
||||||
'column_opposing-number' => 'Opposing account (account number)',
|
'column_opposing-number' => 'Opposing account (account number)',
|
||||||
|
'column_note' => 'Note(s)',
|
||||||
|
|
||||||
// bunq
|
// bunq
|
||||||
'bunq_prerequisites_title' => 'Prerequisites for an import from bunq',
|
'bunq_prerequisites_title' => 'Prerequisites for an import from bunq',
|
||||||
|
Loading…
Reference in New Issue
Block a user