mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-25 18:30:55 -06:00
Fix some last minute issues.
This commit is contained in:
parent
52656b25da
commit
093bdd6090
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user