mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Sort by alphabet.
This commit is contained in:
@@ -17,6 +17,17 @@ use Preferences as Prefs;
|
||||
class Amount
|
||||
{
|
||||
|
||||
/**
|
||||
* @param $amount
|
||||
* @param bool $coloured
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function format($amount, $coloured = true)
|
||||
{
|
||||
return $this->formatAnything($this->getDefaultCurrency(), $amount, $coloured);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will properly format the given number, in color or "black and white",
|
||||
* as a currency, given two things: the currency required and the current locale.
|
||||
@@ -48,48 +59,6 @@ class Amount
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $amount
|
||||
* @param bool $coloured
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function format($amount, $coloured = true)
|
||||
{
|
||||
return $this->formatAnything($this->getDefaultCurrency(), $amount, $coloured);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrencySymbol()
|
||||
{
|
||||
$cache = new CacheProperties;
|
||||
$cache->addProperty('getCurrencySymbol');
|
||||
if ($cache->has()) {
|
||||
return $cache->get();
|
||||
} else {
|
||||
$currencyPreference = Prefs::get('currencyPreference', env('DEFAULT_CURRENCY', 'EUR'));
|
||||
$currency = TransactionCurrency::whereCode($currencyPreference->data)->first();
|
||||
|
||||
$cache->store($currency->symbol);
|
||||
|
||||
return $currency->symbol;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $symbol
|
||||
* @param float $amount
|
||||
* @param bool $coloured
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function formatWithSymbol($symbol, $amount, $coloured = true)
|
||||
{
|
||||
return $this->formatAnything($this->getDefaultCurrency(), $amount, $coloured);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
@@ -139,6 +108,18 @@ class Amount
|
||||
return $this->formatAnything($currency, $transaction->amount, $coloured);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $symbol
|
||||
* @param float $amount
|
||||
* @param bool $coloured
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function formatWithSymbol($symbol, $amount, $coloured = true)
|
||||
{
|
||||
return $this->formatAnything($this->getDefaultCurrency(), $amount, $coloured);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
@@ -173,6 +154,25 @@ class Amount
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrencySymbol()
|
||||
{
|
||||
$cache = new CacheProperties;
|
||||
$cache->addProperty('getCurrencySymbol');
|
||||
if ($cache->has()) {
|
||||
return $cache->get();
|
||||
} else {
|
||||
$currencyPreference = Prefs::get('currencyPreference', env('DEFAULT_CURRENCY', 'EUR'));
|
||||
$currency = TransactionCurrency::whereCode($currencyPreference->data)->first();
|
||||
|
||||
$cache->store($currency->symbol);
|
||||
|
||||
return $currency->symbol;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return TransactionCurrency
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user