From db9c0600a8dd7e159052c70023595abc6790bb00 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 19 Sep 2017 07:51:16 +0200 Subject: [PATCH 1/3] Update ImportStorage.php Fix for #854 --- app/Import/Storage/ImportStorage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ From e442eb6ce28051947c02d9ff2d3830c7a9ed3321 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 20 Sep 2017 08:31:00 +0200 Subject: [PATCH 2/3] Update Amount.php Fix null pointer #854 --- app/Import/Converter/Amount.php | 4 ++++ 1 file changed, 4 insertions(+) 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; From ec73607974efcb53c186d1af93089e80e6d11ccd Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 20 Sep 2017 08:35:20 +0200 Subject: [PATCH 3/3] Update JournalRepository.php Fix #860 --- app/Repositories/Journal/JournalRepository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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.