convert setting('default.currency') to default_currency() helper function..
This commit is contained in:
@ -28,7 +28,7 @@ trait Charts
|
||||
|
||||
public function addMoneyToDonutChart($color, $amount, $description = '')
|
||||
{
|
||||
$label = money($amount, setting('default.currency'), true)->formatForHumans();
|
||||
$label = money($amount, default_currency(), true)->formatForHumans();
|
||||
|
||||
if (!empty($description)) {
|
||||
$label .= ' - ' . $description;
|
||||
@ -98,11 +98,11 @@ trait Charts
|
||||
public function getChartLabelFormatter($type = 'money', $position = null)
|
||||
{
|
||||
$label = '';
|
||||
$decimal_mark = str_replace("'", "\\'", config('money.' . setting('default.currency') . '.decimal_mark'));
|
||||
$thousands_separator = str_replace("'", "\\'", config('money.' . setting('default.currency') . '.thousands_separator'));
|
||||
$symbol = str_replace("'", "\\'", config('money.' . setting('default.currency') . '.symbol'));
|
||||
$symbol_first = str_replace("'", "\\'", config('money.' . setting('default.currency') . '.symbol_first'));
|
||||
$precision = str_replace("'", "\\'", config('money.' . setting('default.currency') . '.precision'));
|
||||
$decimal_mark = str_replace("'", "\\'", config('money.' . default_currency() . '.decimal_mark'));
|
||||
$thousands_separator = str_replace("'", "\\'", config('money.' . default_currency() . '.thousands_separator'));
|
||||
$symbol = str_replace("'", "\\'", config('money.' . default_currency() . '.symbol'));
|
||||
$symbol_first = str_replace("'", "\\'", config('money.' . default_currency() . '.symbol_first'));
|
||||
$precision = str_replace("'", "\\'", config('money.' . default_currency() . '.precision'));
|
||||
$percent_position = $position ?: setting('localisation.percent_position');
|
||||
|
||||
switch ($type) {
|
||||
|
@ -44,7 +44,7 @@ trait Currencies
|
||||
{
|
||||
$default_amount = $amount;
|
||||
|
||||
if ($from_code != setting('default.currency')) {
|
||||
if ($from_code != default_currency()) {
|
||||
$default_amount = $this->convertToDefault($amount, $from_code, $from_rate);
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ trait Currencies
|
||||
|
||||
public function getDefaultCurrency()
|
||||
{
|
||||
return !empty($this->default_currency_code) ? $this->default_currency_code : setting('default.currency');
|
||||
return !empty($this->default_currency_code) ? $this->default_currency_code : default_currency();
|
||||
}
|
||||
|
||||
public function setDefaultCurrency($code)
|
||||
|
@ -195,7 +195,7 @@ trait Import
|
||||
'company_id' => company_id(),
|
||||
'name' => $row['account_name'],
|
||||
'number' => !empty($row['account_number']) ? $row['account_number'] : (string) rand(1, 10000),
|
||||
'currency_code' => !empty($row['currency_code']) ? $row['currency_code'] : setting('default.currency'),
|
||||
'currency_code' => !empty($row['currency_code']) ? $row['currency_code'] : default_currency(),
|
||||
'opening_balance' => !empty($row['opening_balance']) ? $row['opening_balance'] : 0,
|
||||
'enabled' => 1,
|
||||
'created_from' => $row['created_from'],
|
||||
@ -221,7 +221,7 @@ trait Import
|
||||
'company_id' => company_id(),
|
||||
'number' => $row['account_number'],
|
||||
'name' => !empty($row['account_name']) ? $row['account_name'] : $row['account_number'],
|
||||
'currency_code' => !empty($row['currency_code']) ? $row['currency_code'] : setting('default.currency'),
|
||||
'currency_code' => !empty($row['currency_code']) ? $row['currency_code'] : default_currency(),
|
||||
'opening_balance' => !empty($row['opening_balance']) ? $row['opening_balance'] : 0,
|
||||
'enabled' => 1,
|
||||
'created_from' => $row['created_from'],
|
||||
@ -273,7 +273,7 @@ trait Import
|
||||
'email' => $row['contact_email'],
|
||||
'type' => $type,
|
||||
'name' => !empty($row['contact_name']) ? $row['contact_name'] : $row['contact_email'],
|
||||
'currency_code' => !empty($row['contact_currency']) ? $row['contact_currency'] : setting('default.currency'),
|
||||
'currency_code' => !empty($row['contact_currency']) ? $row['contact_currency'] : default_currency(),
|
||||
'enabled' => 1,
|
||||
'created_from' => $row['created_from'],
|
||||
'created_by' => $row['created_by'],
|
||||
@ -299,7 +299,7 @@ trait Import
|
||||
'name' => $row['contact_name'],
|
||||
'type' => $type,
|
||||
'email' => !empty($row['contact_email']) ? $row['contact_email'] : null,
|
||||
'currency_code' => !empty($row['contact_currency']) ? $row['contact_currency'] : setting('default.currency'),
|
||||
'currency_code' => !empty($row['contact_currency']) ? $row['contact_currency'] : default_currency(),
|
||||
'enabled' => 1,
|
||||
'created_from' => $row['created_from'],
|
||||
'created_by' => $row['created_by'],
|
||||
|
Reference in New Issue
Block a user