convert setting('default.currency') to default_currency() helper function..

This commit is contained in:
Cüneyt Şentürk
2022-10-05 10:35:19 +03:00
parent e683a0d171
commit d29859f65b
45 changed files with 84 additions and 84 deletions

View File

@ -283,8 +283,8 @@ abstract class Index extends Component
$items[] = [
'title' => ($key == 'overdue') ? trans('general.overdue') : trans('documents.statuses.' . $key),
//'href' => route($route, ['search' => 'status:' . $key]),
'amount' => money($total, setting('default.currency'), true)->formatForHumans(),
'tooltip' => money($total, setting('default.currency'), true)->format(),
'amount' => money($total, default_currency(), true)->formatForHumans(),
'tooltip' => money($total, default_currency(), true)->format(),
];
}

View File

@ -291,7 +291,7 @@ abstract class Form extends Component
$this->document = $this->model;
$this->currencies = $this->getCurrencies($currencies);
$this->currency = $this->getCurrency($document, $currency, $currency_code);
$this->currency_code = ! empty($this->currency) ? $this->currency->code : setting('default.currency');
$this->currency_code = ! empty($this->currency) ? $this->currency->code : default_currency();
$this->taxes = Tax::enabled()->orderBy('name')->get()->pluck('title', 'id');
/* -- Content Start -- */
@ -438,7 +438,7 @@ abstract class Form extends Component
}
if (empty($currency)) {
$currency = Currency::where('code', setting('default.currency'))->first();
$currency = Currency::where('code', default_currency())->first();
}
return $currency;
@ -1139,7 +1139,7 @@ abstract class Form extends Component
if (! empty($notes)) {
return $notes;
}
if (! empty($this->document)) {
return $this->document->notes;
}

View File

@ -392,8 +392,8 @@ abstract class Index extends Component
foreach ($totals as $key => $total) {
$title = ($key == 'overdue') ? trans('general.overdue') : trans('documents.statuses.' . $key);
$href = route($route, ['search' => 'status:' . $key]);
$amount = money($total, setting('default.currency'), true)->formatForHumans();
$tooltip = money($total, setting('default.currency'), true)->format();
$amount = money($total, default_currency(), true)->formatForHumans();
$tooltip = money($total, default_currency(), true)->format();
$items[] = [
'title' => $title,