convert setting('default.currency') to default_currency() helper function..
This commit is contained in:
@ -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();
|
||||
|
@ -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(),
|
||||
|
@ -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(),
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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([
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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',
|
||||
|
@ -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]);
|
||||
|
@ -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');
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user