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;

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,

View File

@ -65,7 +65,7 @@ class Accounts extends Controller
*/
public function create()
{
$currency = Currency::where('code', '=', setting('default.currency'))->first();
$currency = Currency::where('code', '=', default_currency())->first();
return view('banking.accounts.create', compact('currency'));
}
@ -279,7 +279,7 @@ class Accounts extends Controller
return response()->json([]);
}
$currency_code = setting('default.currency');
$currency_code = default_currency();
if (isset($account->currency_code)) {
$currencies = Currency::enabled()->pluck('name', 'code')->toArray();

View File

@ -24,8 +24,8 @@ class Reconciliations extends Controller
{
$reconciliations = Reconciliation::with('account')->collect();
$reconciled_amount = money($reconciliations->where('reconciled', 1)->sum('closing_balance'), setting('default.currency'), true);
$in_progress_amount = money($reconciliations->where('reconciled', 0)->sum('closing_balance'), setting('default.currency'), true);
$reconciled_amount = money($reconciliations->where('reconciled', 1)->sum('closing_balance'), default_currency(), true);
$in_progress_amount = money($reconciliations->where('reconciled', 0)->sum('closing_balance'), default_currency(), true);
$summary_amounts = [
'amount_exact' => $reconciled_amount->format(),

View File

@ -56,9 +56,9 @@ class Transactions extends Controller
$totals['profit'] = $totals['income'] - $totals['expense'];
$incoming_amount = money($totals['income'], setting('default.currency'), true);
$expense_amount = money($totals['expense'], setting('default.currency'), true);
$profit_amount = money($totals['profit'], setting('default.currency'), true);
$incoming_amount = money($totals['income'], default_currency(), true);
$expense_amount = money($totals['expense'], default_currency(), true);
$profit_amount = money($totals['profit'], default_currency(), true);
$summary_amounts = [
'incoming_exact' => $incoming_amount->format(),

View File

@ -50,7 +50,7 @@ class Transfers extends Controller
{
$accounts = Account::enabled()->orderBy('name')->get()->pluck('title', 'id');
$currency = Currency::where('code', setting('default.currency'))->first();
$currency = Currency::where('code', default_currency())->first();
return view('banking.transfers.create', compact('accounts', 'currency'));
}
@ -136,7 +136,7 @@ class Transfers extends Controller
{
$accounts = Account::enabled()->orderBy('name')->get()->pluck('title', 'id');
$currency_code = ($transfer->expense_transaction->account) ? $transfer->expense_transaction->account->currency_code : setting('default.currency');
$currency_code = ($transfer->expense_transaction->account) ? $transfer->expense_transaction->account->currency_code : default_currency();
$currency = Currency::where('code', $currency_code)->first();

View File

@ -242,7 +242,7 @@ class Items extends Controller
$currency_code = request('currency_code');
if (empty($currency_code) || (strtolower($currency_code) == 'null')) {
$currency_code = setting('default.currency');
$currency_code = default_currency();
}
$autocomplete = Item::autocomplete([

View File

@ -28,7 +28,7 @@ class Accounts extends Controller
*/
public function create()
{
$currency = Currency::where('code', '=', setting('default.currency'))->first();
$currency = Currency::where('code', '=', default_currency())->first();
$html = view('modals.accounts.create', compact('currency'))->render();

View File

@ -31,7 +31,7 @@ class Items extends Controller
{
$taxes = Tax::enabled()->orderBy('name')->get()->pluck('title', 'id');
$currency = Currency::where('code', setting('default.currency'))->first();
$currency = Currency::where('code', default_currency())->first();
$html = view('modals.items.create', compact('taxes', 'currency'))->render();

View File

@ -122,7 +122,7 @@ class Currencies extends Controller
}
// Set default currency
$currency->default_currency = ($currency->code == setting('default.currency')) ? 1 : 0;
$currency->default_currency = ($currency->code == default_currency()) ? 1 : 0;
$precisions = (object) [
'0' => '0',

View File

@ -91,7 +91,7 @@ class Currencies extends Controller
{
$response = $this->ajaxDispatch(new UpdateCurrency($currency, $request));
$currency->default = setting('default.currency') == $currency->code;
$currency->default = default_currency() == $currency->code;
if ($response['success']) {
$message = trans('messages.success.updated', ['type' => $currency->name]);

View File

@ -23,7 +23,7 @@ class Money
return $next($request);
}
$currency_code = setting('default.currency');
$currency_code = default_currency();
if ($request->get('currency_code')) {
$currency_code = $request->get('currency_code');

View File

@ -22,7 +22,7 @@ class Reconciliation extends JsonResource
'started_at' => $this->started_at->toIso8601String(),
'ended_at' => $this->ended_at->toIso8601String(),
'closing_balance' => $this->closing_balance,
'closing_balance_formatted' => money($this->closing_balance, setting('default.currency'), true)->format(),
'closing_balance_formatted' => money($this->closing_balance, default_currency(), true)->format(),
'reconciled' => $this->reconciled,
'created_from' => $this->created_from,
'created_by' => $this->created_by,

View File

@ -23,9 +23,9 @@ class Item extends JsonResource
'name' => $this->name,
'description' => $this->description,
'sale_price' => $this->sale_price,
'sale_price_formatted' => money($this->sale_price, setting('default.currency'), true)->format(),
'sale_price_formatted' => money($this->sale_price, default_currency(), true)->format(),
'purchase_price' => $this->purchase_price,
'purchase_price_formatted' => money($this->purchase_price, setting('default.currency'), true)->format(),
'purchase_price_formatted' => money($this->purchase_price, default_currency(), true)->format(),
'category_id' => $this->category_id,
'picture' => $this->picture,
'enabled' => $this->enabled,

View File

@ -42,7 +42,7 @@ class DeleteCurrency extends Job implements ShouldDelete
$relationships = $this->countRelationships($this->model, $rels);
if ($this->model->code == setting('default.currency')) {
if ($this->model->code == default_currency()) {
$relationships[] = strtolower(trans_choice('general.companies', 1));
}

View File

@ -64,7 +64,7 @@ class UpdateCurrency extends Job implements ShouldUpdate
$relationships = $this->countRelationships($this->model, $rels);
if ($this->model->code == setting('default.currency')) {
if ($this->model->code == default_currency()) {
$relationships[] = strtolower(trans_choice('general.companies', 1));
}

View File

@ -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) {

View File

@ -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)

View File

@ -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'],

View File

@ -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);

View File

@ -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(),

View File

@ -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);

View File

@ -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');

View File

@ -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');

View File

@ -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);
});

View File

@ -53,9 +53,9 @@ class CashFlow extends Widget
->setDataset(trans('general.outgoing'), 'column', $expense)
->setDataset(trans_choice('general.profits', 1), 'line', $profit);
$incoming_amount = money(array_sum($income), setting('default.currency'), true);
$outgoing_amount = money(abs(array_sum($expense)), setting('default.currency'), true);
$profit_amount = money(array_sum($profit), setting('default.currency'), true);
$incoming_amount = money(array_sum($income), default_currency(), true);
$outgoing_amount = money(abs(array_sum($expense)), default_currency(), true);
$profit_amount = money(array_sum($profit), default_currency(), true);
$totals = [
'incoming_exact' => $incoming_amount->format(),
@ -191,7 +191,7 @@ class CashFlow extends Widget
$totals[$i] += $item->getAmountConvertedToDefault();
}
$precision = config('money.' . setting('default.currency') . '.precision');
$precision = config('money.' . default_currency() . '.precision');
foreach ($totals as $key => $value) {
if ($type == 'expense') {
@ -206,7 +206,7 @@ class CashFlow extends Widget
{
$profit = [];
$precision = config('money.' . setting('default.currency') . '.precision');
$precision = config('money.' . default_currency() . '.precision');
foreach ($incomes as $key => $income) {
$value = $income - abs($expenses[$key]);

View File

@ -52,7 +52,7 @@ class Payables extends Widget
});
foreach ($periods as $period_name => $period_amount) {
$periods[$period_name] = money($period_amount, setting('default.currency'), true);
$periods[$period_name] = money($period_amount, default_currency(), true);
}
$has_progress = !empty($open) || !empty($overdue);
@ -61,9 +61,9 @@ class Payables extends Widget
$grand = $open + $overdue;
$totals = [
'grand' => money($grand, setting('default.currency'), true),
'open' => money($open, setting('default.currency'), true),
'overdue' => money($overdue, setting('default.currency'), true),
'grand' => money($grand, default_currency(), true),
'open' => money($open, default_currency(), true),
'overdue' => money($overdue, default_currency(), true),
];
$grand_total_text = trans('widgets.total_unpaid_bills');

View File

@ -195,7 +195,7 @@ class ProfitLoss extends Widget
$totals[$i] += $item->getAmountConvertedToDefault();
}
$precision = config('money.' . setting('default.currency') . '.precision');
$precision = config('money.' . default_currency() . '.precision');
foreach ($totals as $key => $value) {
$totals[$key] = round($value, $precision);

View File

@ -52,7 +52,7 @@ class Receivables extends Widget
});
foreach ($periods as $period_name => $period_amount) {
$periods[$period_name] = money($period_amount, setting('default.currency'), true);
$periods[$period_name] = money($period_amount, default_currency(), true);
}
$has_progress = !empty($open) || !empty($overdue);
@ -61,9 +61,9 @@ class Receivables extends Widget
$grand = $open + $overdue;
$totals = [
'grand' => money($grand, setting('default.currency'), true),
'open' => money($open, setting('default.currency'), true),
'overdue' => money($overdue, setting('default.currency'), true),
'grand' => money($grand, default_currency(), true),
'open' => money($open, default_currency(), true),
'overdue' => money($overdue, default_currency(), true),
];
$grand_total_text = trans('widgets.total_unpaid_invoices');

View File

@ -70,7 +70,7 @@ class Account extends Factory
public function default_currency()
{
return $this->state([
'currency_code' => setting('default.currency'),
'currency_code' => default_currency(),
]);
}
}

View File

@ -38,7 +38,7 @@ class Contact extends Factory
'address' => $this->faker->address,
'country' => $this->faker->randomElement($countries),
'website' => 'https://akaunting.com',
'currency_code' => setting('default.currency'),
'currency_code' => default_currency(),
'reference' => $this->faker->text(5),
'enabled' => $this->faker->boolean ? 1 : 0,
'created_from' => 'core::factory',

View File

@ -44,7 +44,7 @@ class Document extends AbstractFactory
'company_id' => $this->company->id,
'issued_at' => $issued_at,
'due_at' => $due_at,
'currency_code' => setting('default.currency'),
'currency_code' => default_currency(),
'currency_rate' => '1',
'notes' => $this->faker->text(5),
'amount' => '0',
@ -247,7 +247,7 @@ class Document extends AbstractFactory
'tax_ids' => [$tax->id],
'quantity' => '1',
'price' => $amount,
'currency' => setting('default.currency'),
'currency' => default_currency(),
],
];

View File

@ -28,7 +28,7 @@ class Reconciliation extends Factory
return [
'company_id' => $this->company->id,
'account_id' => '1',
'currency_code' => setting('default.currency'),
'currency_code' => default_currency(),
'opening_balance' => '0',
'closing_balance' => '10',
'started_at' => $started_at,

View File

@ -44,7 +44,7 @@ class Transaction extends Factory
'account_id' => setting('default.account'),
'paid_at' => $this->faker->dateTimeBetween(now()->startOfYear(), now()->endOfYear())->format('Y-m-d H:i:s'),
'amount' => $this->faker->randomFloat(2, 1, 1000),
'currency_code' => setting('default.currency'),
'currency_code' => default_currency(),
'currency_rate' => '1.0',
'description' => $this->faker->text(5),
'category_id' => $this->company->categories()->$category_type()->get()->random(1)->pluck('id')->first(),

View File

@ -84,7 +84,7 @@ class TestCompany extends Seeder
'type' => 'customer',
'name' => 'Test Customer',
'email' => 'customer@company.com',
'currency_code' => setting('default.currency'),
'currency_code' => default_currency(),
'password' => '123456',
'password_confirmation' => '123456',
'company_id' => company_id(),

View File

@ -25,13 +25,13 @@
<div v-if="show_rate" class="sm:col-span-3">
<x-form.input.hidden name="from_currency_code" v-model="form.from_currency_code" />
<x-form.group.text name="from_account_rate" label="{{ trans('transfers.from_account_rate') }}" v-disabled="form.from_currency_code == '{{ setting('default.currency') }}'" />
<x-form.group.text name="from_account_rate" label="{{ trans('transfers.from_account_rate') }}" v-disabled="form.from_currency_code == '{{ default_currency() }}'" />
</div>
<div v-if="show_rate" class="sm:col-span-3">
<x-form.input.hidden name="to_currency_code" v-model="form.to_currency_code" />
<x-form.group.text name="to_account_rate" label="{{ trans('transfers.to_account_rate') }}" v-disabled="form.to_currency_code == '{{ setting('default.currency') }}'" />
<x-form.group.text name="to_account_rate" label="{{ trans('transfers.to_account_rate') }}" v-disabled="form.to_currency_code == '{{ default_currency() }}'" />
</div>
<x-form.group.date name="transferred_at" label="{{ trans('general.date') }}" icon="calendar_today" value="{{ Date::now()->toDateString() }}" show-date-format="{{ company_date_format() }}" date-format="Y-m-d" autocomplete="off" />

View File

@ -20,25 +20,25 @@
<div v-if="show_rate" class="sm:col-span-3">
<x-form.input.hidden name="from_currency_code" :value="$transfer->from_currency_code" v-model="form.from_currency_code" />
<x-form.group.text name="from_account_rate" label="{{ trans('transfers.from_account_rate') }}" v-disabled="form.from_currency_code == '{{ setting('default.currency') }}'" />
<x-form.group.text name="from_account_rate" label="{{ trans('transfers.from_account_rate') }}" v-disabled="form.from_currency_code == '{{ default_currency() }}'" />
</div>
<div v-if="show_rate" class="sm:col-span-3">
<x-form.input.hidden name="to_currency_code" :value="$transfer->to_currency_code" v-model="form.to_currency_code" />
<x-form.group.text name="to_account_rate" label="{{ trans('transfers.to_account_rate') }}" v-disabled="form.to_currency_code == '{{ setting('default.currency') }}'" />
<x-form.group.text name="to_account_rate" label="{{ trans('transfers.to_account_rate') }}" v-disabled="form.to_currency_code == '{{ default_currency() }}'" />
</div>
@else
<div v-if="show_rate" class="sm:col-span-3">
<x-form.input.hidden name="from_currency_code" :value="$transfer->from_currency_code" v-model="form.from_currency_code" />
<x-form.group.text name="from_account_rate" label="{{ trans('transfers.from_account_rate') }}" v-disabled="form.from_currency_code == '{{ setting('default.currency') }}'" />
<x-form.group.text name="from_account_rate" label="{{ trans('transfers.from_account_rate') }}" v-disabled="form.from_currency_code == '{{ default_currency() }}'" />
</div>
<div v-if="show_rate" class="sm:col-span-3">
<x-form.input.hidden name="to_currency_code" :value="$transfer->to_currency_code" v-model="form.to_currency_code" />
<x-form.group.text name="to_account_rate" label="{{ trans('transfers.to_account_rate') }}" v-disabled="form.to_currency_code == '{{ setting('default.currency') }}'" />
<x-form.group.text name="to_account_rate" label="{{ trans('transfers.to_account_rate') }}" v-disabled="form.to_currency_code == '{{ default_currency() }}'" />
</div>
@endif

View File

@ -119,14 +119,14 @@
<x-table.td class="w-6/12 sm:w-3/12" kind="amount">
<x-slot name="first">
@if ($item->sale_price)
<x-money :amount="$item->sale_price" :currency="setting('default.currency')" convert />
<x-money :amount="$item->sale_price" :currency="default_currency()" convert />
@else
<x-empty-data />
@endif
</x-slot>
<x-slot name="second">
@if ($item->purchase_price)
<x-money :amount="$item->purchase_price" :currency="setting('default.currency')" convert />
<x-money :amount="$item->purchase_price" :currency="default_currency()" convert />
@else
<x-empty-data />
@endif

View File

@ -221,7 +221,7 @@
@if (! $hideOpen)
<x-slot name="first">
@if ($item->open)
<x-money :amount="$item->open" :currency="setting('default.currency')" convert />
<x-money :amount="$item->open" :currency="default_currency()" convert />
@else
<x-empty-data />
@endif
@ -233,7 +233,7 @@
@if (! $hideOverdue)
<x-slot name="second">
@if ($item->overdue)
<x-money :amount="$item->overdue" :currency="setting('default.currency')" convert />
<x-money :amount="$item->overdue" :currency="default_currency()" convert />
@else
<x-empty-data />
@endif

View File

@ -2,7 +2,7 @@
<script src="{{ asset('public/vendor/js-cookie/js.cookie.js') }}"></script>
<script type="text/javascript">
var company_currency_code = '{{ setting("default.currency") }}';
var company_currency_code = '{{ default_currency() }}';
</script>
@stack('scripts_start')

View File

@ -2,7 +2,7 @@
<script src="{{ asset('public/vendor/js-cookie/js.cookie.js') }}"></script>
<script type="text/javascript">
var company_currency_code = '{{ setting("default.currency") }}';
var company_currency_code = '{{ default_currency() }}';
</script>
@stack('scripts_start')

View File

@ -2,7 +2,7 @@
<script src="{{ asset('public/vendor/js-cookie/js.cookie.js') }}"></script>
<script type="text/javascript">
var company_currency_code = '{{ setting("default.currency") }}';
var company_currency_code = '{{ default_currency() }}';
</script>
@stack('scripts_start')

View File

@ -73,7 +73,7 @@
@endif
@endif
</div>
<span>{{ $class->has_money ? money($row_total, setting('default.currency'), true) : $row_total }}</span>
<span>{{ $class->has_money ? money($row_total, default_currency(), true) : $row_total }}</span>
</div>
</li>
@endif
@ -91,7 +91,7 @@
<div style="display:flex; align-items: center; padding-left: {{ ($tree_level + 1) * 20 }}px;">
<span>{{ $class->row_names[$table_key][$id] }}</span>
</div>
<span>{{ $class->has_money ? money($row_total, setting('default.currency'), true) : $row_total }}</span>
<span>{{ $class->has_money ? money($row_total, default_currency(), true) : $row_total }}</span>
</div>
</li>
@endif

View File

@ -28,7 +28,7 @@
<x-form.group.text name="thousands_separator" label="{{ trans('currencies.thousands_separator') }}" not-required />
<x-form.group.toggle name="default_currency" label="{{ trans('currencies.default') }}" :value="$currency->default_currency" :disabled="(setting('default.currency') == $currency->code)" />
<x-form.group.toggle name="default_currency" label="{{ trans('currencies.default') }}" :value="$currency->default_currency" :disabled="(default_currency() == $currency->code)" />
</x-slot>
</x-form.section>