diff --git a/app/Http/Controllers/Modals/BillPayments.php b/app/Http/Controllers/Modals/BillPayments.php index f66e08444..6fd35824d 100644 --- a/app/Http/Controllers/Modals/BillPayments.php +++ b/app/Http/Controllers/Modals/BillPayments.php @@ -39,9 +39,7 @@ class BillPayments extends Controller $currencies = Currency::enabled()->orderBy('name')->pluck('name', 'code')->toArray(); - $account_currency_code = Account::where('id', setting('general.default_account'))->pluck('currency_code')->first(); - - $currency = Currency::where('code', $account_currency_code)->first(); + $currency = Currency::where('code', $bill->currency_code)->first(); $payment_methods = Modules::getPaymentMethods(); @@ -60,7 +58,7 @@ class BillPayments extends Controller $bill->grand_total = $bill->total - $paid; } - $html = view('modals.bills.payment', compact('bill', 'accounts', 'account_currency_code', 'currencies', 'currency', 'payment_methods'))->render(); + $html = view('modals.bills.payment', compact('bill', 'accounts', 'currencies', 'currency', 'payment_methods'))->render(); return response()->json([ 'success' => true, diff --git a/app/Http/Controllers/Modals/InvoicePayments.php b/app/Http/Controllers/Modals/InvoicePayments.php index 6bd543a12..ce0214bf4 100644 --- a/app/Http/Controllers/Modals/InvoicePayments.php +++ b/app/Http/Controllers/Modals/InvoicePayments.php @@ -39,9 +39,7 @@ class InvoicePayments extends Controller $currencies = Currency::enabled()->orderBy('name')->pluck('name', 'code')->toArray(); - $account_currency_code = Account::where('id', setting('general.default_account'))->pluck('currency_code')->first(); - - $currency = Currency::where('code', $account_currency_code)->first(); + $currency = Currency::where('code', $invoice->currency_code)->first(); $payment_methods = Modules::getPaymentMethods(); @@ -60,7 +58,7 @@ class InvoicePayments extends Controller $invoice->grand_total = $invoice->total - $paid; } - $html = view('modals.invoices.payment', compact('invoice', 'accounts', 'account_currency_code', 'currencies', 'currency', 'payment_methods'))->render(); + $html = view('modals.invoices.payment', compact('invoice', 'accounts', 'currencies', 'currency', 'payment_methods'))->render(); return response()->json([ 'success' => true, diff --git a/resources/views/modals/bills/payment.blade.php b/resources/views/modals/bills/payment.blade.php index 472abf5e1..4d175f2cf 100644 --- a/resources/views/modals/bills/payment.blade.php +++ b/resources/views/modals/bills/payment.blade.php @@ -20,8 +20,8 @@ {!! Form::label('currency_code', trans_choice('general.currencies', 1), ['class' => 'control-label']) !!}