From 1c0aa4ec8db797eb6377d61042c6fa51787c7375 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 2 Apr 2015 09:58:23 +0300 Subject: [PATCH] Fixed issue with default currency not being used --- app/controllers/PaymentController.php | 2 +- app/models/Account.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/PaymentController.php b/app/controllers/PaymentController.php index 4f74c8575a6b..17198bcd3d7d 100755 --- a/app/controllers/PaymentController.php +++ b/app/controllers/PaymentController.php @@ -542,7 +542,7 @@ class PaymentController extends \BaseController } } - $invitation = Invitation::with('invoice.invoice_items', 'invoice.client.currency', 'invoice.client.account.account_gateways.gateway')->where('invitation_key', '=', $invitationKey)->firstOrFail(); + $invitation = Invitation::with('invoice.invoice_items', 'invoice.client.currency', 'invoice.client.account.currency', 'invoice.client.account.account_gateways.gateway')->where('invitation_key', '=', $invitationKey)->firstOrFail(); $invoice = $invitation->invoice; $client = $invoice->client; $account = $client->account; diff --git a/app/models/Account.php b/app/models/Account.php index 22fb3ecd1cfc..e611f9ddefb6 100755 --- a/app/models/Account.php +++ b/app/models/Account.php @@ -54,6 +54,11 @@ class Account extends Eloquent return $this->belongsTo('DatetimeFormat'); } + public function currency() + { + return $this->belongsTo('Currency'); + } + public function size() { return $this->belongsTo('Size');