fixed #652
This commit is contained in:
parent
d066938972
commit
e000f55e65
@ -61,7 +61,7 @@ class Payments extends Controller
|
||||
|
||||
$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', $account_currency_code)->first();
|
||||
|
||||
$vendors = Vendor::enabled()->orderBy('name')->pluck('name', 'id');
|
||||
|
||||
@ -151,9 +151,7 @@ class Payments extends Controller
|
||||
|
||||
$currencies = Currency::enabled()->orderBy('name')->pluck('name', 'code')->toArray();
|
||||
|
||||
$account_currency_code = Account::where('id', $payment->account_id)->pluck('currency_code')->first();
|
||||
|
||||
$currency = Currency::where('code', '=', $account_currency_code)->first();
|
||||
$currency = Currency::where('code', $payment->currency_code)->first();
|
||||
|
||||
$vendors = Vendor::enabled()->orderBy('name')->pluck('name', 'id');
|
||||
|
||||
@ -161,7 +159,7 @@ class Payments extends Controller
|
||||
|
||||
$payment_methods = Modules::getPaymentMethods();
|
||||
|
||||
return view('expenses.payments.edit', compact('payment', 'accounts', 'currencies', 'account_currency_code', 'currency', 'vendors', 'categories', 'payment_methods'));
|
||||
return view('expenses.payments.edit', compact('payment', 'accounts', 'currencies', 'currency', 'vendors', 'categories', 'payment_methods'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -63,7 +63,7 @@ class Revenues extends Controller
|
||||
|
||||
$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', $account_currency_code)->first();
|
||||
|
||||
$customers = Customer::enabled()->orderBy('name')->pluck('name', 'id');
|
||||
|
||||
@ -153,9 +153,7 @@ class Revenues extends Controller
|
||||
|
||||
$currencies = Currency::enabled()->orderBy('name')->pluck('name', 'code')->toArray();
|
||||
|
||||
$account_currency_code = Account::where('id', $revenue->account_id)->pluck('currency_code')->first();
|
||||
|
||||
$currency = Currency::where('code', '=', $account_currency_code)->first();
|
||||
$currency = Currency::where('code', $revenue->currency_code)->first();
|
||||
|
||||
$customers = Customer::enabled()->orderBy('name')->pluck('name', 'id');
|
||||
|
||||
@ -163,7 +161,7 @@ class Revenues extends Controller
|
||||
|
||||
$payment_methods = Modules::getPaymentMethods();
|
||||
|
||||
return view('incomes.revenues.edit', compact('revenue', 'accounts', 'currencies', 'account_currency_code', 'currency', 'customers', 'categories', 'payment_methods'));
|
||||
return view('incomes.revenues.edit', compact('revenue', 'accounts', 'currencies', 'currency', 'customers', 'categories', 'payment_methods'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -28,7 +28,7 @@
|
||||
<div class="box-body">
|
||||
{{ Form::textGroup('paid_at', trans('general.date'), 'calendar', ['id' => 'paid_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => '', 'autocomplete' => 'off'], Date::parse($payment->paid_at)->toDateString()) }}
|
||||
|
||||
{!! Form::hidden('currency_code', $account_currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
|
||||
{!! Form::hidden('currency_code', $payment->currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
|
||||
{!! Form::hidden('currency_rate', null, ['id' => 'currency_rate']) !!}
|
||||
|
||||
{{ Form::textGroup('amount', trans('general.amount'), 'money', ['required' => 'required', 'autofocus' => 'autofocus']) }}
|
||||
@ -40,7 +40,7 @@
|
||||
<div class="input-group-addon"><i class="fa fa-university"></i></div>
|
||||
{!! Form::select('account_id', $accounts, null, array_merge(['class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)])])) !!}
|
||||
<div class="input-group-append">
|
||||
{!! Form::text('currency', $account_currency_code, ['id' => 'currency', 'class' => 'form-control', 'required' => 'required', 'disabled' => 'disabled']) !!}
|
||||
{!! Form::text('currency', $payment->currency_code, ['id' => 'currency', 'class' => 'form-control', 'required' => 'required', 'disabled' => 'disabled']) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -46,6 +46,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($payments as $item)
|
||||
@php $is_transfer = ($item->category && ($item->category->id == $transfer_cat_id)); @endphp
|
||||
<tr>
|
||||
@if ($item->reconciled)
|
||||
<td>{{ Date::parse($item->paid_at)->format($date_format) }}</td>
|
||||
@ -55,9 +56,9 @@
|
||||
<td class="text-right amount-space">@money($item->amount, $item->currency_code, true)</td>
|
||||
<td class="hidden-xs">{{ !empty($item->vendor->name) ? $item->vendor->name : trans('general.na') }}</td>
|
||||
<td class="hidden-xs">{{ $item->category ? $item->category->name : trans('general.na') }}</td>
|
||||
<td class="hidden-xs">{{ $item->account->name }}</td>
|
||||
<td class="hidden-xs">{{ $item->account ? $item->account->name : trans('general.na') }}</td>
|
||||
<td class="text-center">
|
||||
@if ($item->category->id != $transfer_cat_id)
|
||||
@if (!$is_transfer)
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" data-toggle-position="left" aria-expanded="false">
|
||||
<i class="fa fa-ellipsis-h"></i>
|
||||
|
@ -28,7 +28,7 @@
|
||||
<div class="box-body">
|
||||
{{ Form::textGroup('paid_at', trans('general.date'), 'calendar', ['id' => 'paid_at', 'class' => 'form-control', 'required' => 'required', 'data-inputmask' => '\'alias\': \'yyyy-mm-dd\'', 'data-mask' => '', 'autocomplete' => 'off'], Date::parse($revenue->paid_at)->toDateString()) }}
|
||||
|
||||
{!! Form::hidden('currency_code', $account_currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
|
||||
{!! Form::hidden('currency_code', $revenue->currency_code, ['id' => 'currency_code', 'class' => 'form-control', 'required' => 'required']) !!}
|
||||
{!! Form::hidden('currency_rate', null, ['id' => 'currency_rate']) !!}
|
||||
|
||||
{{ Form::textGroup('amount', trans('general.amount'), 'money', ['required' => 'required', 'autofocus' => 'autofocus']) }}
|
||||
@ -40,7 +40,7 @@
|
||||
<div class="input-group-addon"><i class="fa fa-university"></i></div>
|
||||
{!! Form::select('account_id', $accounts, null, array_merge(['class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.accounts', 1)])])) !!}
|
||||
<div class="input-group-append">
|
||||
{!! Form::text('currency', $account_currency_code, ['id' => 'currency', 'class' => 'form-control', 'required' => 'required', 'disabled' => 'disabled']) !!}
|
||||
{!! Form::text('currency', $revenue->currency_code, ['id' => 'currency', 'class' => 'form-control', 'required' => 'required', 'disabled' => 'disabled']) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -46,6 +46,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($revenues as $item)
|
||||
@php $is_transfer = ($item->category && ($item->category->id == $transfer_cat_id)); @endphp
|
||||
<tr>
|
||||
@if ($item->reconciled)
|
||||
<td>{{ Date::parse($item->paid_at)->format($date_format) }}</td>
|
||||
@ -55,9 +56,9 @@
|
||||
<td class="text-right amount-space">@money($item->amount, $item->currency_code, true)</td>
|
||||
<td class="hidden-xs">{{ !empty($item->customer->name) ? $item->customer->name : trans('general.na') }}</td>
|
||||
<td class="hidden-xs">{{ $item->category ? $item->category->name : trans('general.na') }}</td>
|
||||
<td class="hidden-xs">{{ $item->account->name }}</td>
|
||||
<td class="hidden-xs">{{ $item->account ? $item->account->name : trans('general.na') }}</td>
|
||||
<td class="text-center">
|
||||
@if ($item->category->id != $transfer_cat_id)
|
||||
@if (!$is_transfer)
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" data-toggle-position="left" aria-expanded="false">
|
||||
<i class="fa fa-ellipsis-h"></i>
|
||||
|
Loading…
x
Reference in New Issue
Block a user