refs #451 Banking, Transfer and Account issue solved

This commit is contained in:
Cüneyt Şentürk 2018-08-18 15:56:24 +03:00
parent ca6788686e
commit b2e25990a1
4 changed files with 14 additions and 1 deletions

View File

@ -83,7 +83,7 @@ class Accounts extends Controller
$account->default_account = ($account->id == setting('general.default_account')) ?: 1;
$currency = Currency::where('code', '=', setting('general.default_currency', 'USD'))->first();
$currency = Currency::where('code', '=', $account->currency_code)->first();
return view('banking.accounts.edit', compact('account', 'currencies', 'currency'));
}

View File

@ -21,6 +21,7 @@ class Money
$invoice_number = $request->get('invoice_number');
$sale_price = $request->get('sale_price');
$purchase_price = $request->get('purchase_price');
$opening_balance = $request->get('opening_balance');
$currency_code = $request->get('currency_code');
if (empty($currency_code)) {
@ -45,6 +46,12 @@ class Money
}
}
if (isset($opening_balance)) {
$opening_balance = money($opening_balance, $currency_code)->getAmount();
$request->request->set('opening_balance', $opening_balance);
}
/* check item price use money
if (isset($sale_price)) {
$sale_price = money($sale_price, $currency_code)->getAmount();

View File

@ -21,6 +21,9 @@
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, setting('general.default_payment_method')) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o', []) }}
{!! Form::hidden('currency_code', null, ['id' => 'currency_code']) !!}
{!! Form::hidden('currency_rate', null, ['id' => 'currency_rate']) !!}
</div>
<!-- /.box-body -->

View File

@ -25,6 +25,9 @@
{{ Form::selectGroup('payment_method', trans_choice('general.payment_methods', 1), 'credit-card', $payment_methods, null) }}
{{ Form::textGroup('reference', trans('general.reference'), 'file-text-o', []) }}
{!! Form::hidden('currency_code', $currency->code, ['id' => 'currency_code']) !!}
{!! Form::hidden('currency_rate', $currency->rate, ['id' => 'currency_rate']) !!}
</div>
<!-- /.box-body -->