diff --git a/app/Import/Storage/ImportStorage.php b/app/Import/Storage/ImportStorage.php index 9b56038718..619e77d768 100644 --- a/app/Import/Storage/ImportStorage.php +++ b/app/Import/Storage/ImportStorage.php @@ -313,8 +313,6 @@ class ImportStorage } $this->addStep(); - $this->journals->push($factoryJournal); - Log::info( sprintf( 'Imported new journal #%d: "%s", amount %s %s.', $factoryJournal->id, $factoryJournal->description, $factoryJournal->transactionCurrency->code, diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index 901d43221c..af5391c1fd 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -375,7 +375,7 @@ class TagRepository implements TagRepositoryInterface /** @var array $entry */ foreach ($temporary as $entry) { - $scale = $this->cloudScale([12, 20], floatval($entry['amount']), floatval($min), floatval($max)); + $scale = $this->cloudScale([12, 20], (float)$entry['amount'], (float)$min, (float)$max); $tagId = $entry['tag']['id']; $return[$tagId] = [ 'scale' => $scale, @@ -424,14 +424,15 @@ class TagRepository implements TagRepositoryInterface $diff = $range[1] - $range[0]; $step = 1; - if (0 != $diff) { + if (0.0 !== $diff) { $step = $amountDiff / $diff; } - if (0 == $step) { + if (0.0 === $step) { $step = 1; } - $extra = round($amount / $step); - return intval($range[0] + $extra); + $extra = $step / $amount; + $result = (int)($range[0] + $extra); + return $result; } }