From 0f6555fb555cc62a8e809250b335d6d4421fc66d Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 27 Jul 2016 13:54:42 +0300 Subject: [PATCH] Fix display of expense exchange rates --- app/Models/Expense.php | 2 +- resources/views/expenses/edit.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/Expense.php b/app/Models/Expense.php index d5ad0e0405..5348ee530f 100644 --- a/app/Models/Expense.php +++ b/app/Models/Expense.php @@ -142,7 +142,7 @@ class Expense extends EntityModel */ public function isExchanged() { - return $this->invoice_currency_id != $this->expense_currency_id; + return $this->invoice_currency_id != $this->expense_currency_id || $this->exchange_rate != 1; } /** diff --git a/resources/views/expenses/edit.blade.php b/resources/views/expenses/edit.blade.php index a555ed4c09..8629de91b2 100644 --- a/resources/views/expenses/edit.blade.php +++ b/resources/views/expenses/edit.blade.php @@ -353,7 +353,7 @@ self.amount = ko.observable(); self.exchange_rate = ko.observable(1); self.should_be_invoiced = ko.observable(); - self.convert_currency = ko.observable(false); + self.convert_currency = ko.observable({{ ($expense && $expense->isExchanged()) ? 'true' : 'false' }}); self.apply_taxes = ko.observable({{ ($expense && ($expense->tax_name1 || $expense->tax_name2)) ? 'true' : 'false' }}); self.mapping = {