Chart re-implemented and added coveralls and other instructions, which will probably not work at all.

This commit is contained in:
James Cole
2015-02-07 08:23:44 +01:00
parent 37e58ac13a
commit fb1c78c657
13 changed files with 371 additions and 25 deletions

View File

@@ -3,6 +3,9 @@
namespace FireflyIII\Support;
use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionCurrency;
use Preferences as Prefs;
use Cache;
/**
* Class Amount
*
@@ -54,4 +57,29 @@ class Amount
// €
return $symbol . ' ' . $string;
}
/**
* @return string
*/
public function getCurrencyCode()
{
if (defined('FFCURRENCYCODE')) {
return FFCURRENCYCODE;
}
if (Cache::has('FFCURRENCYCODE')) {
define('FFCURRENCYCODE', Cache::get('FFCURRENCYCODE'));
return FFCURRENCYCODE;
}
$currencyPreference = Prefs::get('currencyPreference', 'EUR');
$currency = TransactionCurrency::whereCode($currencyPreference->data)->first();
\Cache::forever('FFCURRENCYCODE', $currency->code);
define('FFCURRENCYCODE', $currency->code);
return $currency->code;
}
}