Fixed bug where incorrect currency symbol was showing on organiser dashbaord.

This commit is contained in:
Dave Earley 2016-05-12 11:43:04 +01:00
parent 25b1b03b68
commit f689ff3b1e
4 changed files with 13 additions and 3 deletions

View File

@ -95,7 +95,7 @@ class Account extends MyBaseModel
*/
public function currency()
{
return $this->hasOne('\App\Models\Currency');
return $this->belongsTo('\App\Models\Currency');
}
/**

View File

@ -202,7 +202,7 @@ class Event extends MyBaseModel
}
/**
* Get the currency sybol.
* Get the currency symbol.
*
* @return \Illuminate\Support\Collection
*/

View File

@ -29,6 +29,16 @@ class Organiser extends MyBaseModel
'organiser_logo.mimes' => 'Please select a valid image type (jpeg, jpg, png)',
];
/**
* The account associated with the organiser
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function account()
{
return $this->belongsTo('\App\Models\Account');
}
/**
* The events associated with the organizer.
*

View File

@ -70,7 +70,7 @@
<div class="col-sm-4">
<div class="stat-box">
<h3>
{{ money($organiser->events->sum('sales_volume') + $organiser->events->sum('organiser_fees_volume'), 'EUR') }}
{{ money($organiser->events->sum('sales_volume') + $organiser->events->sum('organiser_fees_volume'), $organiser->account->currency->code) }}
</h3>
<span>
Sales Volume