With a little luck this will cover a lot.

This commit is contained in:
James Cole
2015-06-07 15:32:01 +02:00
parent 0be5b27d34
commit 596cd09489
7 changed files with 234 additions and 37 deletions

View File

@@ -35,15 +35,8 @@ class Amount
*/
public function getCurrencySymbol()
{
if (defined('FFCURRENCYSYMBOL')) {
return FFCURRENCYSYMBOL; // @codeCoverageIgnore
}
$currencyPreference = Prefs::get('currencyPreference', 'EUR');
$currency = TransactionCurrency::whereCode($currencyPreference->data)->first();
define('FFCURRENCYSYMBOL', $currency->symbol);
return $currency->symbol;
}
@@ -148,18 +141,12 @@ class Amount
*/
public function getCurrencyCode()
{
if (defined('FFCURRENCYCODE')) {
return FFCURRENCYCODE; // @codeCoverageIgnore
}
$currencyPreference = Prefs::get('currencyPreference', 'EUR');
$currency = TransactionCurrency::whereCode($currencyPreference->data)->first();
if ($currency) {
define('FFCURRENCYCODE', $currency->code);
return $currency->code;
}