Merge branch 'master' of https://github.com/brkcvn/akaunting into new-plans

This commit is contained in:
Burak Civan 2022-10-07 09:43:10 +03:00
commit 314d1abd17
61 changed files with 249 additions and 139 deletions

View File

@ -171,7 +171,7 @@ abstract class Report
$sum += is_array($total) ? array_sum($total) : $total; $sum += is_array($total) ? array_sum($total) : $total;
} }
$total = $this->has_money ? money($sum, setting('default.currency'), true)->format() : $sum; $total = $this->has_money ? money($sum, default_currency(), true)->format() : $sum;
} else { } else {
$total = trans('general.na'); $total = trans('general.na');
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -50,7 +50,7 @@ class Transfers extends Controller
{ {
$accounts = Account::enabled()->orderBy('name')->get()->pluck('title', 'id'); $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')); 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'); $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(); $currency = Currency::where('code', $currency_code)->first();

View File

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

View File

@ -28,7 +28,7 @@ class Accounts extends Controller
*/ */
public function create() 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(); $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'); $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(); $html = view('modals.items.create', compact('taxes', 'currency'))->render();

View File

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

View File

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

View File

@ -23,7 +23,7 @@ class Money
return $next($request); return $next($request);
} }
$currency_code = setting('default.currency'); $currency_code = default_currency();
if ($request->get('currency_code')) { if ($request->get('currency_code')) {
$currency_code = $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(), 'started_at' => $this->started_at->toIso8601String(),
'ended_at' => $this->ended_at->toIso8601String(), 'ended_at' => $this->ended_at->toIso8601String(),
'closing_balance' => $this->closing_balance, '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, 'reconciled' => $this->reconciled,
'created_from' => $this->created_from, 'created_from' => $this->created_from,
'created_by' => $this->created_by, 'created_by' => $this->created_by,

View File

@ -23,9 +23,9 @@ class Item extends JsonResource
'name' => $this->name, 'name' => $this->name,
'description' => $this->description, 'description' => $this->description,
'sale_price' => $this->sale_price, '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' => $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, 'category_id' => $this->category_id,
'picture' => $this->picture, 'picture' => $this->picture,
'enabled' => $this->enabled, 'enabled' => $this->enabled,

View File

@ -67,7 +67,7 @@ class CreateBankingDocumentTransaction extends Job implements ShouldCreate
$currency_code = !empty($this->request['currency_code']) ? $this->request['currency_code'] : $this->model->currency_code; $currency_code = !empty($this->request['currency_code']) ? $this->request['currency_code'] : $this->model->currency_code;
$this->request['company_id'] = $this->model->company_id; $this->request['company_id'] = $this->model->company_id;
$this->request['currency_code'] = isset($this->request['currency_code']) ? $this->request['currency_code'] : $this->model->currency_code; $this->request['currency_code'] = $currency_code;
$this->request['paid_at'] = isset($this->request['paid_at']) ? $this->request['paid_at'] : Date::now()->toDateTimeString(); $this->request['paid_at'] = isset($this->request['paid_at']) ? $this->request['paid_at'] : Date::now()->toDateTimeString();
$this->request['currency_rate'] = config('money.' . $currency_code . '.rate'); $this->request['currency_rate'] = config('money.' . $currency_code . '.rate');
$this->request['account_id'] = isset($this->request['account_id']) ? $this->request['account_id'] : setting('default.account'); $this->request['account_id'] = isset($this->request['account_id']) ? $this->request['account_id'] : setting('default.account');

View File

@ -66,7 +66,7 @@ class UpdateBankingDocumentTransaction extends Job implements ShouldUpdate
$currency_code = ! empty($this->request['currency_code']) ? $this->request['currency_code'] : $this->model->currency_code; $currency_code = ! empty($this->request['currency_code']) ? $this->request['currency_code'] : $this->model->currency_code;
$this->request['company_id'] = $this->model->company_id; $this->request['company_id'] = $this->model->company_id;
$this->request['currency_code'] = isset($this->request['currency_code']) ? $this->request['currency_code'] : $this->model->currency_code; $this->request['currency_code'] = $currency_code;
$this->request['paid_at'] = isset($this->request['paid_at']) ? $this->request['paid_at'] : Date::now()->toDateTimeString(); $this->request['paid_at'] = isset($this->request['paid_at']) ? $this->request['paid_at'] : Date::now()->toDateTimeString();
$this->request['currency_rate'] = config('money.' . $currency_code . '.rate'); $this->request['currency_rate'] = config('money.' . $currency_code . '.rate');
$this->request['account_id'] = isset($this->request['account_id']) ? $this->request['account_id'] : setting('default.account'); $this->request['account_id'] = isset($this->request['account_id']) ? $this->request['account_id'] : setting('default.account');

View File

@ -28,7 +28,7 @@ class CreateDocumentItem extends Job implements HasOwner, HasSource, ShouldCreat
public function handle(): DocumentItem public function handle(): DocumentItem
{ {
$item_id = !empty($this->request['item_id']) ? $this->request['item_id'] : 0; $item_id = ! empty($this->request['item_id']) ? $this->request['item_id'] : 0;
$precision = config('money.' . $this->document->currency_code . '.precision'); $precision = config('money.' . $this->document->currency_code . '.precision');
$item_amount = (double) $this->request['price'] * (double) $this->request['quantity']; $item_amount = (double) $this->request['price'] * (double) $this->request['quantity'];
@ -36,7 +36,7 @@ class CreateDocumentItem extends Job implements HasOwner, HasSource, ShouldCreat
$item_discounted_amount = $item_amount; $item_discounted_amount = $item_amount;
// Apply line discount to amount // Apply line discount to amount
if (!empty($this->request['discount'])) { if (! empty($this->request['discount'])) {
if ($this->request['discount_type'] === 'percentage') { if ($this->request['discount_type'] === 'percentage') {
$item_discounted_amount -= ($item_amount * ($this->request['discount'] / 100)); $item_discounted_amount -= ($item_amount * ($this->request['discount'] / 100));
} else { } else {

View File

@ -42,7 +42,7 @@ class DeleteCurrency extends Job implements ShouldDelete
$relationships = $this->countRelationships($this->model, $rels); $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)); $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); $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)); $relationships[] = strtolower(trans_choice('general.companies', 1));
} }

View File

@ -28,7 +28,7 @@ trait Charts
public function addMoneyToDonutChart($color, $amount, $description = '') public function addMoneyToDonutChart($color, $amount, $description = '')
{ {
$label = money($amount, setting('default.currency'), true)->formatForHumans(); $label = money($amount, default_currency(), true)->formatForHumans();
if (!empty($description)) { if (!empty($description)) {
$label .= ' - ' . $description; $label .= ' - ' . $description;
@ -98,11 +98,11 @@ trait Charts
public function getChartLabelFormatter($type = 'money', $position = null) public function getChartLabelFormatter($type = 'money', $position = null)
{ {
$label = ''; $label = '';
$decimal_mark = str_replace("'", "\\'", config('money.' . setting('default.currency') . '.decimal_mark')); $decimal_mark = str_replace("'", "\\'", config('money.' . default_currency() . '.decimal_mark'));
$thousands_separator = str_replace("'", "\\'", config('money.' . setting('default.currency') . '.thousands_separator')); $thousands_separator = str_replace("'", "\\'", config('money.' . default_currency() . '.thousands_separator'));
$symbol = str_replace("'", "\\'", config('money.' . setting('default.currency') . '.symbol')); $symbol = str_replace("'", "\\'", config('money.' . default_currency() . '.symbol'));
$symbol_first = str_replace("'", "\\'", config('money.' . setting('default.currency') . '.symbol_first')); $symbol_first = str_replace("'", "\\'", config('money.' . default_currency() . '.symbol_first'));
$precision = str_replace("'", "\\'", config('money.' . setting('default.currency') . '.precision')); $precision = str_replace("'", "\\'", config('money.' . default_currency() . '.precision'));
$percent_position = $position ?: setting('localisation.percent_position'); $percent_position = $position ?: setting('localisation.percent_position');
switch ($type) { switch ($type) {

View File

@ -44,7 +44,7 @@ trait Currencies
{ {
$default_amount = $amount; $default_amount = $amount;
if ($from_code != setting('default.currency')) { if ($from_code != default_currency()) {
$default_amount = $this->convertToDefault($amount, $from_code, $from_rate); $default_amount = $this->convertToDefault($amount, $from_code, $from_rate);
} }
@ -70,7 +70,7 @@ trait Currencies
public function getDefaultCurrency() 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) public function setDefaultCurrency($code)

View File

@ -195,7 +195,7 @@ trait Import
'company_id' => company_id(), 'company_id' => company_id(),
'name' => $row['account_name'], 'name' => $row['account_name'],
'number' => !empty($row['account_number']) ? $row['account_number'] : (string) rand(1, 10000), '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, 'opening_balance' => !empty($row['opening_balance']) ? $row['opening_balance'] : 0,
'enabled' => 1, 'enabled' => 1,
'created_from' => $row['created_from'], 'created_from' => $row['created_from'],
@ -221,7 +221,7 @@ trait Import
'company_id' => company_id(), 'company_id' => company_id(),
'number' => $row['account_number'], 'number' => $row['account_number'],
'name' => !empty($row['account_name']) ? $row['account_name'] : $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, 'opening_balance' => !empty($row['opening_balance']) ? $row['opening_balance'] : 0,
'enabled' => 1, 'enabled' => 1,
'created_from' => $row['created_from'], 'created_from' => $row['created_from'],
@ -273,7 +273,7 @@ trait Import
'email' => $row['contact_email'], 'email' => $row['contact_email'],
'type' => $type, 'type' => $type,
'name' => !empty($row['contact_name']) ? $row['contact_name'] : $row['contact_email'], '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, 'enabled' => 1,
'created_from' => $row['created_from'], 'created_from' => $row['created_from'],
'created_by' => $row['created_by'], 'created_by' => $row['created_by'],
@ -299,7 +299,7 @@ trait Import
'name' => $row['contact_name'], 'name' => $row['contact_name'],
'type' => $type, 'type' => $type,
'email' => !empty($row['contact_email']) ? $row['contact_email'] : null, '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, 'enabled' => 1,
'created_from' => $row['created_from'], 'created_from' => $row['created_from'],
'created_by' => $row['created_by'], 'created_by' => $row['created_by'],

View File

@ -44,7 +44,7 @@ class Script extends Component
$this->type = $type; $this->type = $type;
$this->contact = $contact; $this->contact = $contact;
$this->currencies = $this->getCurrencies($currencies); $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->alias = $this->getAlias($type, $alias);
$this->folder = $this->getScriptFolder($type, $folder); $this->folder = $this->getScriptFolder($type, $folder);

View File

@ -72,9 +72,9 @@ class Content extends Component
$totals['paid'] += $item->getAmountConvertedToDefault(); $totals['paid'] += $item->getAmountConvertedToDefault();
}); });
$open_amount = money($totals['open'], setting('default.currency'), true); $open_amount = money($totals['open'], default_currency(), true);
$overdue_amount = money($totals['overdue'], setting('default.currency'), true); $overdue_amount = money($totals['overdue'], default_currency(), true);
$paid_amount = money($totals['paid'], setting('default.currency'), true); $paid_amount = money($totals['paid'], default_currency(), true);
$summary_amounts = [ $summary_amounts = [
'open_exact' => $open_amount->format(), 'open_exact' => $open_amount->format(),

View File

@ -50,7 +50,7 @@ class Script extends Component
$this->document = $document; $this->document = $document;
$this->items = $items; $this->items = $items;
$this->currencies = $this->getCurrencies($currencies); $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->taxes = $this->getTaxes($taxes);
$this->alias = $this->getAlias($type, $alias); $this->alias = $this->getAlias($type, $alias);

View File

@ -48,7 +48,7 @@ class Currency extends Form
} }
if (empty($this->selected) && empty($this->getParentData('model'))) { if (empty($this->selected) && empty($this->getParentData('model'))) {
$this->selected = setting('default.currency'); $this->selected = default_currency();
} }
return view('components.form.group.currency'); return view('components.form.group.currency');

View File

@ -36,7 +36,7 @@ class Currency extends Component
*/ */
public function render() public function render()
{ {
$code = ($this->code) ? $this->code : setting('default.currency'); $code = ($this->code) ? $this->code : default_currency();
$this->currency = config('money.' . $code . '.name'); $this->currency = config('money.' . $code . '.name');

View File

@ -166,7 +166,7 @@ class Scripts extends Component
$currencies = collect(); $currencies = collect();
Currency::all()->each(function ($currency) use (&$currencies) { Currency::all()->each(function ($currency) use (&$currencies) {
$currency->default = setting('default.currency') == $currency->code; $currency->default = default_currency() == $currency->code;
$currencies->push($currency); $currencies->push($currency);
}); });

View File

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

View File

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

View File

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

View File

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

View File

@ -70,7 +70,7 @@ class Account extends Factory
public function default_currency() public function default_currency()
{ {
return $this->state([ 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, 'address' => $this->faker->address,
'country' => $this->faker->randomElement($countries), 'country' => $this->faker->randomElement($countries),
'website' => 'https://akaunting.com', 'website' => 'https://akaunting.com',
'currency_code' => setting('default.currency'), 'currency_code' => default_currency(),
'reference' => $this->faker->text(5), 'reference' => $this->faker->text(5),
'enabled' => $this->faker->boolean ? 1 : 0, 'enabled' => $this->faker->boolean ? 1 : 0,
'created_from' => 'core::factory', 'created_from' => 'core::factory',

View File

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

View File

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

View File

@ -44,7 +44,7 @@ class Transaction extends Factory
'account_id' => setting('default.account'), 'account_id' => setting('default.account'),
'paid_at' => $this->faker->dateTimeBetween(now()->startOfYear(), now()->endOfYear())->format('Y-m-d H:i:s'), 'paid_at' => $this->faker->dateTimeBetween(now()->startOfYear(), now()->endOfYear())->format('Y-m-d H:i:s'),
'amount' => $this->faker->randomFloat(2, 1, 1000), 'amount' => $this->faker->randomFloat(2, 1, 1000),
'currency_code' => setting('default.currency'), 'currency_code' => default_currency(),
'currency_rate' => '1.0', 'currency_rate' => '1.0',
'description' => $this->faker->text(5), 'description' => $this->faker->text(5),
'category_id' => $this->company->categories()->$category_type()->get()->random(1)->pluck('id')->first(), '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', 'type' => 'customer',
'name' => 'Test Customer', 'name' => 'Test Customer',
'email' => 'customer@company.com', 'email' => 'customer@company.com',
'currency_code' => setting('default.currency'), 'currency_code' => default_currency(),
'password' => '123456', 'password' => '123456',
'password_confirmation' => '123456', 'password_confirmation' => '123456',
'company_id' => company_id(), 'company_id' => company_id(),

16
public/css/app.css vendored
View File

@ -49715,14 +49715,18 @@ body{
left: 100%; left: 100%;
} }
[dir="ltr"] .ltr\:-left-80{ [dir="ltr"] .ltr\:-right-1\.5{
left: -20rem; right: -0.375rem;
} }
[dir="ltr"] .ltr\:-right-1{ [dir="ltr"] .ltr\:-right-1{
right: -0.25rem; right: -0.25rem;
} }
[dir="ltr"] .ltr\:-left-80{
left: -20rem;
}
[dir="ltr"] .ltr\:-right-2{ [dir="ltr"] .ltr\:-right-2{
right: -0.5rem; right: -0.5rem;
} }
@ -50650,14 +50654,18 @@ body{
left: 100%; left: 100%;
} }
[dir="rtl"] .rtl\:-right-80{ [dir="rtl"] .rtl\:-left-1\.5{
right: -20rem; left: -0.375rem;
} }
[dir="rtl"] .rtl\:-left-1{ [dir="rtl"] .rtl\:-left-1{
left: -0.25rem; left: -0.25rem;
} }
[dir="rtl"] .rtl\:-right-80{
right: -20rem;
}
[dir="rtl"] .rtl\:-left-2{ [dir="rtl"] .rtl\:-left-2{
left: -0.5rem; left: -0.5rem;
} }

32
public/css/print.css vendored
View File

@ -67,8 +67,8 @@ html[dir='rtl'] .right-column {
margin-bottom: 8px; margin-bottom: 8px;
} }
.margin-bottom-12 { .margin-bottom-spacing {
margin: 12px 0; margin: 24px 0;
} }
.print-template .mt-1 .print-template .mt-1
@ -348,6 +348,10 @@ html[dir='rtl'] .text-right
text-align: left; text-align: left;
} }
.text-alignment-center {
text-align: center;
}
.text-center .text-center
{ {
text-align: center; text-align: center;
@ -424,6 +428,30 @@ html[dir='rtl'] .text-right
vertical-align: top; vertical-align: top;
} }
.col-w-2 {
width: 16.6666666667%;
}
.col-w-4 {
width: 33.3333333333%;
}
.col-w-6 {
width: 50%;
}
.col-w-8 {
width: 66.6666666667%;
}
.col-w-10 {
width: 83.3333333333%;
}
.col-w-12 {
width: 50%;
}
.w-image { .w-image {
width: 70px; width: 70px;
} }

View File

@ -47,5 +47,41 @@ const app = new Vue({
this.form.submit(); this.form.submit();
}, },
// Change currency get money
onChangeCurrency(currency_code) {
if (! currency_code) {
return;
}
if (! this.all_currencies.length) {
let currency_promise = Promise.resolve(window.axios.get((url + '/settings/currencies')));
currency_promise.then(response => {
if (response.data.success) {
this.all_currencies = response.data.data;
}
this.all_currencies.forEach(function (currency, index) {
if (currency_code == currency.code) {
this.currency = currency;
this.form.currency = currency.code;
}
}, this);
})
.catch(error => {
this.onChangeCurrency(currency_code);
});
} else {
this.all_currencies.forEach(function (currency, index) {
if (currency_code == currency.code) {
this.currency = currency;
this.form.currency = currency.code;
}
}, this);
}
},
} }
}); });

View File

@ -159,6 +159,42 @@ const app = new Vue({
} else { } else {
this.quantity_name_input = false; this.quantity_name_input = false;
} }
} },
// Change currency get money
onChangeCurrency(currency_code) {
if (! currency_code) {
return;
}
if (! this.all_currencies.length) {
let currency_promise = Promise.resolve(window.axios.get((url + '/settings/currencies')));
currency_promise.then(response => {
if (response.data.success) {
this.all_currencies = response.data.data;
}
this.all_currencies.forEach(function (currency, index) {
if (currency_code == currency.code) {
this.currency = currency;
this.form.currency = currency.code;
}
}, this);
})
.catch(error => {
this.onChangeCurrency(currency_code);
});
} else {
this.all_currencies.forEach(function (currency, index) {
if (currency_code == currency.code) {
this.currency = currency;
this.form.currency = currency.code;
}
}, this);
}
},
} }
}); });

View File

@ -25,13 +25,13 @@
<div v-if="show_rate" class="sm:col-span-3"> <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.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>
<div v-if="show_rate" class="sm:col-span-3"> <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.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> </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" /> <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"> <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.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>
<div v-if="show_rate" class="sm:col-span-3"> <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.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> </div>
@else @else
<div v-if="show_rate" class="sm:col-span-3"> <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.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>
<div v-if="show_rate" class="sm:col-span-3"> <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.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> </div>
@endif @endif

View File

@ -119,14 +119,14 @@
<x-table.td class="w-6/12 sm:w-3/12" kind="amount"> <x-table.td class="w-6/12 sm:w-3/12" kind="amount">
<x-slot name="first"> <x-slot name="first">
@if ($item->sale_price) @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 @else
<x-empty-data /> <x-empty-data />
@endif @endif
</x-slot> </x-slot>
<x-slot name="second"> <x-slot name="second">
@if ($item->purchase_price) @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 @else
<x-empty-data /> <x-empty-data />
@endif @endif

View File

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

View File

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

View File

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

View File

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

View File

@ -63,7 +63,7 @@
{{ trans('modules.free') }} {{ trans('modules.free') }}
</span> </span>
@else @else
@if (!empty($module->is_discount)) @if (! empty($module->is_discount))
{!! trans('modules.monthly_price', ['price' => '<del class="text-danger">' . $module->yearly_per_monthly_price . '</del> ' . $module->yearly_per_monthly_special_price]) !!} {!! trans('modules.monthly_price', ['price' => '<del class="text-danger">' . $module->yearly_per_monthly_price . '</del> ' . $module->yearly_per_monthly_special_price]) !!}
@else @else
{!! trans('modules.monthly_price', ['price' => $module->yearly_per_monthly_price]) !!} {!! trans('modules.monthly_price', ['price' => $module->yearly_per_monthly_price]) !!}

View File

@ -1,4 +1,4 @@
<div class="overflow-x-visible mb-8 margin-bottom-12"> <div class="overflow-x-visible mb-8 margin-bottom-spacing">
<table class="w-full rp-border-collapse"> <table class="w-full rp-border-collapse">
@include($class->views['detail.table.header']) @include($class->views['detail.table.header'])
@include($class->views['detail.table.body']) @include($class->views['detail.table.body'])

View File

@ -73,7 +73,7 @@
@endif @endif
@endif @endif
</div> </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> </div>
</li> </li>
@endif @endif
@ -91,7 +91,7 @@
<div style="display:flex; align-items: center; padding-left: {{ ($tree_level + 1) * 20 }}px;"> <div style="display:flex; align-items: center; padding-left: {{ ($tree_level + 1) * 20 }}px;">
<span>{{ $class->row_names[$table_key][$id] }}</span> <span>{{ $class->row_names[$table_key][$id] }}</span>
</div> </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> </div>
</li> </li>
@endif @endif

View File

@ -2,64 +2,64 @@
<x-tabs active="general" class="grid grid-cols-3" override="class"> <x-tabs active="general" class="grid grid-cols-3" override="class">
<x-slot name="navs"> <x-slot name="navs">
<x-tabs.nav id="general"> <x-tabs.nav id="general">
{{ trans('general.general') }} {{ trans('general.general') }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('name')||form.errors.has('email')||form.errors.has('phone')||form.errors.has('tax_number')||form.errors.has('currency_code')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('name') || form.errors.has('email') || form.errors.has('phone') || form.errors.has('tax_number') || form.errors.has('currency_code')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
<x-tabs.nav id="address"> <x-tabs.nav id="address">
{{ trans('general.address') }} {{ trans('general.address') }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('address')||form.errors.has('city')||form.errors.has('zip_code')||form.errors.has('state')||form.errors.has('country')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('address') || form.errors.has('city') || form.errors.has('zip_code') || form.errors.has('state') || form.errors.has('country')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
<x-tabs.nav id="other"> <x-tabs.nav id="other">
{{ trans_choice('general.others', 1) }} {{ trans_choice('general.others', 1) }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('website')||form.errors.has('reference')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('website') || form.errors.has('reference')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
</x-slot> </x-slot>
<x-slot name="content"> <x-slot name="content">
<x-tabs.tab id="general"> <x-tabs.tab id="general">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5"> <div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5">
<x-form.group.text name="name" label="{{ trans('general.name') }}" form-group-class="col-span-6" /> <x-form.group.text name="name" label="{{ trans('general.name') }}" form-group-class="col-span-6" />
<x-form.group.text name="email" label="{{ trans('general.email') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="email" label="{{ trans('general.email') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="phone" label="{{ trans('general.phone') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="phone" label="{{ trans('general.phone') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" form-group-class="col-span-6" not-required />
<x-form.group.currency without-add-new form-group-class="col-span-6" :add-new-text="trans_choice('general.currencies', 1)" /> <x-form.group.currency without-add-new form-group-class="col-span-6" :add-new-text="trans_choice('general.currencies', 1)" />
</div> </div>
</x-tabs.tab> </x-tabs.tab>
<x-tabs.tab id="address"> <x-tabs.tab id="address">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5"> <div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5">
<x-form.group.textarea name="address" label="{{ trans('general.address') }}" form-group-class="col-span-6" rows=2 not-required /> <x-form.group.textarea name="address" label="{{ trans('general.address') }}" form-group-class="col-span-6" rows=2 not-required />
<x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="state" label="{{ trans('general.state') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="state" label="{{ trans('general.state') }}" form-group-class="col-span-6" not-required />
<x-form.group.country form-group-class="col-span-6 el-select-tags-pl-38" not-required /> <x-form.group.country form-group-class="col-span-6 el-select-tags-pl-38" not-required />
</div> </div>
</x-tabs.tab> </x-tabs.tab>
<x-tabs.tab id="other"> <x-tabs.tab id="other">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5"> <div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5">
<x-form.group.text name="website" label="{{ trans('general.website') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="website" label="{{ trans('general.website') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="reference" label="{{ trans('general.reference') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="reference" label="{{ trans('general.reference') }}" form-group-class="col-span-6" not-required />
<x-form.input.hidden name="type" value="customer" /> <x-form.input.hidden name="type" value="customer" />

View File

@ -4,7 +4,7 @@
<x-tabs.nav id="general"> <x-tabs.nav id="general">
{{ trans('general.general') }} {{ trans('general.general') }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('name')||form.errors.has('email')||form.errors.has('phone')||form.errors.has('tax_number')||form.errors.has('currency_code')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('name') || form.errors.has('email') || form.errors.has('phone') || form.errors.has('tax_number') || form.errors.has('currency_code')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
@ -12,7 +12,7 @@
<x-tabs.nav id="address"> <x-tabs.nav id="address">
{{ trans('general.address') }} {{ trans('general.address') }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('address')||form.errors.has('city')||form.errors.has('zip_code')||form.errors.has('state')||form.errors.has('country')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('address') || form.errors.has('city') || form.errors.has('zip_code') || form.errors.has('state') || form.errors.has('country')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
@ -20,7 +20,7 @@
<x-tabs.nav id="other"> <x-tabs.nav id="other">
{{ trans_choice('general.others', 1) }} {{ trans_choice('general.others', 1) }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('website')||form.errors.has('reference')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('website') || form.errors.has('reference')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
@ -32,19 +32,19 @@
<x-form.group.text name="name" label="{{ trans('general.name') }}" form-group-class="col-span-6" /> <x-form.group.text name="name" label="{{ trans('general.name') }}" form-group-class="col-span-6" />
<x-form.group.text name="email" label="{{ trans('general.email') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="email" label="{{ trans('general.email') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="phone" label="{{ trans('general.phone') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="phone" label="{{ trans('general.phone') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" form-group-class="col-span-6" not-required />
<x-form.group.currency without-add-new form-group-class="col-span-6" /> <x-form.group.currency without-add-new form-group-class="col-span-6" />
</div> </div>
</x-tabs.tab> </x-tabs.tab>
<x-tabs.tab id="address"> <x-tabs.tab id="address">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5"> <div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5">
<x-form.group.textarea name="address" label="{{ trans('general.address') }}" form-group-class="col-span-6" not-required /> <x-form.group.textarea name="address" label="{{ trans('general.address') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" form-group-class="col-span-6" not-required />

View File

@ -4,7 +4,7 @@
<x-tabs.nav id="general"> <x-tabs.nav id="general">
{{ trans('general.general') }} {{ trans('general.general') }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('name')||form.errors.has('email')||form.errors.has('phone')||form.errors.has('tax_number')||form.errors.has('currency_code')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('name') || form.errors.has('email') || form.errors.has('phone') || form.errors.has('tax_number') || form.errors.has('currency_code')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
@ -12,7 +12,7 @@
<x-tabs.nav id="address"> <x-tabs.nav id="address">
{{ trans('general.address') }} {{ trans('general.address') }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('address')||form.errors.has('city')||form.errors.has('zip_code')||form.errors.has('state')||form.errors.has('country')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('address') || form.errors.has('city') || form.errors.has('zip_code') || form.errors.has('state') || form.errors.has('country')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
@ -20,7 +20,7 @@
<x-tabs.nav id="other"> <x-tabs.nav id="other">
{{ trans_choice('general.others', 1) }} {{ trans_choice('general.others', 1) }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('website')||form.errors.has('reference')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('website') || form.errors.has('reference')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
@ -32,11 +32,11 @@
<x-form.group.text name="name" label="{{ trans('general.name') }}" form-group-class="col-span-6" /> <x-form.group.text name="name" label="{{ trans('general.name') }}" form-group-class="col-span-6" />
<x-form.group.text name="email" label="{{ trans('general.email') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="email" label="{{ trans('general.email') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="phone" label="{{ trans('general.phone') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="phone" label="{{ trans('general.phone') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" form-group-class="col-span-6" not-required />
<x-form.group.currency without-add-new form-group-class="col-span-6" /> <x-form.group.currency without-add-new form-group-class="col-span-6" />
</div> </div>
</x-tabs.tab> </x-tabs.tab>
@ -44,7 +44,7 @@
<x-tabs.tab id="address"> <x-tabs.tab id="address">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5"> <div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5">
<x-form.group.textarea name="address" label="{{ trans('general.address') }}" form-group-class="col-span-6" not-required /> <x-form.group.textarea name="address" label="{{ trans('general.address') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" form-group-class="col-span-6" not-required />

View File

@ -4,7 +4,7 @@
<x-tabs.nav id="general"> <x-tabs.nav id="general">
{{ trans('general.general') }} {{ trans('general.general') }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('name')||form.errors.has('email')||form.errors.has('phone')||form.errors.has('tax_number')||form.errors.has('currency_code')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('name') || form.errors.has('email') || form.errors.has('phone') || form.errors.has('tax_number') || form.errors.has('currency_code')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
@ -12,7 +12,7 @@
<x-tabs.nav id="address"> <x-tabs.nav id="address">
{{ trans('general.address') }} {{ trans('general.address') }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('address')||form.errors.has('city')||form.errors.has('zip_code')||form.errors.has('state')||form.errors.has('country')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('address') || form.errors.has('city') || form.errors.has('zip_code') || form.errors.has('state') || form.errors.has('country')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
@ -20,7 +20,7 @@
<x-tabs.nav id="other"> <x-tabs.nav id="other">
{{ trans_choice('general.others', 1) }} {{ trans_choice('general.others', 1) }}
<span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('website')||form.errors.has('reference')"> <span class="invalid-feedback block text-xs text-red whitespace-normal" v-if="form.errors.has('website') || form.errors.has('reference')">
{{ trans('general.validation_error') }} {{ trans('general.validation_error') }}
</span> </span>
</x-tabs.nav> </x-tabs.nav>
@ -32,19 +32,19 @@
<x-form.group.text name="name" label="{{ trans('general.name') }}" form-group-class="col-span-6" /> <x-form.group.text name="name" label="{{ trans('general.name') }}" form-group-class="col-span-6" />
<x-form.group.text name="email" label="{{ trans('general.email') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="email" label="{{ trans('general.email') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="phone" label="{{ trans('general.phone') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="phone" label="{{ trans('general.phone') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="tax_number" label="{{ trans('general.tax_number') }}" form-group-class="col-span-6" not-required />
<x-form.group.currency without-add-new form-group-class="col-span-6" /> <x-form.group.currency without-add-new form-group-class="col-span-6" />
</div> </div>
</x-tabs.tab> </x-tabs.tab>
<x-tabs.tab id="address"> <x-tabs.tab id="address">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5"> <div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5">
<x-form.group.textarea name="address" label="{{ trans('general.address') }}" form-group-class="col-span-6" not-required /> <x-form.group.textarea name="address" label="{{ trans('general.address') }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" form-group-class="col-span-6" not-required />
<x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="zip_code" label="{{ trans('general.zip_code') }}" form-group-class="col-span-6" not-required />

View File

@ -28,7 +28,7 @@
<x-form.group.text name="thousands_separator" label="{{ trans('currencies.thousands_separator') }}" not-required /> <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-slot>
</x-form.section> </x-form.section>

View File

@ -66,7 +66,7 @@
<x-index.disable text="{{ trans_choice('general.currencies', 1) }}" /> <x-index.disable text="{{ trans_choice('general.currencies', 1) }}" />
@endif @endif
@if ($item->code == setting("default.currency")) @if ($item->code == default_currency())
<x-index.default text="{{ trans('currencies.default') }}" /> <x-index.default text="{{ trans('currencies.default') }}" />
@endif @endif
</x-slot> </x-slot>

View File

@ -4,6 +4,8 @@ lg:pl-24
lg:my-12 lg:my-12
lg:mt-4 lg:mt-4
lg:pl-6 lg:pl-6
ltr:-right-1.5
rtl:-left-1.5
sm:max-w-4xl sm:max-w-4xl
hover:bg-silver-700 hover:bg-silver-700
hover:bg-peach_orange-700 hover:bg-peach_orange-700
@ -28,4 +30,4 @@ lg:rtl:mr-72
lg:space-x-8 lg:space-x-8
lg:text-4xl lg:text-4xl
lg:top-7 lg:top-7
lg:max-w-lg lg:max-w-lg