Various small fixes.

This commit is contained in:
James Cole 2016-12-22 18:19:50 +01:00
parent 284db7f90b
commit e76075e29f
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
3 changed files with 11 additions and 4 deletions

View File

@ -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;

View File

@ -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;
}
);
}

View File

@ -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);
}