Files

118 lines
6.2 KiB
PHP
Executable File

@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('discounts.patient_category_discounts') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('discounts.home') }}</a></li>
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('discounts.finance_home') }}</a></li>
<li class="active"><i class="fa fa-eye"></i>{{ __('discounts.view_discounts') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="white-box">
@include('flash::message')
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('discounts.patient_category') }}</th>
<th>{{ __('discounts.discount') }}</th>
<th>{{ __('discounts.co_payment') }}</th>
<th>{{ __('discounts.pay_later') }}</th>
<th>Threshold</th>
<th>Add dependants</th>
<th>{{ __('discounts.action') }}</th>
<th>{{ __('discounts.action') }}</th>
<th>{{ __('discounts.action') }}</th>
</tr>
</thead>
<tbody>
@if(count($discounts) > 0)
@foreach($discounts as $discount)
<tr>
<td>{{ $categories[$discount->patient_category] ?? "" }}</td>
<td>{{ $discount->discount }}</td>
<td>@if($discount->co_payment_share) {{ $discount->co_payment_share }} @else <label class='label label-danger'>{{ __('discounts.not_set') }}</label>@endif</td>
<td>{{ $discount->pay_later == 1 ? "Yes" : "No" }}</td>
<td>{{ is_null($discount->threshold_amount) ? "" : ugandan_shillings($discount->threshold_amount) }}</td>
<td>
@if(!is_null($discount->threshold_type))
@if( Auth::user()->can('view-dependants-to-patient'))
{{ Form::open(['method'=>'post','url' => 'discounts/add_dependants']) }}
{{ Form::hidden('discount_id', $discount->id) }}
{{ Form::submit('View dependants', ['class' => 'btn btn-primary btn-rounded btn-sm']) }}
{{ Form::close() }}
@endif
@endif
</td>
<td>
@if($discount->pay_later == 1 && Auth::user()->can('change-drugs-covered-by-category'))
<a href="/discounts/edit_insured_drugs/{{ $discount->patient_category }}/" class="btn btn-info btn-sm"><i class="fa fa-pencil"></i> Edit Insured Drugs</a>
@endif
</td>
<td>
@if(Auth::user()->can('discount-list'))
<a href="/discounts/{{ $discount->id }}/edit/" class="btn btn-info btn-sm"><i class="fa fa-pencil"></i> {{ __('discounts.edit') }}</a>
@endif
</td>
<td>
@if(Auth::user()->can('discount-list'))
{{ Form::model($discount->id ,['method' => 'DELETE', 'route' => ['discounts.destroy', $discount->id]]) }}
<button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure you want to remove this patient discount?')"><i class="fa fa-trash"></i> {{ __('discounts.delete') }}</button>
{{ Form::close() }}
@endif
</td>
</tr>
@endforeach
@else
<tr class="warning"><td class="center" colspan="8">{{ __('discounts.no_discounts_found') }}</td></tr>
@endif
</tbody>
</table>
</div>
{{ $discounts->links() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
$('.table').DataTable({
dom: 'Bfrtip',
order: [[3, 'desc']],
pageLength: 100,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
</script>
@endpush