convert setting('default.currency') to default_currency() helper function..
This commit is contained in:
@ -44,7 +44,7 @@ class Script extends Component
|
||||
$this->type = $type;
|
||||
$this->contact = $contact;
|
||||
$this->currencies = $this->getCurrencies($currencies);
|
||||
$this->currency_code = ($contact) ? $contact->currency_code : setting('default.currency');
|
||||
$this->currency_code = ($contact) ? $contact->currency_code : default_currency();
|
||||
|
||||
$this->alias = $this->getAlias($type, $alias);
|
||||
$this->folder = $this->getScriptFolder($type, $folder);
|
||||
|
@ -72,9 +72,9 @@ class Content extends Component
|
||||
$totals['paid'] += $item->getAmountConvertedToDefault();
|
||||
});
|
||||
|
||||
$open_amount = money($totals['open'], setting('default.currency'), true);
|
||||
$overdue_amount = money($totals['overdue'], setting('default.currency'), true);
|
||||
$paid_amount = money($totals['paid'], setting('default.currency'), true);
|
||||
$open_amount = money($totals['open'], default_currency(), true);
|
||||
$overdue_amount = money($totals['overdue'], default_currency(), true);
|
||||
$paid_amount = money($totals['paid'], default_currency(), true);
|
||||
|
||||
$summary_amounts = [
|
||||
'open_exact' => $open_amount->format(),
|
||||
|
@ -50,7 +50,7 @@ class Script extends Component
|
||||
$this->document = $document;
|
||||
$this->items = $items;
|
||||
$this->currencies = $this->getCurrencies($currencies);
|
||||
$this->currency_code = ($document) ? $document->currency_code : setting('default.currency');
|
||||
$this->currency_code = ($document) ? $document->currency_code : default_currency();
|
||||
$this->taxes = $this->getTaxes($taxes);
|
||||
|
||||
$this->alias = $this->getAlias($type, $alias);
|
||||
|
@ -48,7 +48,7 @@ class Currency extends Form
|
||||
}
|
||||
|
||||
if (empty($this->selected) && empty($this->getParentData('model'))) {
|
||||
$this->selected = setting('default.currency');
|
||||
$this->selected = default_currency();
|
||||
}
|
||||
|
||||
return view('components.form.group.currency');
|
||||
|
@ -36,7 +36,7 @@ class Currency extends Component
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
$code = ($this->code) ? $this->code : setting('default.currency');
|
||||
$code = ($this->code) ? $this->code : default_currency();
|
||||
|
||||
$this->currency = config('money.' . $code . '.name');
|
||||
|
||||
|
@ -166,7 +166,7 @@ class Scripts extends Component
|
||||
$currencies = collect();
|
||||
|
||||
Currency::all()->each(function ($currency) use (&$currencies) {
|
||||
$currency->default = setting('default.currency') == $currency->code;
|
||||
$currency->default = default_currency() == $currency->code;
|
||||
|
||||
$currencies->push($currency);
|
||||
});
|
||||
|
Reference in New Issue
Block a user