2018-03-06 02:21:38 +08:00
|
|
|
<div id="subfleet-expenses-wrapper" class="col-12">
|
|
|
|
<div class="header">
|
|
|
|
<h3>expenses</h3>
|
|
|
|
@component('admin.components.info')
|
|
|
|
These expenses are only applied to this subfleet
|
|
|
|
@endcomponent
|
|
|
|
</div>
|
|
|
|
<br/>
|
|
|
|
<table class="table table-responsive" id="subfleet-expenses">
|
|
|
|
@if(count($subfleet->expenses))
|
|
|
|
<thead>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Cost <span class="small">{!! currency(config('phpvms.currency')) !!}</span></th>
|
2018-03-06 11:24:49 +08:00
|
|
|
<th>Type</th>
|
2018-03-06 02:21:38 +08:00
|
|
|
<th></th>
|
|
|
|
</thead>
|
|
|
|
@endif
|
|
|
|
<tbody>
|
|
|
|
@foreach($subfleet->expenses as $expense)
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<p>
|
2018-03-06 11:24:49 +08:00
|
|
|
<a class="text" href="#" data-pk="{!! $expense->id !!}"
|
2018-03-06 02:21:38 +08:00
|
|
|
data-name="name">{!! $expense->name !!}</a>
|
|
|
|
</p>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<p>
|
2018-03-06 11:24:49 +08:00
|
|
|
<a class="text" href="#" data-pk="{!! $expense->id !!}"
|
2018-03-06 02:21:38 +08:00
|
|
|
data-name="amount">{!! $expense->amount !!}</a>
|
|
|
|
</p>
|
|
|
|
</td>
|
2018-03-06 11:24:49 +08:00
|
|
|
<td>
|
|
|
|
<p>
|
|
|
|
<a href="#"
|
|
|
|
class="dropdown"
|
|
|
|
data-pk="{!! $expense->id !!}"
|
|
|
|
data-name="type">{!! \App\Models\Enums\ExpenseType::label($expense->type) !!}</a>
|
|
|
|
</p>
|
|
|
|
</td>
|
2018-03-06 02:21:38 +08:00
|
|
|
<td align="right">
|
|
|
|
{!! Form::open(['url' => url('/admin/subfleets/'.$subfleet->id.'/expenses'),
|
|
|
|
'method' => 'delete', 'class' => 'modify_expense form-inline']) !!}
|
|
|
|
{!! Form::hidden('expense_id', $expense->id) !!}
|
|
|
|
{!! Form::button('<i class="fa fa-times"></i>', ['type' => 'submit',
|
|
|
|
'class' => 'btn btn-sm btn-danger btn-icon',
|
|
|
|
'onclick' => "return confirm('Are you sure?')",
|
|
|
|
]) !!}
|
|
|
|
{!! Form::close() !!}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<hr/>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-12">
|
|
|
|
<div class="text-right">
|
|
|
|
{!! Form::open(['url' => url('/admin/subfleets/'.$subfleet->id.'/expenses'),
|
|
|
|
'method' => 'post', 'class' => 'modify_expense form-inline']) !!}
|
2018-03-06 12:10:00 +08:00
|
|
|
{!! Form::text('name', null, ['class' => 'form-control input-sm', 'placeholder' => 'Name']) !!}
|
|
|
|
{!! Form::number('amount', null, ['class' => 'form-control input-sm', 'placeholder' => 'Amount']) !!}
|
2018-03-06 11:24:49 +08:00
|
|
|
{!! Form::select('type', \App\Models\Enums\ExpenseType::select(), null, ['class' => 'select2']) !!}
|
2018-03-06 02:21:38 +08:00
|
|
|
{!! Form::button('<i class="fa fa-plus"></i> Add', ['type' => 'submit',
|
|
|
|
'class' => 'btn btn-success btn-small']) !!}
|
|
|
|
{!! Form::close() !!}
|
2018-03-06 12:10:00 +08:00
|
|
|
|
|
|
|
<p class="text-danger">{{ $errors->first('name') }}</p>
|
|
|
|
<p class="text-danger">{{ $errors->first('amount') }}</p>
|
2018-03-06 02:21:38 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|