Small code cleanup.

This commit is contained in:
James Cole
2017-02-11 15:52:55 +01:00
parent fb73baca6a
commit 4c2d9e0eee
8 changed files with 11 additions and 30 deletions

View File

@@ -27,6 +27,7 @@ use FireflyIII\Rules\Processor;
use FireflyIII\User;
use Illuminate\Support\Collection;
use Log;
use Steam;
/**
* Class ImportStorage
@@ -197,21 +198,6 @@ class ImportStorage
}
/**
* @param float $amount
*
* @return string
*/
private function makePositive(float $amount): string
{
$amount = strval($amount);
if (bccomp($amount, '0', 4) === -1) { // left is larger than right
$amount = bcmul($amount, '-1');
}
return $amount;
}
/**
* @param $entry
*
@@ -370,7 +356,7 @@ class ImportStorage
$journal = $this->storeJournal($entry);
$amount = $this->makePositive($entry->fields['amount']);
$amount = Steam::positive($entry->fields['amount']);
$accounts = $this->storeAccounts($entry);
// create new transactions. This is something that needs a rewrite for multiple/split transactions.