Skip to content

Firefly III: a personal finances manager

Various small fixes.

James Colee76075e29f96
diff --git a/app/Support/ExpandedForm.php b/app/Support/ExpandedForm.php
index 2b6a2f0486..50e3398f26 100644
--- a/app/Support/ExpandedForm.php
+++ b/app/Support/ExpandedForm.php
@@ -503,6 +503,13 @@ class ExpandedForm
$currencies = Amt::getAllCurrencies();
unset($options['currency']);
unset($options['placeholder']);
+
+ // make sure value is formatted nicely:
+ if (!is_null($value) && $value !== '') {
+ $value = round($value, 2);
+ }
+
+
$html = view('form.' . $view, compact('defaultCurrency', 'currencies', 'classes', 'name', 'label', 'value', 'options'))->render();
return $html;
diff --git a/app/Support/Twig/Journal.php b/app/Support/Twig/Journal.php
index e98f0ee070..65aac8e818 100644
--- a/app/Support/Twig/Journal.php
+++ b/app/Support/Twig/Journal.php
@@ -16,6 +16,7 @@ namespace FireflyIII\Support\Twig;
use Amount;
use FireflyIII\Models\Account;
+use FireflyIII\Models\AccountType;
use FireflyIII\Models\Budget as ModelBudget;
use FireflyIII\Models\Category;
use FireflyIII\Models\TransactionJournal;
@@ -142,7 +143,7 @@ class Journal extends Twig_Extension
$array = [];
/** @var Account $entry */
foreach ($list as $entry) {
- if ($entry->accountType->type == 'Cash account') {
+ if ($entry->accountType->type == AccountType::CASH) {
$array[] = '<span class="text-success">(cash)</span>';
continue;
}
@@ -153,7 +154,6 @@ class Journal extends Twig_Extension
$cache->store($result);
return $result;
-
}
);
}
diff --git a/tests/acceptance/Controllers/BudgetControllerTest.php b/tests/acceptance/Controllers/BudgetControllerTest.php
index 06d86c3bd1..cef5c1cb2e 100644
--- a/tests/acceptance/Controllers/BudgetControllerTest.php
+++ b/tests/acceptance/Controllers/BudgetControllerTest.php
@@ -129,10 +129,10 @@ class BudgetControllerTest extends TestCase
public function testPostUpdateIncome()
{
$data = [
- 'amount' => 200,
+ 'amount' => '200',
];
$this->be($this->user());
- $this->call('post', route('budgets.income.post', [1]), $data);
+ $this->call('post', route('budgets.income.post'), $data);
$this->assertResponseStatus(302);
}