diff --git a/app/Import/Converter/Amount.php b/app/Import/Converter/Amount.php index 1177b86a2e..bf1f23fdf9 100644 --- a/app/Import/Converter/Amount.php +++ b/app/Import/Converter/Amount.php @@ -36,6 +36,10 @@ class Amount implements ConverterInterface */ public function convert($value): string { + if(is_null($value)) { + return '0'; + } + $value = strval($value); Log::debug(sprintf('Start with amount "%s"', $value)); $len = strlen($value); $decimalPosition = $len - 3; diff --git a/app/Import/Storage/ImportStorage.php b/app/Import/Storage/ImportStorage.php index ee3f086790..f0d9e3f9f4 100644 --- a/app/Import/Storage/ImportStorage.php +++ b/app/Import/Storage/ImportStorage.php @@ -39,7 +39,7 @@ class ImportStorage /** @var string */ private $dateFormat = 'Ymd'; // yes, hard coded /** @var ImportJob */ - private $job; + protected $job; /** @var Collection */ private $objects; /** @var Collection */ diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php index 58bde274d0..84e964735c 100644 --- a/app/Repositories/Journal/JournalRepository.php +++ b/app/Repositories/Journal/JournalRepository.php @@ -196,7 +196,7 @@ class JournalRepository implements JournalRepositoryInterface $journal->save(); // store stuff: - $this->storeCategoryWithJournal($journal, $data['category']); + $this->storeCategoryWithJournal($journal, strval($data['category'])); $this->storeBudgetWithJournal($journal, $data['budget_id']); // store two transactions: @@ -271,7 +271,7 @@ class JournalRepository implements JournalRepositoryInterface $journal->categories()->detach(); $journal->budgets()->detach(); - $this->storeCategoryWithJournal($journal, $data['category']); + $this->storeCategoryWithJournal($journal, strval($data['category'])); $this->storeBudgetWithJournal($journal, $data['budget_id']); // negative because source loses money.