close #664 Fixed: Not listing invoice/bill add payment if empty account's currency
This commit is contained in:
@ -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,
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user