Merge branch 'akaunting:master' into master

This commit is contained in:
merve karaman 2023-07-11 13:10:10 +03:00 committed by GitHub
commit 79d1b4cb0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
94 changed files with 2053 additions and 2038 deletions

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, default_currency(), true)->formatForHumans(), 'amount' => money($total)->formatForHumans(),
'tooltip' => money($total, default_currency(), true)->format(), 'tooltip' => money($total)->format(),
]; ];
} }

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, default_currency(), true)->formatForHumans(); $amount = money($total)->formatForHumans();
$tooltip = money($total, default_currency(), true)->format(); $tooltip = money($total)->format();
$items[] = [ $items[] = [
'title' => $title, 'title' => $title,

View File

@ -42,9 +42,9 @@ class Accounts extends Controller
->orWhereHas('income_transaction', fn ($query) => $query->where('account_id', $account->id)) ->orWhereHas('income_transaction', fn ($query) => $query->where('account_id', $account->id))
->collect(['expense_transaction.paid_at' => 'desc']); ->collect(['expense_transaction.paid_at' => 'desc']);
$incoming_amount = money($account->income_balance, $account->currency_code, true); $incoming_amount = money($account->income_balance, $account->currency_code);
$outgoing_amount = money($account->expense_balance, $account->currency_code, true); $outgoing_amount = money($account->expense_balance, $account->currency_code);
$current_amount = money($account->balance, $account->currency_code, true); $current_amount = money($account->balance, $account->currency_code);
$summary_amounts = [ $summary_amounts = [
'incoming_exact' => $incoming_amount->format(), 'incoming_exact' => $incoming_amount->format(),

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'), default_currency(), true); $reconciled_amount = money($reconciliations->where('reconciled', 1)->sum('closing_balance'));
$in_progress_amount = money($reconciliations->where('reconciled', 0)->sum('closing_balance'), default_currency(), true); $in_progress_amount = money($reconciliations->where('reconciled', 0)->sum('closing_balance'));
$summary_amounts = [ $summary_amounts = [
'amount_exact' => $reconciled_amount->format(), 'amount_exact' => $reconciled_amount->format(),
@ -246,9 +246,9 @@ class Reconciliations extends Controller
$difference = $closing_balance - $cleared_amount; $difference = $closing_balance - $cleared_amount;
$json->closing_balance = money($closing_balance, $currency_code, true)->format(); $json->closing_balance = money($closing_balance, $currency_code)->format();
$json->cleared_amount = money($cleared_amount, $currency_code, true)->format(); $json->cleared_amount = money($cleared_amount, $currency_code)->format();
$json->difference = money($difference, $currency_code, true)->format(); $json->difference = money($difference, $currency_code)->format();
$json->difference_raw = (int) $difference; $json->difference_raw = (int) $difference;
return response()->json($json); return response()->json($json);

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'], default_currency(), true); $incoming_amount = money($totals['income']);
$expense_amount = money($totals['expense'], default_currency(), true); $expense_amount = money($totals['expense']);
$profit_amount = money($totals['profit'], default_currency(), true); $profit_amount = money($totals['profit']);
$summary_amounts = [ $summary_amounts = [
'incoming_exact' => $incoming_amount->format(), 'incoming_exact' => $incoming_amount->format(),

View File

@ -64,7 +64,7 @@ class Currencies extends Controller
*/ */
public function store(Request $request) public function store(Request $request)
{ {
$currency = config('money.' . $request->get('code')); $currency = config('money.currencies.' . $request->get('code'));
$request['precision'] = (int) $currency['precision']; $request['precision'] = (int) $currency['precision'];
$request['symbol'] = $currency['symbol']; $request['symbol'] = $currency['symbol'];

View File

@ -51,9 +51,9 @@ class DocumentTransactions extends Controller
$document->{$document_total->code} = $document_total->amount; $document->{$document_total->code} = $document_total->amount;
} }
$total = money($document->total, $currency->code, true)->format(); $total = money($document->total, $currency->code)->format();
$document->grand_total = money($total, $currency->code)->getAmount(); $document->grand_total = money($total, $currency->code, false)->getAmount();
if (! empty($paid)) { if (! empty($paid)) {
$document->grand_total = round($document->total - $paid, $currency->precision); $document->grand_total = round($document->total - $paid, $currency->precision);
@ -140,7 +140,7 @@ class DocumentTransactions extends Controller
$number = $transaction->number; $number = $transaction->number;
$document->grand_total = money($transaction->amount, $currency->code)->getAmount(); $document->grand_total = money($transaction->amount, $currency->code, false)->getAmount();
$document->paid_at = $transaction->paid_at; $document->paid_at = $transaction->paid_at;

View File

@ -235,7 +235,7 @@ class Currencies extends Controller
if ($code) { if ($code) {
$currencies = Currency::all()->pluck('rate', 'code'); $currencies = Currency::all()->pluck('rate', 'code');
$currency = config('money.' . $code); $currency = config('money.currencies.' . $code);
$currency['rate'] = isset($currencies[$code]) ? $currencies[$code] : null; $currency['rate'] = isset($currencies[$code]) ? $currencies[$code] : null;
$currency['symbol_first'] = ! empty($currency['symbol_first']) ? 1 : 0; $currency['symbol_first'] = ! empty($currency['symbol_first']) ? 1 : 0;

View File

@ -84,7 +84,7 @@ class Money
$amount = $item['price']; $amount = $item['price'];
if (strpos($item['price'], config('money.' . $currency_code . '.symbol')) !== false) { if (strpos($item['price'], config('money.currencies.' . $currency_code . '.symbol')) !== false) {
$amount = $this->getAmount($item['price'], $currency_code); $amount = $this->getAmount($item['price'], $currency_code);
} }
@ -101,11 +101,11 @@ class Money
protected function getAmount($money_format, $currency_code) protected function getAmount($money_format, $currency_code)
{ {
try { try {
if (config('money.' . $currency_code . '.decimal_mark') !== '.') { if (config('money.currencies.' . $currency_code . '.decimal_mark') !== '.') {
$money_format = Str::replaceFirst('.', config('money.' . $currency_code . '.decimal_mark'), $money_format); $money_format = Str::replaceFirst('.', config('money.currencies.' . $currency_code . '.decimal_mark'), $money_format);
} }
$amount = money($money_format, $currency_code)->getAmount(); $amount = money($money_format, $currency_code, false)->getAmount();
} catch (InvalidArgumentException | OutOfBoundsException | UnexpectedValueException $e) { } catch (InvalidArgumentException | OutOfBoundsException | UnexpectedValueException $e) {
report($e); report($e);

View File

@ -22,9 +22,9 @@ class Account extends JsonResource
'number' => $this->number, 'number' => $this->number,
'currency_code' => $this->currency_code, 'currency_code' => $this->currency_code,
'opening_balance' => $this->opening_balance, 'opening_balance' => $this->opening_balance,
'opening_balance_formatted' => money($this->opening_balance, $this->currency_code, true)->format(), 'opening_balance_formatted' => money($this->opening_balance, $this->currency_code)->format(),
'current_balance' => $this->balance, 'current_balance' => $this->balance,
'current_balance_formatted' => money($this->balance, $this->currency_code, true)->format(), 'current_balance_formatted' => money($this->balance, $this->currency_code)->format(),
'bank_name' => $this->bank_name, 'bank_name' => $this->bank_name,
'bank_phone' => $this->bank_phone, 'bank_phone' => $this->bank_phone,
'bank_address' => $this->bank_address, 'bank_address' => $this->bank_address,

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, default_currency(), true)->format(), 'closing_balance_formatted' => money($this->closing_balance)->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

@ -25,7 +25,7 @@ class Transaction extends JsonResource
'account_id' => $this->account_id, 'account_id' => $this->account_id,
'paid_at' => $this->paid_at->toIso8601String(), 'paid_at' => $this->paid_at->toIso8601String(),
'amount' => $this->amount, 'amount' => $this->amount,
'amount_formatted' => money($this->amount, $this->currency_code, true)->format(), 'amount_formatted' => money($this->amount, $this->currency_code)->format(),
'currency_code' => $this->currency_code, 'currency_code' => $this->currency_code,
'currency_rate' => $this->currency_rate, 'currency_rate' => $this->currency_rate,
'document_id' => $this->document_id, 'document_id' => $this->document_id,

View File

@ -25,7 +25,7 @@ class Transfer extends JsonResource
'to_account' => $income_transaction->account->name, 'to_account' => $income_transaction->account->name,
'to_account_id' => $income_transaction->account->id, 'to_account_id' => $income_transaction->account->id,
'amount' => $expense_transaction->amount, 'amount' => $expense_transaction->amount,
'amount_formatted' => money($expense_transaction->amount, $expense_transaction->currency_code, true)->format(), 'amount_formatted' => money($expense_transaction->amount, $expense_transaction->currency_code)->format(),
'currency_code' => $expense_transaction->currency_code, 'currency_code' => $expense_transaction->currency_code,
'paid_at' => $expense_transaction->paid_at ? $expense_transaction->paid_at->toIso8601String() : '', 'paid_at' => $expense_transaction->paid_at ? $expense_transaction->paid_at->toIso8601String() : '',
'created_from' => $this->created_from, 'created_from' => $this->created_from,

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((double) $this->sale_price, default_currency(), true)->format(), 'sale_price_formatted' => money((double) $this->sale_price)->format(),
'purchase_price' => $this->purchase_price, 'purchase_price' => $this->purchase_price,
'purchase_price_formatted' => money((double) $this->purchase_price, default_currency(), true)->format(), 'purchase_price_formatted' => money((double) $this->purchase_price)->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

@ -32,7 +32,7 @@ class Document extends JsonResource
'issued_at' => $this->issued_at ? $this->issued_at->toIso8601String() : '', 'issued_at' => $this->issued_at ? $this->issued_at->toIso8601String() : '',
'due_at' => $this->due_at ? $this->due_at->toIso8601String() : '', 'due_at' => $this->due_at ? $this->due_at->toIso8601String() : '',
'amount' => $this->amount, 'amount' => $this->amount,
'amount_formatted' => money($this->amount, $this->currency_code, true)->format(), 'amount_formatted' => money($this->amount, $this->currency_code)->format(),
'category_id' => $this->category_id, 'category_id' => $this->category_id,
'currency_code' => $this->currency_code, 'currency_code' => $this->currency_code,
'currency_rate' => $this->currency_rate, 'currency_rate' => $this->currency_rate,

View File

@ -24,9 +24,9 @@ class DocumentItem extends JsonResource
'name' => $this->name, 'name' => $this->name,
'description' => $this->description, 'description' => $this->description,
'price' => $this->price, 'price' => $this->price,
'price_formatted' => money($this->price, $this->document->currency_code, true)->format(), 'price_formatted' => money($this->price, $this->document->currency_code)->format(),
'total' => $this->total, 'total' => $this->total,
'total_formatted' => money($this->total, $this->document->currency_code, true)->format(), 'total_formatted' => money($this->total, $this->document->currency_code)->format(),
'created_from' => $this->created_from, 'created_from' => $this->created_from,
'created_by' => $this->created_by, 'created_by' => $this->created_by,
'created_at' => $this->created_at ? $this->created_at->toIso8601String() : '', 'created_at' => $this->created_at ? $this->created_at->toIso8601String() : '',

View File

@ -24,7 +24,7 @@ class DocumentItemTax extends JsonResource
'tax_id' => $this->tax_id, 'tax_id' => $this->tax_id,
'name' => $this->name, 'name' => $this->name,
'amount' => $this->amount, 'amount' => $this->amount,
'amount_formatted' => money($this->amount, $this->document->currency_code, true)->format(), 'amount_formatted' => money($this->amount, $this->document->currency_code)->format(),
'created_from' => $this->created_from, 'created_from' => $this->created_from,
'created_by' => $this->created_by, 'created_by' => $this->created_by,
'created_at' => $this->created_at ? $this->created_at->toIso8601String() : '', 'created_at' => $this->created_at ? $this->created_at->toIso8601String() : '',

View File

@ -22,7 +22,7 @@ class DocumentTotal extends JsonResource
'code' => $this->code, 'code' => $this->code,
'name' => $this->name, 'name' => $this->name,
'amount' => $this->amount, 'amount' => $this->amount,
'amount_formatted' => money($this->amount, $this->document->currency_code, true)->format(), 'amount_formatted' => money($this->amount, $this->document->currency_code)->format(),
'sort_order' => $this->sort_order, 'sort_order' => $this->sort_order,
'created_from' => $this->created_from, 'created_from' => $this->created_from,
'created_by' => $this->created_by, 'created_by' => $this->created_by,

View File

@ -69,7 +69,7 @@ class CreateBankingDocumentTransaction extends Job implements ShouldCreate
$this->request['company_id'] = $this->model->company_id; $this->request['company_id'] = $this->model->company_id;
$this->request['currency_code'] = $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.currencies.' . $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');
$this->request['document_id'] = isset($this->request['document_id']) ? $this->request['document_id'] : $this->model->id; $this->request['document_id'] = isset($this->request['document_id']) ? $this->request['document_id'] : $this->model->id;
$this->request['contact_id'] = isset($this->request['contact_id']) ? $this->request['contact_id'] : $this->model->contact_id; $this->request['contact_id'] = isset($this->request['contact_id']) ? $this->request['contact_id'] : $this->model->contact_id;
@ -83,7 +83,7 @@ class CreateBankingDocumentTransaction extends Job implements ShouldCreate
$code = $this->request['currency_code']; $code = $this->request['currency_code'];
$rate = $this->request['currency_rate']; $rate = $this->request['currency_rate'];
$precision = config('money.' . $code . '.precision'); $precision = config('money.currencies.' . $code . '.precision');
$amount = $this->request['amount'] = round($this->request['amount'], $precision); $amount = $this->request['amount'] = round($this->request['amount'], $precision);
@ -112,7 +112,7 @@ class CreateBankingDocumentTransaction extends Job implements ShouldCreate
$error_amount = round($converted_amount, $precision); $error_amount = round($converted_amount, $precision);
} }
$message = trans('messages.error.over_payment', ['amount' => money($error_amount, $code, true)]); $message = trans('messages.error.over_payment', ['amount' => money($error_amount, $code)]);
throw new \Exception($message); throw new \Exception($message);
} else { } else {
@ -124,7 +124,7 @@ class CreateBankingDocumentTransaction extends Job implements ShouldCreate
protected function createHistory(): void protected function createHistory(): void
{ {
$history_desc = money((double) $this->transaction->amount, (string) $this->transaction->currency_code, true)->format() . ' ' . trans_choice('general.payments', 1); $history_desc = money((double) $this->transaction->amount, (string) $this->transaction->currency_code)->format() . ' ' . trans_choice('general.payments', 1);
$this->dispatch(new CreateDocumentHistory($this->model, 0, $history_desc)); $this->dispatch(new CreateDocumentHistory($this->model, 0, $history_desc));
} }

View File

@ -107,7 +107,7 @@ class CreateTransfer extends Job implements HasOwner, HasSource, ShouldCreate
$currency_rate = $this->request->get($type . '_account_rate'); $currency_rate = $this->request->get($type . '_account_rate');
if (empty($currency_rate)) { if (empty($currency_rate)) {
$currency_rate = config('money.' . $this->getCurrencyCode($type) . '.rate'); $currency_rate = config('money.currencies.' . $this->getCurrencyCode($type) . '.rate');
} }
return $currency_rate; return $currency_rate;

View File

@ -42,7 +42,7 @@ class MatchBankingDocumentTransaction extends Job
$code = $this->transaction->currency_code; $code = $this->transaction->currency_code;
$rate = $this->transaction->currency_rate; $rate = $this->transaction->currency_rate;
$precision = config('money.' . $code . '.precision'); $precision = config('money.currencies.' . $code . '.precision');
$amount = $this->transaction->amount = round($this->transaction->amount, $precision); $amount = $this->transaction->amount = round($this->transaction->amount, $precision);
@ -71,7 +71,7 @@ class MatchBankingDocumentTransaction extends Job
$error_amount = round($converted_amount, $precision); $error_amount = round($converted_amount, $precision);
} }
$message = trans('messages.error.over_match', ['type' => ucfirst($this->model->type), 'amount' => money($error_amount, $code, true)]); $message = trans('messages.error.over_match', ['type' => ucfirst($this->model->type), 'amount' => money($error_amount, $code)]);
throw new \Exception($message); throw new \Exception($message);
} else { } else {
@ -83,7 +83,7 @@ class MatchBankingDocumentTransaction extends Job
protected function createHistory(): void protected function createHistory(): void
{ {
$history_desc = money((double) $this->transaction->amount, (string) $this->transaction->currency_code, true)->format() . ' ' . trans_choice('general.payments', 1); $history_desc = money((double) $this->transaction->amount, (string) $this->transaction->currency_code)->format() . ' ' . trans_choice('general.payments', 1);
$this->dispatch(new CreateDocumentHistory($this->model, 0, $history_desc)); $this->dispatch(new CreateDocumentHistory($this->model, 0, $history_desc));
} }

View File

@ -56,7 +56,7 @@ class SplitTransaction extends Job implements ShouldUpdate
$total_amount += $item['amount']; $total_amount += $item['amount'];
} }
$precision = config('money.' . $this->model->currency_code . '.precision'); $precision = config('money.currencies.' . $this->model->currency_code . '.precision');
$compare = bccomp($total_amount, $this->model->amount, $precision); $compare = bccomp($total_amount, $this->model->amount, $precision);
@ -65,7 +65,7 @@ class SplitTransaction extends Job implements ShouldUpdate
$message = trans('messages.error.same_amount', [ $message = trans('messages.error.same_amount', [
'transaction' => ucfirst(trans_choice('general.' . Str::plural($this->model->type), 1)), 'transaction' => ucfirst(trans_choice('general.' . Str::plural($this->model->type), 1)),
'amount' => money($error_amount, $this->model->currency_code, true) 'amount' => money($error_amount, $this->model->currency_code)
]); ]);
throw new \Exception($message); throw new \Exception($message);

View File

@ -68,7 +68,7 @@ class UpdateBankingDocumentTransaction extends Job implements ShouldUpdate
$this->request['company_id'] = $this->model->company_id; $this->request['company_id'] = $this->model->company_id;
$this->request['currency_code'] = $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.currencies.' . $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');
$this->request['document_id'] = isset($this->request['document_id']) ? $this->request['document_id'] : $this->model->id; $this->request['document_id'] = isset($this->request['document_id']) ? $this->request['document_id'] : $this->model->id;
$this->request['contact_id'] = isset($this->request['contact_id']) ? $this->request['contact_id'] : $this->model->contact_id; $this->request['contact_id'] = isset($this->request['contact_id']) ? $this->request['contact_id'] : $this->model->contact_id;
@ -82,7 +82,7 @@ class UpdateBankingDocumentTransaction extends Job implements ShouldUpdate
$code = $this->request['currency_code']; $code = $this->request['currency_code'];
$rate = $this->request['currency_rate']; $rate = $this->request['currency_rate'];
$precision = config('money.' . $code . '.precision'); $precision = config('money.currencies.' . $code . '.precision');
$amount = $this->request['amount'] = round($this->request['amount'], $precision); $amount = $this->request['amount'] = round($this->request['amount'], $precision);
@ -112,7 +112,7 @@ class UpdateBankingDocumentTransaction extends Job implements ShouldUpdate
$error_amount = round($converted_amount, $precision); $error_amount = round($converted_amount, $precision);
} }
$message = trans('messages.error.over_payment', ['amount' => money($error_amount, $code, true)]); $message = trans('messages.error.over_payment', ['amount' => money($error_amount, $code)]);
throw new \Exception($message); throw new \Exception($message);
} else { } else {
@ -124,7 +124,7 @@ class UpdateBankingDocumentTransaction extends Job implements ShouldUpdate
protected function createHistory(): void protected function createHistory(): void
{ {
$history_desc = money((double) $this->transaction->amount, (string) $this->transaction->currency_code, true)->format() . ' ' . trans_choice('general.payments', 1); $history_desc = money((double) $this->transaction->amount, (string) $this->transaction->currency_code)->format() . ' ' . trans_choice('general.payments', 1);
$this->dispatch(new CreateDocumentHistory($this->model, 0, $history_desc)); $this->dispatch(new CreateDocumentHistory($this->model, 0, $history_desc));
} }

View File

@ -102,7 +102,7 @@ class UpdateTransfer extends Job implements ShouldUpdate
$currency_rate = $this->request->get($type . '_account_rate'); $currency_rate = $this->request->get($type . '_account_rate');
if (empty($currency_rate)) { if (empty($currency_rate)) {
$currency_rate = config('money.' . $this->getCurrencyCode($type) . '.rate'); $currency_rate = config('money.currencies.' . $this->getCurrencyCode($type) . '.rate');
} }
return $currency_rate; return $currency_rate;

View File

@ -29,7 +29,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.currencies.' . $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'];

View File

@ -28,7 +28,7 @@ class CreateDocumentItemsAndTotals extends Job implements HasOwner, HasSource, S
public function handle(): void public function handle(): void
{ {
$precision = config('money.' . $this->document->currency_code . '.precision'); $precision = config('money.currencies.' . $this->document->currency_code . '.precision');
list($sub_total, $actual_total, $discount_amount_total, $taxes) = $this->createItems(); list($sub_total, $actual_total, $discount_amount_total, $taxes) = $this->createItems();

View File

@ -319,7 +319,7 @@ class Transaction extends Model
// Convert amount if not same currency // Convert amount if not same currency
if ($this->account->currency_code != $this->currency_code) { if ($this->account->currency_code != $this->currency_code) {
$to_code = $this->account->currency_code; $to_code = $this->account->currency_code;
$to_rate = config('money.' . $this->account->currency_code . '.rate'); $to_rate = config('money.currencies.' . $this->account->currency_code . '.rate');
$amount = $this->convertBetween($amount, $this->currency_code, $this->currency_rate, $to_code, $to_rate); $amount = $this->convertBetween($amount, $this->currency_code, $this->currency_rate, $to_code, $to_rate);
} }

View File

@ -329,7 +329,7 @@ class Document extends Model
$code = $this->currency_code; $code = $this->currency_code;
$rate = $this->currency_rate; $rate = $this->currency_rate;
$precision = config('money.' . $code . '.precision'); $precision = config('money.currencies.' . $code . '.precision');
if ($this->transactions->count()) { if ($this->transactions->count()) {
foreach ($this->transactions as $transaction) { foreach ($this->transactions as $transaction) {
@ -361,7 +361,7 @@ class Document extends Model
$code = $this->currency_code; $code = $this->currency_code;
$rate = $this->currency_rate; $rate = $this->currency_rate;
$precision = config('money.' . $code . '.precision'); $precision = config('money.currencies.' . $code . '.precision');
if ($this->transactions->count()) { if ($this->transactions->count()) {
foreach ($this->transactions as $transaction) { foreach ($this->transactions as $transaction) {
@ -391,7 +391,7 @@ class Document extends Model
*/ */
public function getAmountDueAttribute() public function getAmountDueAttribute()
{ {
$precision = config('money.' . $this->currency_code . '.precision'); $precision = config('money.currencies.' . $this->currency_code . '.precision');
return round($this->amount - $this->paid, $precision); return round($this->amount - $this->paid, $precision);
} }

View File

@ -122,7 +122,7 @@ class Currency extends Model
public function getPrecisionAttribute($value) public function getPrecisionAttribute($value)
{ {
if (is_null($value)) { if (is_null($value)) {
return config('money.' . $this->code . '.precision'); return config('money.currencies.' . $this->code . '.precision');
} }
return (int) $value; return (int) $value;
@ -136,7 +136,7 @@ class Currency extends Model
public function getSymbolAttribute($value) public function getSymbolAttribute($value)
{ {
if (is_null($value)) { if (is_null($value)) {
return config('money.' . $this->code . '.symbol'); return config('money.currencies.' . $this->code . '.symbol');
} }
return $value; return $value;
@ -150,7 +150,7 @@ class Currency extends Model
public function getSymbolFirstAttribute($value) public function getSymbolFirstAttribute($value)
{ {
if (is_null($value)) { if (is_null($value)) {
return config('money.' . $this->code . '.symbol_first'); return config('money.currencies.' . $this->code . '.symbol_first');
} }
return $value; return $value;
@ -164,7 +164,7 @@ class Currency extends Model
public function getDecimalMarkAttribute($value) public function getDecimalMarkAttribute($value)
{ {
if (is_null($value)) { if (is_null($value)) {
return config('money.' . $this->code . '.decimal_mark'); return config('money.currencies.' . $this->code . '.decimal_mark');
} }
return $value; return $value;
@ -178,7 +178,7 @@ class Currency extends Model
public function getThousandsSeparatorAttribute($value) public function getThousandsSeparatorAttribute($value)
{ {
if (is_null($value)) { if (is_null($value)) {
return config('money.' . $this->code . '.thousands_separator'); return config('money.currencies.' . $this->code . '.thousands_separator');
} }
return $value; return $value;

View File

@ -118,7 +118,7 @@ class Transaction extends Notification
]; ];
return [ return [
money($this->transaction->amount, $this->transaction->currency_code, true), money($this->transaction->amount, $this->transaction->currency_code),
company_date($this->transaction->paid_at), company_date($this->transaction->paid_at),
URL::signedRoute('signed.payments.show', $route_params), URL::signedRoute('signed.payments.show', $route_params),
route('transactions.show', $route_params), route('transactions.show', $route_params),

View File

@ -129,13 +129,13 @@ class PaymentReceived extends Notification
return [ return [
$this->invoice->document_number, $this->invoice->document_number,
money($this->invoice->amount, $this->invoice->currency_code, true), money($this->invoice->amount, $this->invoice->currency_code),
company_date($this->invoice->due_at), company_date($this->invoice->due_at),
trans('documents.statuses.' . $this->invoice->status), trans('documents.statuses.' . $this->invoice->status),
URL::signedRoute('signed.invoices.show', $route_params), URL::signedRoute('signed.invoices.show', $route_params),
route('invoices.show', $route_params), route('invoices.show', $route_params),
route('portal.invoices.show', $route_params), route('portal.invoices.show', $route_params),
money($this->transaction->amount, $this->transaction->currency_code, true), money($this->transaction->amount, $this->transaction->currency_code),
company_date($this->transaction->paid_at), company_date($this->transaction->paid_at),
$this->transaction->payment_method, $this->transaction->payment_method,
$this->invoice->contact_name, $this->invoice->contact_name,

View File

@ -97,8 +97,8 @@ class Bill extends Notification
return [ return [
$this->bill->document_number, $this->bill->document_number,
money($this->bill->amount, $this->bill->currency_code, true), money($this->bill->amount, $this->bill->currency_code),
money($this->bill->amount_due, $this->bill->currency_code, true), money($this->bill->amount_due, $this->bill->currency_code),
company_date($this->bill->issued_at), company_date($this->bill->issued_at),
company_date($this->bill->due_at), company_date($this->bill->due_at),
route('bills.show', $route_params), route('bills.show', $route_params),

View File

@ -142,8 +142,8 @@ class Invoice extends Notification
return [ return [
$this->invoice->document_number, $this->invoice->document_number,
money($this->invoice->amount, $this->invoice->currency_code, true), money($this->invoice->amount, $this->invoice->currency_code),
money($this->invoice->amount_due, $this->invoice->currency_code, true), money($this->invoice->amount_due, $this->invoice->currency_code),
company_date($this->invoice->issued_at), company_date($this->invoice->issued_at),
company_date($this->invoice->due_at), company_date($this->invoice->due_at),
URL::signedRoute('signed.invoices.show', $route_params), URL::signedRoute('signed.invoices.show', $route_params),

View File

@ -60,7 +60,7 @@ class Transaction extends Observer
protected function getDescription($transaction) protected function getDescription($transaction)
{ {
$amount = money((double) $transaction->amount, (string) $transaction->currency_code, true)->format(); $amount = money((double) $transaction->amount, (string) $transaction->currency_code)->format();
return trans('messages.success.deleted', ['type' => $amount . ' ' . trans_choice('general.payments', 1)]); return trans('messages.success.deleted', ['type' => $amount . ' ' . trans_choice('general.payments', 1)]);
} }

View File

@ -28,7 +28,7 @@ trait Charts
public function addMoneyToDonutChart($color, $amount, $description = '') public function addMoneyToDonutChart($color, $amount, $description = '')
{ {
$label = money($amount, default_currency(), true)->formatForHumans(); $label = money($amount)->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.' . default_currency() . '.decimal_mark')); $decimal_mark = str_replace("'", "\\'", config('money.currencies.' . default_currency() . '.decimal_mark'));
$thousands_separator = str_replace("'", "\\'", config('money.' . default_currency() . '.thousands_separator')); $thousands_separator = str_replace("'", "\\'", config('money.currencies.' . default_currency() . '.thousands_separator'));
$symbol = str_replace("'", "\\'", config('money.' . default_currency() . '.symbol')); $symbol = str_replace("'", "\\'", config('money.currencies.' . default_currency() . '.symbol'));
$symbol_first = str_replace("'", "\\'", config('money.' . default_currency() . '.symbol_first')); $symbol_first = str_replace("'", "\\'", config('money.currencies.' . default_currency() . '.symbol_first'));
$precision = str_replace("'", "\\'", config('money.' . default_currency() . '.precision')); $precision = str_replace("'", "\\'", config('money.currencies.' . default_currency() . '.precision'));
$percent_position = $position ?: setting('localisation.percent_position'); $percent_position = $position ?: setting('localisation.percent_position');
switch ($type) { switch ($type) {

View File

@ -95,11 +95,11 @@ trait Import
$data = [ $data = [
'company_id' => company_id(), 'company_id' => company_id(),
'code' => $row['currency_code'], 'code' => $row['currency_code'],
'name' => isset($row['currency_name']) ? $row['currency_name'] : config('money.' . $row['currency_code'] . '.name'), 'name' => isset($row['currency_name']) ? $row['currency_name'] : config('money.currencies.' . $row['currency_code'] . '.name'),
'rate' => isset($row['currency_rate']) ? $row['currency_rate'] : 1, 'rate' => isset($row['currency_rate']) ? $row['currency_rate'] : 1,
'symbol' => isset($row['currency_symbol']) ? $row['currency_symbol'] : config('money.' . $row['currency_code'] . '.symbol'), 'symbol' => isset($row['currency_symbol']) ? $row['currency_symbol'] : config('money.currencies.' . $row['currency_code'] . '.symbol'),
'precision' => isset($row['currency_precision']) ? $row['currency_precision'] : config('money.' . $row['currency_code'] . '.precision'), 'precision' => isset($row['currency_precision']) ? $row['currency_precision'] : config('money.currencies.' . $row['currency_code'] . '.precision'),
'decimal_mark' => isset($row['currency_decimal_mark']) ? $row['currency_decimal_mark'] : config('money.' . $row['currency_code'] . '.decimal_mark'), 'decimal_mark' => isset($row['currency_decimal_mark']) ? $row['currency_decimal_mark'] : config('money.currencies.' . $row['currency_code'] . '.decimal_mark'),
'created_from' => !empty($row['created_from']) ? $row['created_from'] : $this->getSourcePrefix() . 'import', 'created_from' => !empty($row['created_from']) ? $row['created_from'] : $this->getSourcePrefix() . 'import',
'created_by' => !empty($row['created_by']) ? $row['created_by'] : user()->id, 'created_by' => !empty($row['created_by']) ? $row['created_by'] : user()->id,
]; ];

View File

@ -62,6 +62,9 @@ class Overrider
// Set locale for Money package // Set locale for Money package
Money::setLocale(app()->getLocale()); Money::setLocale(app()->getLocale());
// Money
config(['money.defaults.currency' => setting('default.currency')]);
// Set app url dynamically if empty // Set app url dynamically if empty
if (! config('app.url')) { if (! config('app.url')) {
config(['app.url' => url('/')]); config(['app.url' => url('/')]);
@ -73,16 +76,16 @@ class Overrider
$currencies = Currency::all(); $currencies = Currency::all();
foreach ($currencies as $currency) { foreach ($currencies as $currency) {
config(['money.' . $currency->code . '.name' => $currency->name]); config(['money.currencies.' . $currency->code . '.name' => $currency->name]);
config(['money.' . $currency->code . '.rate' => $currency->rate]); config(['money.currencies.' . $currency->code . '.rate' => $currency->rate]);
config(['money.' . $currency->code . '.precision' => $currency->precision]); config(['money.currencies.' . $currency->code . '.precision' => $currency->precision]);
config(['money.' . $currency->code . '.symbol' => $currency->symbol]); config(['money.currencies.' . $currency->code . '.symbol' => $currency->symbol]);
config(['money.' . $currency->code . '.symbol_first' => $currency->symbol_first]); config(['money.currencies.' . $currency->code . '.symbol_first' => $currency->symbol_first]);
config(['money.' . $currency->code . '.decimal_mark' => $currency->decimal_mark]); config(['money.currencies.' . $currency->code . '.decimal_mark' => $currency->decimal_mark]);
config(['money.' . $currency->code . '.thousands_separator' => $currency->thousands_separator]); config(['money.currencies.' . $currency->code . '.thousands_separator' => $currency->thousands_separator]);
} }
// Set currencies with new settings // Set currencies with new settings
\Akaunting\Money\Currency::setCurrencies(config('money')); \Akaunting\Money\Currency::setCurrencies(config('money.currencies'));
} }
} }

View File

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

View File

@ -15,7 +15,7 @@ class GetPaid extends Component
*/ */
public function render() public function render()
{ {
$this->description = trans('general.amount_due') . ': ' . '<span class="font-medium">' . money($this->document->amount_due, $this->document->currency_code, true) . '</span>'; $this->description = trans('general.amount_due') . ': ' . '<span class="font-medium">' . money($this->document->amount_due, $this->document->currency_code) . '</span>';
return view('components.documents.show.get-paid'); return view('components.documents.show.get-paid');
} }

View File

@ -15,7 +15,7 @@ class MakePayment extends Component
*/ */
public function render() public function render()
{ {
$this->description = trans('general.amount_due') . ': ' . '<span class="font-medium">' . money($this->document->amount_due, $this->document->currency_code, true) . '</span>'; $this->description = trans('general.amount_due') . ': ' . '<span class="font-medium">' . money($this->document->amount_due, $this->document->currency_code) . '</span>';
return view('components.documents.show.make-payment'); return view('components.documents.show.make-payment');
} }

View File

@ -38,7 +38,7 @@ class Currency extends Component
{ {
$code = ($this->code) ? $this->code : default_currency(); $code = ($this->code) ? $this->code : default_currency();
$this->currency = config('money.' . $code . '.name'); $this->currency = config('money.currencies.' . $code . '.name');
return view('components.index.currency'); return view('components.index.currency');
} }

View File

@ -16,7 +16,7 @@ class AccountBalance extends Widget
public function show() public function show()
{ {
$accounts = Account::with('income_transactions', 'expense_transactions')->enabled()->take(5)->get()->map(function($account) { $accounts = Account::with('income_transactions', 'expense_transactions')->enabled()->take(5)->get()->map(function($account) {
$account->balance_formatted = money($account->balance, $account->currency_code, true); $account->balance_formatted = money($account->balance, $account->currency_code);
return $account; return $account;
})->all(); })->all();

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), default_currency(), true); $incoming_amount = money(array_sum($income));
$outgoing_amount = money(abs(array_sum($expense)), default_currency(), true); $outgoing_amount = money(abs(array_sum($expense)));
$profit_amount = money(array_sum($profit), default_currency(), true); $profit_amount = money(array_sum($profit));
$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.' . default_currency() . '.precision'); $precision = config('money.currencies.' . 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.' . default_currency() . '.precision'); $precision = config('money.currencies.' . 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, default_currency(), true); $periods[$period_name] = money($period_amount);
} }
$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, default_currency(), true), 'grand' => money($grand),
'open' => money($open, default_currency(), true), 'open' => money($open),
'overdue' => money($overdue, default_currency(), true), 'overdue' => money($overdue),
]; ];
$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.' . default_currency() . '.precision'); $precision = config('money.currencies.' . 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, default_currency(), true); $periods[$period_name] = money($period_amount);
} }
$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, default_currency(), true), 'grand' => money($grand),
'open' => money($open, default_currency(), true), 'open' => money($open),
'overdue' => money($overdue, default_currency(), true), 'overdue' => money($overdue),
]; ];
$grand_total_text = trans('widgets.total_unpaid_invoices'); $grand_total_text = trans('widgets.total_unpaid_invoices');

View File

@ -33,7 +33,7 @@
"akaunting/laravel-language": "^1.0", "akaunting/laravel-language": "^1.0",
"akaunting/laravel-menu": "^3.0", "akaunting/laravel-menu": "^3.0",
"akaunting/laravel-module": "^3.0", "akaunting/laravel-module": "^3.0",
"akaunting/laravel-money": "^4.0", "akaunting/laravel-money": "^5.0",
"akaunting/laravel-mutable-observer": "^2.0", "akaunting/laravel-mutable-observer": "^2.0",
"akaunting/laravel-setting": "^1.2", "akaunting/laravel-setting": "^1.2",
"akaunting/laravel-sortable": "^2.0", "akaunting/laravel-sortable": "^2.0",

50
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "e5aa0bb32c6ddfd816280b738eb71113", "content-hash": "c3f66e10a7d0f5845e1d1a4f99dfced6",
"packages": [ "packages": [
{ {
"name": "akaunting/laravel-apexcharts", "name": "akaunting/laravel-apexcharts",
@ -409,16 +409,16 @@
}, },
{ {
"name": "akaunting/laravel-money", "name": "akaunting/laravel-money",
"version": "4.0.1", "version": "5.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/akaunting/laravel-money.git", "url": "https://github.com/akaunting/laravel-money.git",
"reference": "df99d0f5d415490ef7e79362c3b694e8cc8af903" "reference": "dc6dd201aaf1c2b9ced3f98e208ddc6af1f0a722"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/akaunting/laravel-money/zipball/df99d0f5d415490ef7e79362c3b694e8cc8af903", "url": "https://api.github.com/repos/akaunting/laravel-money/zipball/dc6dd201aaf1c2b9ced3f98e208ddc6af1f0a722",
"reference": "df99d0f5d415490ef7e79362c3b694e8cc8af903", "reference": "dc6dd201aaf1c2b9ced3f98e208ddc6af1f0a722",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -472,9 +472,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/akaunting/laravel-money/issues", "issues": "https://github.com/akaunting/laravel-money/issues",
"source": "https://github.com/akaunting/laravel-money/tree/4.0.1" "source": "https://github.com/akaunting/laravel-money/tree/5.1.0"
}, },
"time": "2023-03-16T14:39:27+00:00" "time": "2023-07-11T08:35:47+00:00"
}, },
{ {
"name": "akaunting/laravel-mutable-observer", "name": "akaunting/laravel-mutable-observer",
@ -1245,16 +1245,16 @@
}, },
{ {
"name": "barryvdh/reflection-docblock", "name": "barryvdh/reflection-docblock",
"version": "v2.1.0", "version": "v2.1.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/barryvdh/ReflectionDocBlock.git", "url": "https://github.com/barryvdh/ReflectionDocBlock.git",
"reference": "bf44b757feb8ba1734659029357646466ded673e" "reference": "e6811e927f0ecc37cc4deaa6627033150343e597"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/barryvdh/ReflectionDocBlock/zipball/bf44b757feb8ba1734659029357646466ded673e", "url": "https://api.github.com/repos/barryvdh/ReflectionDocBlock/zipball/e6811e927f0ecc37cc4deaa6627033150343e597",
"reference": "bf44b757feb8ba1734659029357646466ded673e", "reference": "e6811e927f0ecc37cc4deaa6627033150343e597",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1291,9 +1291,9 @@
} }
], ],
"support": { "support": {
"source": "https://github.com/barryvdh/ReflectionDocBlock/tree/v2.1.0" "source": "https://github.com/barryvdh/ReflectionDocBlock/tree/v2.1.1"
}, },
"time": "2022-10-31T15:35:43+00:00" "time": "2023-06-14T05:06:27+00:00"
}, },
{ {
"name": "bkwld/cloner", "name": "bkwld/cloner",
@ -7867,16 +7867,16 @@
}, },
{ {
"name": "php-http/discovery", "name": "php-http/discovery",
"version": "1.19.0", "version": "1.19.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-http/discovery.git", "url": "https://github.com/php-http/discovery.git",
"reference": "1856a119a0b0ba8da8b5c33c080aa7af8fac25b4" "reference": "57f3de01d32085fea20865f9b16fb0e69347c39e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-http/discovery/zipball/1856a119a0b0ba8da8b5c33c080aa7af8fac25b4", "url": "https://api.github.com/repos/php-http/discovery/zipball/57f3de01d32085fea20865f9b16fb0e69347c39e",
"reference": "1856a119a0b0ba8da8b5c33c080aa7af8fac25b4", "reference": "57f3de01d32085fea20865f9b16fb0e69347c39e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -7939,9 +7939,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/php-http/discovery/issues", "issues": "https://github.com/php-http/discovery/issues",
"source": "https://github.com/php-http/discovery/tree/1.19.0" "source": "https://github.com/php-http/discovery/tree/1.19.1"
}, },
"time": "2023-06-19T08:45:36+00:00" "time": "2023-07-11T07:02:26+00:00"
}, },
{ {
"name": "php-http/guzzle7-adapter", "name": "php-http/guzzle7-adapter",
@ -14256,16 +14256,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "10.2.3", "version": "10.2.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "35c8cac1734ede2ae354a6644f7088356ff5b08e" "reference": "68484779b5a2ed711fbdeba6ca01910d87acdff2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/35c8cac1734ede2ae354a6644f7088356ff5b08e", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/68484779b5a2ed711fbdeba6ca01910d87acdff2",
"reference": "35c8cac1734ede2ae354a6644f7088356ff5b08e", "reference": "68484779b5a2ed711fbdeba6ca01910d87acdff2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -14337,7 +14337,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues", "issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy", "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/10.2.3" "source": "https://github.com/sebastianbergmann/phpunit/tree/10.2.4"
}, },
"funding": [ "funding": [
{ {
@ -14353,7 +14353,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-06-30T06:17:38+00:00" "time": "2023-07-10T04:06:08+00:00"
}, },
{ {
"name": "sebastian/cli-parser", "name": "sebastian/cli-parser",

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,7 @@ class Currency extends Factory
*/ */
public function definition() public function definition()
{ {
$currencies = config('money'); $currencies = config('money.currencies');
Model::pluck('code')->each(function ($db_code) use (&$currencies) { Model::pluck('code')->each(function ($db_code) use (&$currencies) {
unset($currencies[$db_code]); unset($currencies[$db_code]);

View File

@ -36,11 +36,11 @@ class Currencies extends Seeder
'code' => 'USD', 'code' => 'USD',
'rate' => '1.00', 'rate' => '1.00',
'enabled' => '1', 'enabled' => '1',
'precision' => config('money.USD.precision'), 'precision' => config('money.currencies.USD.precision'),
'symbol' => config('money.USD.symbol'), 'symbol' => config('money.currencies.USD.symbol'),
'symbol_first' => config('money.USD.symbol_first'), 'symbol_first' => config('money.currencies.USD.symbol_first'),
'decimal_mark' => config('money.USD.decimal_mark'), 'decimal_mark' => config('money.currencies.USD.decimal_mark'),
'thousands_separator' => config('money.USD.thousands_separator'), 'thousands_separator' => config('money.currencies.USD.thousands_separator'),
], ],
]; ];

View File

@ -97,7 +97,7 @@
</x-table.td> </x-table.td>
<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-money :amount="$item->balance" :currency="$item->currency_code" convert /> <x-money :amount="$item->balance" :currency="$item->currency_code" />
</x-table.td> </x-table.td>
<x-table.td kind="action"> <x-table.td kind="action">

View File

@ -178,7 +178,7 @@
</div> </div>
<span> <span>
<x-money :amount="$account->opening_balance" :currency="$account->currency_code" convert /> <x-money :amount="$account->opening_balance" :currency="$account->currency_code" />
</span> </span>
</div> </div>
@stack('opening_balance_input_end') @stack('opening_balance_input_end')
@ -323,7 +323,7 @@
</x-table.td> </x-table.td>
<x-table.td class="w-6/12 lg:w-3/12" kind="amount"> <x-table.td class="w-6/12 lg:w-3/12" kind="amount">
<x-money :amount="$item->amount" :currency="$item->currency_code" convert /> <x-money :amount="$item->amount" :currency="$item->currency_code" />
</x-table.td> </x-table.td>
<x-table.td kind="action"> <x-table.td kind="action">
@ -391,7 +391,7 @@
$item->name = trans('transfers.messages.delete', [ $item->name = trans('transfers.messages.delete', [
'from' => $item->expense_transaction->account->name, 'from' => $item->expense_transaction->account->name,
'to' => $item->income_transaction->account->name, 'to' => $item->income_transaction->account->name,
'amount' => money($item->expense_transaction->amount, $item->expense_transaction->currency_code, true) 'amount' => money($item->expense_transaction->amount, $item->expense_transaction->currency_code)
]); ]);
@endphp @endphp
@ -429,10 +429,10 @@
<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">
<x-money :amount="$item->expense_transaction->amount" :currency="$item->expense_transaction->currency_code" convert /> <x-money :amount="$item->expense_transaction->amount" :currency="$item->expense_transaction->currency_code" />
</x-slot> </x-slot>
<x-slot name="second"> <x-slot name="second">
<x-money :amount="$item->income_transaction->amount" :currency="$item->income_transaction->currency_code" convert /> <x-money :amount="$item->income_transaction->amount" :currency="$item->income_transaction->currency_code" />
</x-slot> </x-slot>
</x-table.td> </x-table.td>

View File

@ -130,7 +130,7 @@
@if ($item->isIncome()) @if ($item->isIncome())
<x-table.td class="w-6/12 lg:w-2/12" hidden-mobile kind="cursor-none"> <x-table.td class="w-6/12 lg:w-2/12" hidden-mobile kind="cursor-none">
<x-money :amount="$item->amount" :currency="$item->currency_code" convert /> <x-money :amount="$item->amount" :currency="$item->currency_code" />
</x-table.td> </x-table.td>
<x-table.td class="w-6/12 lg:w-2/12" hidden-mobile kind="cursor-none"> <x-table.td class="w-6/12 lg:w-2/12" hidden-mobile kind="cursor-none">
@ -142,7 +142,7 @@
</x-table.td> </x-table.td>
<x-table.td class="w-6/12 lg:w-2/12" hidden-mobile kind="cursor-none"> <x-table.td class="w-6/12 lg:w-2/12" hidden-mobile kind="cursor-none">
<x-money :amount="$item->amount" :currency="$item->currency_code" convert /> <x-money :amount="$item->amount" :currency="$item->currency_code" />
</x-table.td> </x-table.td>
@endif @endif
@ -174,7 +174,7 @@
<td id="closing-balance" class="w-3/12 ltr:text-right rtl:text-left"> <td id="closing-balance" class="w-3/12 ltr:text-right rtl:text-left">
<span class="w-auto pl-6 text-sm"> <span class="w-auto pl-6 text-sm">
<x-money :amount="$opening_balance" :currency="$account->currency_code" convert /> <x-money :amount="$opening_balance" :currency="$account->currency_code" />
</span> </span>
</td> </td>
</tr> </tr>

View File

@ -64,7 +64,7 @@
@if ($item->isIncome()) @if ($item->isIncome())
<x-table.td class="w-6/12 lg:w-2/12" hidden-mobile kind="cursor-none"> <x-table.td class="w-6/12 lg:w-2/12" hidden-mobile kind="cursor-none">
<x-money :amount="$item->amount" hidden-mobile :currency="$item->currency_code" convert /> <x-money :amount="$item->amount" hidden-mobile :currency="$item->currency_code" />
</x-table.td> </x-table.td>
<x-table.td class="w-6/12 lg:w-2/12" hidden-mobile kind="cursor-none"> <x-table.td class="w-6/12 lg:w-2/12" hidden-mobile kind="cursor-none">
@ -76,7 +76,7 @@
</x-table.td> </x-table.td>
<x-table.td class="w-6/12 lg:w-2/12" hidden-mobile kind="cursor-none"> <x-table.td class="w-6/12 lg:w-2/12" hidden-mobile kind="cursor-none">
<x-money :amount="$item->amount" :currency="$item->currency_code" convert /> <x-money :amount="$item->amount" :currency="$item->currency_code" />
</x-table.td> </x-table.td>
@endif @endif
@ -123,7 +123,7 @@
<td id="closing-balance" class="w-3/12 text-right"> <td id="closing-balance" class="w-3/12 text-right">
<span class="w-auto pl-6 text-sm"> <span class="w-auto pl-6 text-sm">
<x-money :amount="$opening_balance" :currency="$account->currency_code" convert /> <x-money :amount="$opening_balance" :currency="$account->currency_code" />
</span> </span>
</td> </td>
</tr> </tr>

View File

@ -103,7 +103,7 @@
<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">
@if ($item->closing_balance) @if ($item->closing_balance)
<x-money :amount="$item->closing_balance" :currency="$item->account->currency_code" convert /> <x-money :amount="$item->closing_balance" :currency="$item->account->currency_code" />
@else @else
<x-empty-data /> <x-empty-data />
@endif @endif

View File

@ -121,7 +121,7 @@
</x-table.td> </x-table.td>
<x-table.td class="w-4/12 sm:w-2/12" kind="amount"> <x-table.td class="w-4/12 sm:w-2/12" kind="amount">
<x-money :amount="$item->amount" :currency="$item->currency_code" convert /> <x-money :amount="$item->amount" :currency="$item->currency_code" />
</x-table.td> </x-table.td>
<x-table.td kind="action"> <x-table.td kind="action">

View File

@ -185,7 +185,7 @@
</x-table.td> </x-table.td>
<x-table.td class="relative w-4/12 sm:w-2/12" kind="amount"> <x-table.td class="relative w-4/12 sm:w-2/12" kind="amount">
<x-money :amount="$item->amount" :currency="$item->currency_code" convert /> <x-money :amount="$item->amount" :currency="$item->currency_code" />
</x-table.td> </x-table.td>
<x-table.td kind="action"> <x-table.td kind="action">

View File

@ -94,7 +94,7 @@
$item->name = trans('transfers.messages.delete', [ $item->name = trans('transfers.messages.delete', [
'from' => $item->expense_transaction->account->name, 'from' => $item->expense_transaction->account->name,
'to' => $item->income_transaction->account->name, 'to' => $item->income_transaction->account->name,
'amount' => money($item->expense_transaction->amount, $item->expense_transaction->currency_code, true) 'amount' => money($item->expense_transaction->amount, $item->expense_transaction->currency_code)
]); ]);
@endphp @endphp
@ -136,10 +136,10 @@
<x-table.td class="w-4/12 sm:w-3/12" kind="amount"> <x-table.td class="w-4/12 sm:w-3/12" kind="amount">
<x-slot name="first"> <x-slot name="first">
<x-money :amount="$item->expense_transaction->amount" :currency="$item->expense_transaction->currency_code" convert /> <x-money :amount="$item->expense_transaction->amount" :currency="$item->expense_transaction->currency_code" />
</x-slot> </x-slot>
<x-slot name="second"> <x-slot name="second">
<x-money :amount="$item->income_transaction->amount" :currency="$item->income_transaction->currency_code" convert /> <x-money :amount="$item->income_transaction->amount" :currency="$item->income_transaction->currency_code" />
</x-slot> </x-slot>
</x-table.td> </x-table.td>

View File

@ -117,14 +117,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="default_currency()" convert /> <x-money :amount="$item->sale_price" />
@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="default_currency()" convert /> <x-money :amount="$item->purchase_price" />
@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="default_currency()" convert /> <x-money :amount="$item->open" />
@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="default_currency()" convert /> <x-money :amount="$item->overdue" />
@else @else
<x-empty-data /> <x-empty-data />
@endif @endif

View File

@ -261,7 +261,7 @@
</x-table.td> </x-table.td>
<x-table.td class="w-4/12 lg:w-3/12" kind="amount"> <x-table.td class="w-4/12 lg:w-3/12" kind="amount">
<x-money :amount="$item->amount" :currency="$item->currency_code" convert /> <x-money :amount="$item->amount" :currency="$item->currency_code" />
</x-table.td> </x-table.td>
<x-table.td kind="action"> <x-table.td kind="action">
@ -359,7 +359,7 @@
</x-table.td> </x-table.td>
<x-table.td class="w-4/12 lg:w-3/12" kind="amount"> <x-table.td class="w-4/12 lg:w-3/12" kind="amount">
<x-money :amount="$item->amount" :currency="$item->currency_code" convert /> <x-money :amount="$item->amount" :currency="$item->currency_code" />
</x-table.td> </x-table.td>
<x-table.td kind="action"> <x-table.td kind="action">

View File

@ -163,7 +163,7 @@
@if (! $hideAmount) @if (! $hideAmount)
<x-table.td class="{{ $classAmount }}" kind="amount"> <x-table.td class="{{ $classAmount }}" kind="amount">
@stack('amount_td_inside_start') @stack('amount_td_inside_start')
<x-money :amount="$item->amount" :currency="$item->currency_code" convert /> <x-money :amount="$item->amount" :currency="$item->currency_code" />
@stack('amount_td_inside_end') @stack('amount_td_inside_end')
</x-table.td> </x-table.td>

View File

@ -62,7 +62,7 @@
</div> </div>
<span class="font-normal"> <span class="font-normal">
<x-money :amount="$document_item->price" :currency="$document->currency_code" convert /> <x-money :amount="$document_item->price" :currency="$document->currency_code" />
</span> </span>
<div class="w-40 font-normal text-sm truncate"> <div class="w-40 font-normal text-sm truncate">
@ -100,7 +100,7 @@
@if ($document->paid) @if ($document->paid)
<span> <span>
<x-money :amount="$document->paid" :currency="$document->currency_code" convert /> <x-money :amount="$document->paid" :currency="$document->currency_code" />
</span> </span>
@endif @endif
</div> </div>
@ -111,7 +111,7 @@
</span> </span>
<span> <span>
<x-money :amount="$document->amount" :currency="$document->currency_code" convert /> <x-money :amount="$document->amount" :currency="$document->currency_code" />
</span> </span>
</div> </div>
</div> </div>

View File

@ -97,7 +97,7 @@
</x-table.td> </x-table.td>
<x-table.td class="w-4/12 sm:w-2/12" kind="amount"> <x-table.td class="w-4/12 sm:w-2/12" kind="amount">
<x-money :amount="$item->amount" :currency="$item->currency_code" convert /> <x-money :amount="$item->amount" :currency="$item->currency_code" />
</x-table.td> </x-table.td>
<x-table.td kind="action"> <x-table.td kind="action">

View File

@ -62,7 +62,7 @@
<span> <span>
<x-date :date="$transaction->paid_at" /> <x-date :date="$transaction->paid_at" />
- {!! trans('documents.transaction', [ - {!! trans('documents.transaction', [
'amount' => '<span class="font-medium">' . money($transaction->amount, $transaction->currency_code, true) . '</span>', 'amount' => '<span class="font-medium">' . money($transaction->amount, $transaction->currency_code) . '</span>',
'account' => '<span class="font-medium">' . $transaction->account->name . '</span>', 'account' => '<span class="font-medium">' . $transaction->account->name . '</span>',
]) !!} ]) !!}
</span> </span>
@ -103,7 +103,7 @@
@php @php
$message = trans('general.delete_confirm', [ $message = trans('general.delete_confirm', [
'name' => '<strong>' . Date::parse($transaction->paid_at)->format(company_date_format()) . ' - ' . money($transaction->amount, $transaction->currency_code, true) . ' - ' . $transaction->account->name . '</strong>', 'name' => '<strong>' . Date::parse($transaction->paid_at)->format(company_date_format()) . ' - ' . money($transaction->amount, $transaction->currency_code) . ' - ' . $transaction->account->name . '</strong>',
'type' => strtolower(trans_choice('general.transactions', 1)) 'type' => strtolower(trans_choice('general.transactions', 1))
]); ]);
@endphp @endphp

View File

@ -45,7 +45,7 @@
<span> <span>
<x-date :date="$transaction->paid_at" /> <x-date :date="$transaction->paid_at" />
- {!! trans('documents.transaction', [ - {!! trans('documents.transaction', [
'amount' => '<span class="font-medium">' . money($transaction->amount, $transaction->currency_code, true) . '</span>', 'amount' => '<span class="font-medium">' . money($transaction->amount, $transaction->currency_code) . '</span>',
'account' => '<span class="font-medium">' . $transaction->account->name . '</span>', 'account' => '<span class="font-medium">' . $transaction->account->name . '</span>',
]) !!} ]) !!}
</span> </span>
@ -86,7 +86,7 @@
@php @php
$message = trans('general.delete_confirm', [ $message = trans('general.delete_confirm', [
'name' => '<strong>' . Date::parse($transaction->paid_at)->format(company_date_format()) . ' - ' . money($transaction->amount, $transaction->currency_code, true) . ' - ' . $transaction->account->name . '</strong>', 'name' => '<strong>' . Date::parse($transaction->paid_at)->format(company_date_format()) . ' - ' . money($transaction->amount, $transaction->currency_code) . ' - ' . $transaction->account->name . '</strong>',
'type' => strtolower(trans_choice('general.transactions', 1)) 'type' => strtolower(trans_choice('general.transactions', 1))
]); ]);
@endphp @endphp

View File

@ -236,7 +236,7 @@
</span> </span>
<span class="float-right spacing"> <span class="float-right spacing">
<x-money :amount="$total->amount - $document->paid" :currency="$document->currency_code" convert /> <x-money :amount="$total->amount - $document->paid" :currency="$document->currency_code" />
</span> </span>
</p> </p>
@endif @endif
@ -353,7 +353,7 @@
</strong> </strong>
<span> <span>
<x-money :amount="$total->amount" :currency="$document->currency_code" convert /> <x-money :amount="$total->amount" :currency="$document->currency_code" />
</span> </span>
</div> </div>
@stack($total->code . '_total_tr_end') @stack($total->code . '_total_tr_end')
@ -366,7 +366,7 @@
</span> </span>
<span> <span>
- <x-money :amount="$document->paid" :currency="$document->currency_code" convert /> - <x-money :amount="$document->paid" :currency="$document->currency_code" />
</span> </span>
</div> </div>
@stack('paid_total_tr_end') @stack('paid_total_tr_end')
@ -379,7 +379,7 @@
</span> </span>
<span> <span>
<x-money :amount="$document->amount_due" :currency="$document->currency_code" convert /> <x-money :amount="$document->amount_due" :currency="$document->currency_code" />
</span> </span>
</div> </div>
@stack('grand_total_tr_end') @stack('grand_total_tr_end')

View File

@ -324,7 +324,7 @@
</span> </span>
<span> <span>
<x-money :amount="$total->amount" :currency="$document->currency_code" convert /> <x-money :amount="$total->amount" :currency="$document->currency_code" />
</span> </span>
</div> </div>
@stack($total->code . '_total_tr_end') @stack($total->code . '_total_tr_end')
@ -337,7 +337,7 @@
</span> </span>
<span> <span>
- <x-money :amount="$document->paid" :currency="$document->currency_code" convert /> - <x-money :amount="$document->paid" :currency="$document->currency_code" />
</span> </span>
</div> </div>
@stack('paid_total_tr_end') @stack('paid_total_tr_end')
@ -350,7 +350,7 @@
</span> </span>
<span> <span>
<x-money :amount="$document->amount_due" :currency="$document->currency_code" convert /> <x-money :amount="$document->amount_due" :currency="$document->currency_code" />
</span> </span>
</div> </div>
@stack('grand_total_tr_end') @stack('grand_total_tr_end')

View File

@ -31,7 +31,7 @@
@stack('price_td_start') @stack('price_td_start')
@if (! $hidePrice) @if (! $hidePrice)
<td class="price text text-alignment-right text-right"> <td class="price text text-alignment-right text-right">
<x-money :amount="$item->price" :currency="$document->currency_code" convert /> <x-money :amount="$item->price" :currency="$document->currency_code" />
</td> </td>
@endif @endif
@stack('price_td_end') @stack('price_td_end')
@ -59,7 +59,7 @@
</td> </td>
@else @else
<td class="discount text text-alignment-right text-right"> <td class="discount text text-alignment-right text-right">
<x-money :amount="$item->discount" :currency="$document->currency_code" convert /> <x-money :amount="$item->discount" :currency="$document->currency_code" />
</td> </td>
@endif @endif
@stack('discount_td_end') @stack('discount_td_end')
@ -69,7 +69,7 @@
@stack('total_td_start') @stack('total_td_start')
@if (! $hideAmount) @if (! $hideAmount)
<td class="total text text-alignment-right text-right"> <td class="total text text-alignment-right text-right">
<x-money :amount="$item->total" :currency="$document->currency_code" convert /> <x-money :amount="$item->total" :currency="$document->currency_code" />
</td> </td>
@endif @endif
@stack('total_td_end') @stack('total_td_end')

View File

@ -321,7 +321,7 @@
</span> </span>
<span> <span>
<x-money :amount="$total->amount" :currency="$document->currency_code" convert /> <x-money :amount="$total->amount" :currency="$document->currency_code" />
</span> </span>
</div> </div>
@stack($total->code . '_total_tr_end') @stack($total->code . '_total_tr_end')
@ -334,7 +334,7 @@
</span> </span>
<span> <span>
- <x-money :amount="$document->paid" :currency="$document->currency_code" convert /> - <x-money :amount="$document->paid" :currency="$document->currency_code" />
</span> </span>
</div> </div>
@stack('paid_total_tr_end') @stack('paid_total_tr_end')
@ -347,7 +347,7 @@
</span> </span>
<span> <span>
<x-money :amount="$document->amount_due" :currency="$document->currency_code" convert /> <x-money :amount="$document->amount_due" :currency="$document->currency_code" />
</span> </span>
</div> </div>
@stack('grand_total_tr_end') @stack('grand_total_tr_end')

View File

@ -4,8 +4,8 @@
<tr class="px-3"> <tr class="px-3">
<th class="{{ $class->column_name_width }} text-uppercase text-left">{{ trans_choice('general.totals', 1) }}</th> <th class="{{ $class->column_name_width }} text-uppercase text-left">{{ trans_choice('general.totals', 1) }}</th>
@foreach($class->footer_totals[$table_key] as $total) @foreach($class->footer_totals[$table_key] as $total)
<th class="{{ $class->column_value_width }} text-right px-0">{{ $class->has_money ? money($total, default_currency(), true) : $total }}</th> <th class="{{ $class->column_value_width }} text-right px-0">{{ $class->has_money ? money($total) : $total }}</th>
@endforeach @endforeach
<th class="{{ $class->column_name_width }} text-right pl-0 pr-4">{{ $class->has_money ? money($grand_total, default_currency(), true) : $grand_total }}</th> <th class="{{ $class->column_name_width }} text-right pl-0 pr-4">{{ $class->has_money ? money($grand_total) : $grand_total }}</th>
</tr> </tr>
</tfoot> </tfoot>

View File

@ -14,9 +14,9 @@
@endif @endif
@foreach($rows as $row) @foreach($rows as $row)
<td class="{{ $class->column_value_width }} py-2 ltr:text-right rtl:text-left text-alignment-right text-black-400 text-xs">{{ $class->has_money ? money($row, default_currency(), true) : $row }}</td> <td class="{{ $class->column_value_width }} py-2 ltr:text-right rtl:text-left text-alignment-right text-black-400 text-xs">{{ $class->has_money ? money($row) : $row }}</td>
@endforeach @endforeach
<td class="{{ $class->column_name_width }} py-2 ltr:text-right rtl:text-left text-alignment-right text-black-400 text-xs uppercase">{{ $class->has_money ? money($row_total, default_currency(), true) : $row }}</td> <td class="{{ $class->column_name_width }} py-2 ltr:text-right rtl:text-left text-alignment-right text-black-400 text-xs uppercase">{{ $class->has_money ? money($row_total) : $row }}</td>
</tr> </tr>
@endif @endif
@endif @endif
@ -57,9 +57,9 @@
</div> </div>
</td> </td>
@foreach($parent_row_values as $row) @foreach($parent_row_values as $row)
<td class="{{ $class->column_value_width }} py-2 ltr:text-right rtl:text-left text-alignment-right text-black-400 text-xs">{{ $class->has_money ? money($row, default_currency(), true) : $row }}</td> <td class="{{ $class->column_value_width }} py-2 ltr:text-right rtl:text-left text-alignment-right text-black-400 text-xs">{{ $class->has_money ? money($row) : $row }}</td>
@endforeach @endforeach
<td class="{{ $class->column_name_width }} py-2 ltr:text-right rtl:text-left text-alignment-right text-black-400 text-xs uppercase">{{ $class->has_money ? money($row_total, default_currency(), true) : $row }}</td> <td class="{{ $class->column_name_width }} py-2 ltr:text-right rtl:text-left text-alignment-right text-black-400 text-xs uppercase">{{ $class->has_money ? money($row_total) : $row }}</td>
</tr> </tr>
@endif @endif
@ -69,9 +69,9 @@
<tr class="hover:bg-gray-100 border-b collapse-sub collapse-sub-report" data-collapse="child-{{ $id }}"> <tr class="hover:bg-gray-100 border-b collapse-sub collapse-sub-report" data-collapse="child-{{ $id }}">
<td class="{{ $class->column_name_width }} py-2 text-left text-black-400" style="padding-left: {{ ($tree_level + 1) * 20 }}px;" title="{{ $class->row_names[$table_key][$id] }}">{{ $class->row_names[$table_key][$id] }}</td> <td class="{{ $class->column_name_width }} py-2 text-left text-black-400" style="padding-left: {{ ($tree_level + 1) * 20 }}px;" title="{{ $class->row_names[$table_key][$id] }}">{{ $class->row_names[$table_key][$id] }}</td>
@foreach($rows as $row) @foreach($rows as $row)
<td class="{{ $class->column_value_width }} py-2 ltr:text-right rtl:text-left text-alignment-right text-black-400 text-xs">{{ $class->has_money ? money($row, default_currency(), true) : $row }}</td> <td class="{{ $class->column_value_width }} py-2 ltr:text-right rtl:text-left text-alignment-right text-black-400 text-xs">{{ $class->has_money ? money($row) : $row }}</td>
@endforeach @endforeach
<td class="{{ $class->column_name_width }} py-2 ltr:text-right rtl:text-left text-alignment-right text-black-400 text-xs uppercase">{{ $class->has_money ? money($row_total, default_currency(), true) : $row }}</td> <td class="{{ $class->column_name_width }} py-2 ltr:text-right rtl:text-left text-alignment-right text-black-400 text-xs uppercase">{{ $class->has_money ? money($row_total) : $row }}</td>
</tr> </tr>
@endif @endif

View File

@ -6,7 +6,7 @@
]) ])
> >
<h2>{{ $table_name }}</h2> <h2>{{ $table_name }}</h2>
<span>{{ $class->has_money ? money($grand_total, default_currency(), true) : $grand_total }}</span> <span>{{ $class->has_money ? money($grand_total) : $grand_total }}</span>
</div> </div>
@if (!empty($class->row_values[$table_key])) @if (!empty($class->row_values[$table_key]))
<ul <ul

View File

@ -28,7 +28,7 @@
@endif @endif
<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, default_currency(), true) : $row_total }}</span> <span>{{ $class->has_money ? money($row_total) : $row_total }}</span>
</div> </div>
</li> </li>
@endif @endif
@ -73,7 +73,7 @@
@endif @endif
@endif @endif
</div> </div>
<span>{{ $class->has_money ? money($row_total, default_currency(), true) : $row_total }}</span> <span>{{ $class->has_money ? money($row_total) : $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, default_currency(), true) : $row_total }}</span> <span>{{ $class->has_money ? money($row_total) : $row_total }}</span>
</div> </div>
</li> </li>
@endif @endif

View File

@ -354,12 +354,12 @@
<td class="price text-alignment-right text-right" style="color:#424242; font-size:12px; padding-right:0;"> <td class="price text-alignment-right text-right" style="color:#424242; font-size:12px; padding-right:0;">
@if (! $hideRelatedDocumentAmount) @if (! $hideRelatedDocumentAmount)
<x-money :amount="$transaction->document->amount" :currency="$transaction->document->currency_code" convert /> <br /> <x-money :amount="$transaction->document->amount" :currency="$transaction->document->currency_code" /> <br />
@endif @endif
@if (! $hideRelatedAmount) @if (! $hideRelatedAmount)
<span style="color: #6E6E6E"> <span style="color: #6E6E6E">
<x-money :amount="$transaction->amount" :currency="$transaction->currency_code" convert /> <x-money :amount="$transaction->amount" :currency="$transaction->currency_code" />
</span> </span>
@endif @endif
</td> </td>
@ -379,7 +379,7 @@
<span class="ml-2 font-semibold"> <span class="ml-2 font-semibold">
{{ trans($textAmount) }} {{ trans($textAmount) }}
</span> </span>
<x-money :amount="$transaction->amount" :currency="$transaction->currency_code" convert /> <x-money :amount="$transaction->amount" :currency="$transaction->currency_code" />
</td> </td>
</tr> </tr>
</table> </table>

View File

@ -264,7 +264,7 @@
{{ trans('general.amount') }} {{ trans('general.amount') }}
</span> </span>
<x-money :amount="$transfer->expense_transaction->amount" :currency="$transfer->expense_transaction->currency_code" convert /> <x-money :amount="$transfer->expense_transaction->amount" :currency="$transfer->expense_transaction->currency_code" />
</td> </td>
</tr> </tr>
</table> </table>

View File

@ -259,7 +259,7 @@
{{ trans('general.amount') }} {{ trans('general.amount') }}
</span> </span>
<x-money :amount="$transfer->expense_transaction->amount" :currency="$transfer->expense_transaction->currency_code" convert /> <x-money :amount="$transfer->expense_transaction->amount" :currency="$transfer->expense_transaction->currency_code" />
</td> </td>
</tr> </tr>
</table> </table>

View File

@ -273,7 +273,7 @@
{{ trans('general.amount') }} {{ trans('general.amount') }}
</span> </span>
<x-money :amount="$transfer->expense_transaction->amount" :currency="$transfer->expense_transaction->currency_code" convert /> <x-money :amount="$transfer->expense_transaction->amount" :currency="$transfer->expense_transaction->currency_code" />
</td> </td>
</tr> </tr>
</table> </table>

View File

@ -9,7 +9,7 @@
</span> </span>
<span class="text-xl text-black my-3"> <span class="text-xl text-black my-3">
<x-money :amount="$payment->amount" :currency="$payment->currency_code" convert /> <x-money :amount="$payment->amount" :currency="$payment->currency_code" />
</span> </span>
@else @else
<span class="text-xs"> <span class="text-xs">

View File

@ -10,7 +10,7 @@
<div class="flex flex-col items-start my-3"> <div class="flex flex-col items-start my-3">
<span class="text-xl text-black"> <span class="text-xl text-black">
<x-money :amount="$contact->overdue" :currency="$contact->currency_code" convert /> <x-money :amount="$contact->overdue" :currency="$contact->currency_code" />
</span> </span>
<x-link href="{{ route('portal.invoices.index') }}" class="px-2 py-1 my-3 rounded-lg text-xs leading-6 bg-green text-white hover:bg-green-700 disabled:bg-green-100" override="class"> <x-link href="{{ route('portal.invoices.index') }}" class="px-2 py-1 my-3 rounded-lg text-xs leading-6 bg-green text-white hover:bg-green-700 disabled:bg-green-100" override="class">

View File

@ -7,9 +7,9 @@
@foreach ($payments as $item) @foreach ($payments as $item)
<span class="text-xs mb-3"> <span class="text-xs mb-3">
@if (! $item->document) @if (! $item->document)
{{ trans('portal.payment_history.description', ['date' => company_date($item->created_at), 'amount' => money($item->amount, $item->currency_code, true)]) }} {{ trans('portal.payment_history.description', ['date' => company_date($item->created_at), 'amount' => money($item->amount, $item->currency_code)]) }}
@else @else
{{ trans('portal.payment_history.invoice_description', ['date' => company_date($item->created_at), 'amount' => money($item->amount, $item->currency_code, true), 'invoice_nember' => $item->document->document_number]) }} {{ trans('portal.payment_history.invoice_description', ['date' => company_date($item->created_at), 'amount' => money($item->amount, $item->currency_code), 'invoice_nember' => $item->document->document_number]) }}
@endif @endif
</span> </span>
@endforeach @endforeach

View File

@ -137,7 +137,7 @@
<x-table.td class="w-6/12 sm:w-2/12" kind="amount"> <x-table.td class="w-6/12 sm:w-2/12" kind="amount">
@stack('amount_td_inside_start') @stack('amount_td_inside_start')
<x-money :amount="$item->amount" :currency="$item->currency_code" convert /> <x-money :amount="$item->amount" :currency="$item->currency_code" />
@stack('amount_td_inside_end') @stack('amount_td_inside_end')
</x-table.td> </x-table.td>

View File

@ -111,7 +111,7 @@
<x-date :date="$transaction->paid_at" /> <x-date :date="$transaction->paid_at" />
</x-link> </x-link>
- {!! trans('documents.transaction', [ - {!! trans('documents.transaction', [
'amount' => '<span class="font-medium">' . money($transaction->amount, $transaction->currency_code, true) . '</span>', 'amount' => '<span class="font-medium">' . money($transaction->amount, $transaction->currency_code) . '</span>',
'account' => '<span class="font-medium">' . $transaction->account->name . '</span>', 'account' => '<span class="font-medium">' . $transaction->account->name . '</span>',
]) !!} ]) !!}
</span> </span>

View File

@ -109,7 +109,7 @@
<x-date :date="$transaction->paid_at" /> <x-date :date="$transaction->paid_at" />
</x-link> </x-link>
- {!! trans('documents.transaction', [ - {!! trans('documents.transaction', [
'amount' => '<span class="font-medium">' . money($transaction->amount, $transaction->currency_code, true) . '</span>', 'amount' => '<span class="font-medium">' . money($transaction->amount, $transaction->currency_code) . '</span>',
'account' => '<span class="font-medium">' . $transaction->account->name . '</span>', 'account' => '<span class="font-medium">' . $transaction->account->name . '</span>',
]) !!} ]) !!}
</span> </span>

View File

@ -118,7 +118,7 @@
<x-date :date="$transaction->paid_at" /> <x-date :date="$transaction->paid_at" />
</x-link> </x-link>
- {!! trans('documents.transaction', [ - {!! trans('documents.transaction', [
'amount' => '<span class="font-medium">' . money($transaction->amount, $transaction->currency_code, true) . '</span>', 'amount' => '<span class="font-medium">' . money($transaction->amount, $transaction->currency_code) . '</span>',
'account' => '<span class="font-medium">' . $transaction->account->name . '</span>', 'account' => '<span class="font-medium">' . $transaction->account->name . '</span>',
]) !!} ]) !!}
</span> </span>

View File

@ -49,7 +49,7 @@
</x-table.td> </x-table.td>
<x-table.td class="w-3/12" kind="amount"> <x-table.td class="w-3/12" kind="amount">
<x-money :amount="$item->amount" :currency="$item->currency_code" convert /> <x-money :amount="$item->amount" :currency="$item->currency_code" />
</x-table.td> </x-table.td>
</x-table.tr> </x-table.tr>
@endforeach @endforeach

View File

@ -46,7 +46,7 @@
</div> </div>
<span class="text-sm"> <span class="text-sm">
{{ trans('portal.payment_detail.description', ['date' => date($payment->paid_at), 'amount' => money($payment->amount, $payment->currency_code, true)]) }} {{ trans('portal.payment_detail.description', ['date' => date($payment->paid_at), 'amount' => money($payment->amount, $payment->currency_code)]) }}
</span> </span>
</div> </div>
@endif @endif

View File

@ -44,7 +44,7 @@
</div> </div>
<span class="text-sm"> <span class="text-sm">
{{ trans('portal.payment_detail.description', ['date' => date($payment->paid_at), 'amount' => money($payment->amount, $payment->currency_code, true)]) }} {{ trans('portal.payment_detail.description', ['date' => date($payment->paid_at), 'amount' => money($payment->amount, $payment->currency_code)]) }}
</span> </span>
</div> </div>
@endif @endif

View File

@ -54,7 +54,7 @@
</div> </div>
<span class="text-sm"> <span class="text-sm">
{{ trans('portal.payment_detail.description', ['date' => date($payment->paid_at), 'amount' => money($payment->amount, $payment->currency_code, true)]) }} {{ trans('portal.payment_detail.description', ['date' => date($payment->paid_at), 'amount' => money($payment->amount, $payment->currency_code)]) }}
</span> </span>
</div> </div>
@endif @endif

View File

@ -8,12 +8,12 @@
@foreach($class->net_profit as $profit) @foreach($class->net_profit as $profit)
<td class="{{ $class->column_value_width }} ltr:text-right rtl:text-left text-black-400 font-medium text-xs print-alignment"> <td class="{{ $class->column_value_width }} ltr:text-right rtl:text-left text-black-400 font-medium text-xs print-alignment">
<x-money :amount="$profit" :currency="default_currency()" convert /> <x-money :amount="$profit" />
</td> </td>
@endforeach @endforeach
<td class="{{ $class->column_name_width }} ltr:text-right rtl:text-left text-black-400 font-medium text-xs print-alignment"> <td class="{{ $class->column_name_width }} ltr:text-right rtl:text-left text-black-400 font-medium text-xs print-alignment">
<x-money :amount="array_sum($class->net_profit)" :currency="default_currency()" convert /> <x-money :amount="array_sum($class->net_profit)" />
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -8,12 +8,12 @@
@foreach($class->footer_totals[$table_key] as $total) @foreach($class->footer_totals[$table_key] as $total)
<td class="{{ $class->column_value_width }} py-4 ltr:text-right rtl:text-left text-black-400 font-medium text-xs print-alignment"> <td class="{{ $class->column_value_width }} py-4 ltr:text-right rtl:text-left text-black-400 font-medium text-xs print-alignment">
<x-money :amount="$total" :currency="default_currency()" convert /> <x-money :amount="$total" />
</td> </td>
@endforeach @endforeach
<td class="{{ $class->column_name_width }} py-4 ltr:text-right rtl:text-left text-black-400 font-medium text-xs print-alignment"> <td class="{{ $class->column_name_width }} py-4 ltr:text-right rtl:text-left text-black-400 font-medium text-xs print-alignment">
<x-money :amount="$grand_total" :currency="default_currency()" convert /> <x-money :amount="$grand_total" />
</td> </td>
</tr> </tr>
</tfoot> </tfoot>

View File

@ -8,12 +8,12 @@
@foreach($class->footer_totals[$table_key] as $total) @foreach($class->footer_totals[$table_key] as $total)
<td class="{{ $class->column_value_width }} py-4 ltr:text-right rtl:text-left text-black-400 font-medium text-xs print-alignment"> <td class="{{ $class->column_value_width }} py-4 ltr:text-right rtl:text-left text-black-400 font-medium text-xs print-alignment">
<x-money :amount="$total" :currency="default_currency()" convert /> <x-money :amount="$total" />
</td> </td>
@endforeach @endforeach
<td class="{{ $class->column_name_width }} py-4 ltr:text-right rtl:text-left text-black-400 font-medium text-xs print-alignment"> <td class="{{ $class->column_name_width }} py-4 ltr:text-right rtl:text-left text-black-400 font-medium text-xs print-alignment">
<x-money :amount="$grand_total" :currency="default_currency()" convert /> <x-money :amount="$grand_total" />
</td> </td>
</tr> </tr>
</tfoot> </tfoot>

View File

@ -75,13 +75,13 @@ class PaymentTestCase extends FeatureTestCase
} elseif ($this->invoice_currency != null) { } elseif ($this->invoice_currency != null) {
$this->dispatch(new CreateCurrency([ $this->dispatch(new CreateCurrency([
'company_id' => company_id(), 'company_id' => company_id(),
'name' => config('money.' . $this->invoice_currency . '.name'), 'name' => config('money.currencies.' . $this->invoice_currency . '.name'),
'code' => $this->invoice_currency, 'code' => $this->invoice_currency,
'rate' => config(['money.' . $this->invoice_currency . '.rate' => 1]), 'rate' => config(['money.' . $this->invoice_currency . '.rate' => 1]),
'enabled' => 1, 'enabled' => 1,
'symbol_first' => config('money.' . $this->invoice_currency . '.symbol_first'), 'symbol_first' => config('money.currencies.' . $this->invoice_currency . '.symbol_first'),
'decimal_mark' => config('money.' . $this->invoice_currency . '.decimal_mark'), 'decimal_mark' => config('money.currencies.' . $this->invoice_currency . '.decimal_mark'),
'thousands_separator' => config('money.' . $this->invoice_currency . '.thousands_separator'), 'thousands_separator' => config('money.currencies.' . $this->invoice_currency . '.thousands_separator'),
'default_currency' => true, 'default_currency' => true,
])); ]));
} }