Use note object instead of field #888

This commit is contained in:
James Cole
2017-10-03 10:30:56 +02:00
parent 4af0c18020
commit d1a6b37eb3
7 changed files with 59 additions and 11 deletions

View File

@@ -16,6 +16,7 @@ use Exception;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Import\Object\ImportJournal;
use FireflyIII\Models\ImportJob;
use FireflyIII\Models\Note;
use FireflyIII\Models\TransactionType;
use Illuminate\Support\Collection;
use Log;
@@ -178,9 +179,14 @@ class ImportStorage
$this->storeBill($journal, $importJournal->bill->getBill());
$this->storeMeta($journal, $importJournal->metaDates);
$journal->setMeta('notes', $importJournal->notes);
$this->storeTags($importJournal->tags, $journal);
// set notes for journal:
$dbNote = new Note();
$dbNote->noteable()->associate($journal);
$dbNote->text = trim($importJournal->notes);
$dbNote->save();
// set journal completed:
$journal->completed = true;
$journal->save();