updated streamline-setup v2

This commit is contained in:
2025-01-15 08:53:49 -08:00
committed by alec.turner
parent a2ce9248f0
commit 4b569f81b0
20228 changed files with 2932048 additions and 63204 deletions
@@ -0,0 +1,408 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.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">{{ __('cost_center_performance.center_performance') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="/finance_reports">{{ __('cost_center_performance.reports_dashboard') }}</a></li>
<li class="active">{{ __('cost_center_performance.center_performance') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="panel panel-default">
<div class="panel-body">
{{ Form::open(['method'=>'post','route' => 'cost_centers.store']) }}
<br/>
<h3>{{ __('cost_center_performance.select_cost_center') }}</h3>
<br/>
<div class="form-group">
{{ Form::select('cost_center',$cost_centers,'',['class' => 'form-control compulsory required']) }}
</div>
<br/>
<h3>{{ __('cost_center_performance.select_date_range') }}</h3>
<br/>
<div class="form-group">
<select class="form-control compulsory required" name="dates" id="dates" required>
<option value="">-{{ __('cost_center_performance.select') }}-</option>
<option value="today">{{ __('cost_center_performance.today') }}</option>
<option value="yesterday">{{ __('cost_center_performance.yesterday') }}</option>
<option value="custom_date">{{ __('cost_center_performance.custom_date') }}</option>
<option value="custom_date_range">{{ __('cost_center_performance.date_range') }}</option>
</select>
</div>
<div id="sDate" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('cost_center_performance.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control required compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div id="eDate" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('cost_center_performance.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control required compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="form-group">
{{ Form::submit(__('cost_center_performance.submit'), ['class'=>'btn btn-success pull-right']) }}
</div>
{{ Form::close() }}
</div>
</div>
</div>
<!-- <div class="col-xs-1"></div> -->
<div class="col-md-9">
<div class="row">
<div class="panel panel-default col-md-12">
<div class="panel-body panel-primary">
<br/>
<h3 class="label label-info col-lg-5 offset-4"> {!! __('cost_center_performance.showing_performance_of') . " " . $ward_name !!}</h3>
<br>
<br/>
<div class="table-responsive">
@if($ward_name == "OPD")
<table id="table" class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th><strong>{{ __('cost_center_performance.item') }}</strong></th>
<th><strong>{{ __('cost_center_performance.total') }}</strong></th>
<th><strong>{{ __('cost_center_performance.action') }}</strong></th>
</tr>
</thead>
@php $total = 0; @endphp
<tbody>
<tr>
<td>{{ __('cost_center_performance.drug') }}</td>
<td>{{ ugandan_shillings(array_sum($drugs) + array_sum($tta_cost)) }}</td>
@php $total += array_sum($drugs) + array_sum($tta_cost); @endphp
<td>
@if(array_sum($drugs) > 0)
{{ Form::open(['method'=>'post','route' => 'cost_center.income_detailed_report']) }}
{{ Form::hidden('service_type', $request) }}
{{ Form::hidden('dates', $request->dates) }}
{{ Form::hidden('comparator', 'DR') }}
{{ Form::hidden('date_type', $request->date_type) }}
{{ Form::hidden('request', $request) }}
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success']) }}
{{ Form::close() }}
@else
<button class="btn btn-success" disabled="true">{{ __('cost_center_performance.details') }}</button>
@endif
</td>
</tr>
<tr>
<td>{{ __('cost_center_performance.consultation') }}</td>
<td>{{ ugandan_shillings(array_sum($consultations)) }}</td>
@php $total += array_sum($consultations); @endphp
<td>
<!-- $request -->
@if(array_sum($consultations) > 0)
{{ Form::open(['method'=>'post','route' => 'cost_center.income_detailed_report']) }}
{{ Form::hidden('service_type', $request) }}
{{ Form::hidden('dates', $request->dates) }}
{{ Form::hidden('comparator', 'CON') }}
{{ Form::hidden('date_type', $request->date_type) }}
{{ Form::hidden('request', $request) }}
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success']) }}
{{ Form::close() }}
@else
<button class="btn btn-success" disabled="true">{{ __('cost_center_performance.details') }}</button>
@endif
</td>
</tr>
<tr>
<td>{{ __('cost_center_performance.services') }}</td>
<td>{{ ugandan_shillings(array_sum($services)) }}</td>
@php $total += array_sum($services); @endphp
<td>
@if(array_sum($services) > 0)
{{ Form::open(['method'=>'post','route' => 'cost_center.income_detailed_report']) }}
{{ Form::hidden('service_type', $request) }}
{{ Form::hidden('dates', $request->dates) }}
{{ Form::hidden('comparator', 'OTH') }}
{{ Form::hidden('date_type', $request->date_type) }}
{{ Form::hidden('request', $request) }}
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success']) }}
{{ Form::close() }}
@else
<button class="btn btn-success" disabled="true">{{ __('cost_center_performance.details') }}</button>
@endif
</td>
</tr>
@if(is_eye_module_enabled())
<tr>
<td>{{ __('cost_center_performance.optical_items') }}</td>
<td>{{ ugandan_shillings(array_sum($optics)) }}</td>
@php $total += array_sum($optics); @endphp
<td>
@if(array_sum($optics) > 0)
{{ Form::open(['method'=>'post','route' => 'cost_center.income_detailed_report']) }}
{{ Form::hidden('service_type', $request) }}
{{ Form::hidden('dates', $request->dates) }}
{{ Form::hidden('comparator', 'OPTICS') }}
{{ Form::hidden('date_type', $request->date_type) }}
{{ Form::hidden('request', $request) }}
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success']) }}
{{ Form::close() }}
@else
<button class="btn btn-success" disabled="true">{{ __('cost_center_performance.details') }}</button>
@endif
</td>
</tr>
@endif
<tr>
<td>{{ __('cost_center_performance.sundries') }}</td>
<td>{{ ugandan_shillings(array_sum($sundries)) }}</td>
@php $total += array_sum($sundries); @endphp
<td>
@if(array_sum($sundries) > 0)
{{ Form::open(['method'=>'post','route' => 'cost_center.income_detailed_report']) }}
{{ Form::hidden('service_type', $request) }}
{{ Form::hidden('dates', $request->dates) }}
{{ Form::hidden('comparator', 'SUN') }}
{{ Form::hidden('date_type', $request->date_type) }}
{{ Form::hidden('request', $request) }}
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success']) }}
{{ Form::close() }}
@else
<button class="btn btn-success" disabled="true">{{ __('cost_center_performance.details') }}</button>
@endif
</td>
</tr>
<tr>
<td>{{ __('cost_center_performance.investigations') }}</td>
<td>{{ ugandan_shillings(array_sum($investigations)) }}</td>
@php $total += array_sum($investigations); @endphp
<td>
@if(array_sum($investigations) > 0)
{{ Form::open(['method'=>'post','route' => 'cost_center.income_detailed_report']) }}
{{ Form::hidden('service_type', $request) }}
{{ Form::hidden('dates', $request->dates) }}
{{ Form::hidden('comparator', 'IA') }}
{{ Form::hidden('date_type', $request->date_type) }}
{{ Form::hidden('request', $request) }}
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success']) }}
{{ Form::close() }}
@else
<button class="btn btn-success" disabled="true">{{ __('cost_center_performance.details') }}</button>
@endif
</td>
</tr>
<tr>
<td>{{ __('cost_center_performance.procedures') }}</td>
<td>{{ ugandan_shillings(array_sum($procedures)) }}</td>
@php $total += array_sum($procedures); @endphp
<td>
@if(array_sum($procedures) > 0)
{{ Form::open(['method'=>'post','route' => 'cost_center.income_detailed_report']) }}
{{ Form::hidden('service_type', $request) }}
{{ Form::hidden('dates', $request->dates) }}
{{ Form::hidden('comparator', 'PR') }}
{{ Form::hidden('date_type', $request->date_type) }}
{{ Form::hidden('request', $request) }}
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success']) }}
{{ Form::close() }}
@else
<button class="btn btn-success" disabled="true">{{ __('cost_center_performance.details') }}</button>
@endif
</td>
</tr>
@if($ward_name != "OPD")
<tr>
<td>{{ __('cost_center_performance.extras') }}</td>
<td>{{ ugandan_shillings(array_sum($extras)) }}</td>
@php $total += array_sum($extras); @endphp
<td><button class="btn btn-success">{{ __('cost_center_performance.details') }}</button></td>
</tr>
@endif
<tr>
<td><strong>{{ __('cost_center_performance.total') }}</strong></td>
<td>{{ ugandan_shillings($total) }}</td>
<td></td>
</tr>
</tbody>
</table>
@else
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('cost_center_performance.patient') }}</th>
<th>{{ __('cost_center_performance.staff_in_charge') }}</th>
<th>{{ __('cost_center_performance.receipts') }}</th>
<th>{{ __('cost_center_performance.amount') }}</th>
<th>{{ __('cost_center_performance.action') }}</th>
</tr>
@php
$sum_total = 0;
@endphp
</thead>
<tbody>
@if(count($inpatient_record_results) > 0)
@foreach($inpatient_record_results as $record)
<tr>
<td>{{ get_full_name($record->patient_id, 'id', 'first_name', 'last_name', 'patients') }}</td>
<td>{{ get_full_name($record->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
<td>{{ $record->receipt_number }}</td>
<td>{{ ugandan_shillings($record->patient_amount_paid) }}</td>
<td>
<a href="{{ route('finance_reports.inpatient_deposit_receipt_reprint', $record->id) }}" class="btn btn-default">{{ __('cost_center_performance.print_receipt') }}</a>
</td>
@php
$sum_total += $record->patient_amount_paid;
@endphp
</tr>
@endforeach
@endif
</tbody>
<tr>
<td></td>
<td></td>
<td><strong>{{ __('cost_center_performance.total') }}</strong></td>
<td>{{ ugandan_shillings($sum_total) }}</td>
<td></td>
</tr>
</table>
@endif
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<!-- Date Picker Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script>
$('#dates').change(function (e) {
if($(this).val() === "custom_date"){
$("#eDate").hide();
$("#sDate").show();
}else if($(this).val() === "custom_date_range"){
$("#sDate").show();
$("#eDate").show();
}else{
$("#eDate").hide();
$("#sDate").hide();
}
});
</script>
<script type="text/javascript">
jQuery('#custom_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
<script type="text/javascript">
jQuery('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
<script type="text/javascript">
jQuery('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
<script>
$('#staff_member').select2({
placeholder: "-- select --"
});
</script>
<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',
pageLength: 100,
buttons: [
'copy',
{ extend: 'csv',
message: '<?php echo __('cost_center_performance.cost_center_performance'); ?>',
exportOptions: {
columns: [ 0, 1, 2, 3 ]
},
sheetName: '<?php echo __('cost_center_performance.cost_center_performance'); ?>'
},
{ extend: 'excel',
message: '<?php echo __('cost_center_performance.cost_center_performance'); ?>',
exportOptions: {
columns: [ 0, 1, 2, 3 ]
},
sheetName: '<?php echo __('cost_center_performance.cost_center_performance'); ?>'
},
{ extend: 'pdf',
message: '<?php echo __('cost_center_performance.cost_center_performance'); ?>',
exportOptions: {
columns: [ 0, 1, 2, 3 ]
},
sheetName: '<?php echo __('cost_center_performance.cost_center_performance'); ?>'
},
'print'
]
});
</script>
@endpush
@@ -0,0 +1,226 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<!-- <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" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@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">{{ __('cost_center_performance.center_performance_details') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="/finance_reports">{{ __('cost_center_performance.reports_dashboard') }}</a></li>
<li class="active">{{ __('cost_center_performance.center_performance_details') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="panel panel-default">
<div class="panel-body">
{{ Form::open(['method'=>'post','route' => 'cost_centers.store']) }}
<br/>
<h3>{{ __('cost_center_performance.select_cost_center') }}</h3>
<br/>
<div class="form-group">
{{ Form::select('cost_center',$cost_centers,'',['class' => 'form-control compulsory required']) }}
</div>
<br/>
<h3>{{ __('cost_center_performance.select_date_range') }}</h3>
<br/>
<div class="form-group">
<select class="form-control compulsory required" name="dates" id="dates" required>
<option value="">-{{ __('cost_center_performance.select') }}-</option>
<option value="today">{{ __('cost_center_performance.today') }}</option>
<option value="yesterday">{{ __('cost_center_performance.yesterday') }}</option>
<option value="custom_date">{{ __('cost_center_performance.custom_date') }}</option>
<option value="custom_date_range">{{ __('cost_center_performance.date_range') }}</option>
</select>
</div>
<div id="sDate" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('cost_center_performance.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control required compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div id="eDate" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('cost_center_performance.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control required compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="form-group">
{{ Form::submit(__('cost_center_performance.submit'), ['class'=>'btn btn-success pull-right']) }}
</div>
{{ Form::close() }}
</div>
</div>
</div>
<!-- <div class="col-xs-1"></div> -->
<div class="col-md-9">
<div class="row">
<div class="panel panel-default col-md-12">
<div class="panel-body panel-primary">
<br/>
<h3 class="label label-info col-lg-5 offset-4"> {!! __('cost_center_performance.showing_performance_of') . " "!!}</h3>
<br>
<br/>
<div class="table-responsive">
<table id="table" class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('cost_center_performance.patient_number') }}</th>
<th>{{ __('cost_center_performance.patient_name') }}</th>
<th>{{ __('cost_center_performance.staff') }}</th>
<th>{{ __('cost_center_performance.date') }}</th>
<th>{{ __('cost_center_performance.receipt_number') }}</th>
<th>{{ __('cost_center_performance.item_name') }}</th>
<th>{{ __('cost_center_performance.amount') }}</th>
<th>{{ __('cost_center_performance.amount_patient_paid') }}</th>
<th>{{ __('cost_center_performance.donor_discount') }}</th>
<th>{{ __('cost_center_performance.gen_discount') }}</th>
<th>{{ __('cost_center_performance.action') }}</th>
</tr>
</thead>
<tbody>
@foreach($result as $item)
<tr>
<td>{{ get_name($item->patient_id, 'id', 'number', 'patients') }}</td>
<td>{{ get_name($item->patient_id, 'id', 'first_name', 'patients') }} {{ get_name($item->patient_id, 'id', 'last_name', 'patients') }}</td>
<td>{{ $staff_member[0]->first_name." ".$staff_member[0]->last_name }}</td>
<td>{{ streamline_date($item->created_at) }}</td>
<td>{{ $item->receipt_number }}</td>
<td>
@php
$ids = explode(",",$item->items_ids);
for($i = 0; $i < count($ids); $i++){
echo $i+1 ." ." . get_name($ids[$i], 'id', 'name', 'services') ."<br/>" ;
}
@endphp
</td>
<td>
@php
$ids = explode(",",$item->items_ids);
for($i = 0; $i < count($ids); $i++){
echo $i+1 ." ." . ugandan_shillings(get_name($ids[$i], 'id', 'non_insured_price', 'services')) ."<br/>" ;
}
@endphp
</td>
<td>{{ ugandan_shillings($item->patient_amount_paid) }}</td>
<td>{{ ugandan_shillings(get_name($item->receipt_number, 'receipt_number', 'donor_to_pay', 'donor_discount_details')) }}</td>
<td>{{ ugandan_shillings(get_name($item->receipt_number, 'receipt_number', 'discount_amount', 'discounts')) }}</td>
<td>
@php
$id = $item->id;
@endphp
<a href="{{ route('finance_reports.services_receipt_reprint', $item->id) }}" class="btn btn-default">
{{ __('cost_center_performance.print_receipt') }}
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<!-- Date Picker Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script>
$('#dates').change(function (e) {
if($(this).val() === "custom_date"){
$("#eDate").hide();
$("#sDate").show();
}else if($(this).val() === "custom_date_range"){
$("#sDate").show();
$("#eDate").show();
}else{
$("#eDate").hide();
$("#sDate").hide();
}
});
</script>
<script type="text/javascript">
jQuery('#custom_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
<script type="text/javascript">
jQuery('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
<script type="text/javascript">
jQuery('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script>
$('#staff_member').select2({
placeholder: "-- select --"
});
</script>
@endpush
@@ -0,0 +1,303 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.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">{{ __('cost_center_performance.center_performance') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="/finance_reports">{{ __('cost_center_performance.reports_dashboard') }}</a></li>
<li class="active">{{ __('cost_center_performance.center_performance') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="panel panel-default">
<div class="panel-body">
{{ Form::open(['method'=>'post','route' => 'cost_centers.store']) }}
<br/>
<h3>{{ __('cost_center_performance.select_cost_center') }}</h3>
<br/>
<div class="form-group">
{{ Form::select('cost_center',$cost_centers,'',['class' => 'form-control compulsory required cost_centers']) }}
</div>
<br/>
<h3>{{ __('cost_center_performance.select_date_range') }}</h3>
<br/>
<div class="form-group">
<select class="form-control compulsory required" name="dates" id="dates" required>
<option value="">-{{ __('cost_center_performance.select') }}-</option>
<option value="today">{{ __('cost_center_performance.today') }}</option>
<option value="yesterday">{{ __('cost_center_performance.yesterday') }}</option>
<option value="custom_date">{{ __('cost_center_performance.custom_date') }}</option>
<option value="custom_date_range">{{ __('cost_center_performance.date_range') }}</option>
</select>
</div>
<div id="sDate" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('cost_center_performance.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control required compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div id="eDate" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('cost_center_performance.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control required compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="form-group">
{{ Form::submit('Submit', ['class'=>'btn btn-success pull-right']) }}
</div>
{{ Form::close() }}
</div>
</div>
</div>
<!-- <div class="col-xs-1"></div> -->
<div class="col-md-9">
<div class="row">
<div class="panel panel-default col-md-12">
<div class="panel-body panel-primary">
@if($request != [])
@if($request->dates != "-select-" || $request->cost_center != "0")
@if(($request->dates == "today") || ($request->dates == "yesterday") || ($request->dates == "custom_date") || ($request->dates == "custom_date_range"))
<br/>
@if(isset($display))
<h3 class="label label-info col-lg-5 offset-4"> {!! isset($display) ? $display : '' !!}</h3>
@endif
<br>
<br/>
<div class="table-responsive">
<table id="table" class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th><strong>{{ __('cost_center_performance.item') }}</strong></th>
<th><strong>{{ __('cost_center_performance.total') }}</strong></th>
<th><strong>{{ __('cost_center_performance.action') }}</strong></th>
</tr>
</thead>
<tbody>
@php $total = 0; @endphp
@if($request->cost_center == "")
<tr>
<td></td>
<td></td>
<td></td>
</tr>
@elseif($request->cost_center == "all_cost_centers")
@foreach($per_wards_total_amounts_array as $ward => $amount)
<tr>
<td>{{ $ward == "OPD" ? "OPD" : get_name($ward, "id", "name", "wards") }}</td>
@php
$ward_amount = $ward == "OPD" ? $amount + $total_opd_debt_payments : $amount;
@endphp
<td>{{ ugandan_shillings($ward_amount) }}</td>
@php $total += $ward_amount ; @endphp
<td>
@if($ward_amount > 0)
{{ Form::open(['method'=>'post', 'route' => 'cost_centers.details']) }}
{{ Form::hidden('ward_id', $ward) }}
{{ Form::hidden('dates', ($request->start_date)."/".$request->end_date) }}
{{ Form::hidden('date_type', $request->dates) }}
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success ']) }}
{{ Form::close() }}
@else
<button class="btn btn-success" disabled="true">{{ __('cost_center_performance.details') }}</button>
@endif
</td>
</tr>
@endforeach
@else
@foreach($per_wards_total_amounts_array as $ward => $amount)
<tr>
<td>{{ $ward == "OPD" ? "OPD" : get_name($ward, "id", "name", "wards") }}</td>
<td>{{ ugandan_shillings($amount) }}</td>
@php $total += $amount ; @endphp
<td>
@if($amount > 0)
{{ Form::open(['method'=>'post', 'route' => 'cost_centers.details']) }}
{{ Form::hidden('ward_id', $ward) }}
{{ Form::hidden('dates', ($request->start_date)."/".$request->end_date) }}
{{ Form::hidden('date_type', $request->dates) }}
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success ']) }}
{{ Form::close() }}
@else
<button class="btn btn-success" disabled="true">{{ __('cost_center_performance.details') }}</button>
@endif
</td>
</tr>
@endforeach
@endif
</tbody>
<tfoot>
<tr>
<td><strong>{{ __('cost_center_performance.total') }}</strong></td>
<td><strong>{{ ugandan_shillings($total) }}</strong></td>
<td></td>
</tr>
</tfoot>
</table>
</div>
@else
<div class="row">
<div class="offset-5"></div>
<div class="col-md-6" style="margin-top: 70px;">
<h3 class="label label-warning"><strong>{{ __('cost_center_performance.select_valid_date') }}</strong></h3>
</div>
</div>
@endif
@else
<div class="row">
<div class="offset-5"></div>
<div class="col-md-6" style="margin-top: 70px;">
<h3 class="label label-warning"><strong>{{ __('cost_center_performance.select_valid_date') }}</strong></h3>
</div>
</div>
@endif
@else
<div class="row">
<div class="offset-5"></div>
<div class="col-md-6" style="margin-top: 70px;">
<h3 class="label label-warning"><strong>{{ __('cost_center_performance.select_valid_date') }}</strong></h3>
</div>
</div>
@endif
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<!-- Date Picker Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script>
$('#dates').change(function (e) {
if($(this).val() === "custom_date"){
$("#eDate").hide();
$("#sDate").show();
}else if($(this).val() === "custom_date_range"){
$("#sDate").show();
$("#eDate").show();
}else{
$("#eDate").hide();
$("#sDate").hide();
}
});
</script>
<script type="text/javascript">
jQuery('#custom_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
<script type="text/javascript">
jQuery('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
<script type="text/javascript">
jQuery('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
<script>
$('#staff_member,.cost_centers').select2({
placeholder: "-- select --"
});
</script>
<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',
pageLength: 100,
buttons: [
'copy',
{ extend: 'csv',
message: 'COST CENTER PERFORMANCE',
exportOptions: {
columns: [ 0, 1 ]
},
sheetName: 'COST CENTER PERFORMANCE ON STREAMLINE'
},
{ extend: 'excel',
message: 'COST CENTER PERFORMANCE',
exportOptions: {
columns: [ 0, 1 ]
},
sheetName: 'COST CENTER PERFORMANCE ON STREAMLINE'
},
{ extend: 'pdf',
message: 'COST CENTER PERFORMANCE',
exportOptions: {
columns: [ 0, 1 ]
},
sheetName: 'COST CENTER PERFORMANCE ON STREAMLINE'
},
'print'
]
});
</script>
@endpush
@@ -0,0 +1,446 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<!-- <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" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@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">{{ __('cost_center_performance.investigation_performance') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="/finance_reports">{{ __('cost_center_performance.reports_dashboard') }}</a></li>
<li class="active">{{ __('cost_center_performance.investigation_performance') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="panel panel-default">
<div class="panel-body">
{{ Form::open(['method'=>'post','route' => 'lab_performance.index']) }}
<br/>
<h3>{{ __('cost_center_performance.select_date_range') }}</h3>
<br/>
<div class="form-group">
<select class="form-control compulsory required" name="date_type" id="dates" required>
<option value="">-{{ __('cost_center_performance.select') }}-</option>
<option value="today">{{ __('cost_center_performance.today') }}</option>
<option value="yesterday">{{ __('cost_center_performance.yesterday') }}</option>
<option value="custom_date">{{ __('cost_center_performance.custom_date') }}</option>
<option value="custom_date_range">{{ __('cost_center_performance.date_range') }}</option>
</select>
</div>
<div id="sDate" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('cost_center_performance.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control required compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div id="eDate" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('cost_center_performance.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control required compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="form-group">
{{ Form::submit(__('cost_center_performance.submit'), ['class'=>'btn btn-success pull-right']) }}
</div>
{{ Form::close() }}
</div>
</div>
</div>
<!-- <div class="col-xs-1"></div> -->
<div class="col-md-9">
<div class="row">
<div class="panel panel-default col-md-12">
<div class="panel-body panel-primary">
@if($request != [])
@if($request->date_type != "-select-")
@if(($request->dates == "today") || ($request->date_type == "yesterday") || ($request->date_type == "custom_date") || ($request->date_type == "custom_date_range"))
<br/>
@if(isset($display))
<h3 class="label label-info col-lg-5 offset-4"> {!! isset($display) ? $display : '' !!}</h3>
@endif
<br>
<br/>
<div style="width:75%;">
{!! $chartjs->render() !!}
</div>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('cost_center_performance.investigation_type') }}</th>
<th>{{ __('cost_center_performance.amount') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@php
$grand_total = 0;
$total = 0;
foreach ($inv_lab as $item){
$total += $item['cost_price'];
}
@endphp
<tr>
<th>{{ __('cost_center_performance.lab') }}</th>
<th>{{ ugandan_shillings($total) }}</th>
<th>
{{ Form::open(['method'=>'post','route' => 'lab_performance.details']) }}
{{ Form::hidden('inv_type', "lab") }}
@foreach ($inv_lab as $item)
{{ Form::hidden('investigations_array[]', $item['item']) }}
{{ Form::hidden('patient_names_array[]',get_full_name($item['patient_id'],'id', 'first_name', 'last_name', 'patients') ) }}
{{ Form::hidden('patients_array[]',get_name($item['patient_id'],'id','number', 'patients') ) }}
{{ Form::hidden('receipt_number_array[]', $item['receipt_number'] ) }}
{{ Form::hidden('investigations_name_array[]',get_name($item['item'], 'id', 'name', 'investigations') ) }}
{{ Form::hidden('investigations_date_array[]',streamline_date($item['date']) ) }}
{{ Form::hidden('investigations_amountpaid_array[]',ugandan_shillings($item['patient_amount_paid']) ) }}
{{ Form::hidden('investigations_cost_array[]',ugandan_shillings($item['cost_price']) ) }}
@endforeach
{{ Form::hidden('total', $total) }}
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success ']) }}
{{ Form::close() }}
</th>
@php $grand_total = $total; @endphp
</tr>
@php
$total = 0;
foreach ($inv_x_ray as $item){
$total += $item['cost_price'];
}
@endphp
<tr>
<th>{{ __('cost_center_performance.xray') }}</th>
<th>{{ ugandan_shillings($total) }}</th>
<th>
{{ Form::open(['method'=>'post','route' => 'lab_performance.details']) }}
{{ Form::hidden('inv_type', "xray") }}
@foreach ($inv_x_ray as $item)
{{ Form::hidden('investigations_array[]', $item['item']) }}
{{ Form::hidden('patient_names_array[]',get_full_name($item['patient_id'],'id', 'first_name', 'last_name', 'patients') ) }}
{{ Form::hidden('patients_array[]',get_name($item['patient_id'],'id','number', 'patients') ) }}
{{ Form::hidden('receipt_number_array[]', $item['receipt_number'] ) }}
{{ Form::hidden('investigations_name_array[]',get_name($item['item'], 'id', 'name', 'investigations') ) }}
{{ Form::hidden('investigations_date_array[]',streamline_date($item['date']) ) }}
{{ Form::hidden('investigations_amountpaid_array[]',ugandan_shillings($item['patient_amount_paid']) ) }}
{{ Form::hidden('investigations_cost_array[]',ugandan_shillings($item['cost_price']) ) }}
@endforeach
{{ Form::hidden('total', $total) }}
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success ']) }}
{{ Form::close() }}
</th>
@php $grand_total += $total; @endphp
</tr>
@php
$total = 0;
foreach ($inv_ultrasound as $item){
$total += $item['cost_price'];
}
@endphp
<tr>
<th>{{ __('cost_center_performance.ultrasound') }}</th>
<th>{{ ugandan_shillings($total) }}</th>
<th>
{{ Form::open(['method'=>'post','route' => 'lab_performance.details']) }}
{{ Form::hidden('inv_type', "ultrasound") }}
@foreach ($inv_ultrasound as $item)
{{ Form::hidden('investigations_array[]', $item['item']) }}
{{ Form::hidden('patient_names_array[]',get_full_name($item['patient_id'],'id', 'first_name', 'last_name', 'patients') ) }}
{{ Form::hidden('patients_array[]',get_name($item['patient_id'],'id','number', 'patients') ) }}
{{ Form::hidden('receipt_number_array[]', $item['receipt_number'] ) }}
{{ Form::hidden('investigations_name_array[]',get_name($item['item'], 'id', 'name', 'investigations') ) }}
{{ Form::hidden('investigations_date_array[]',streamline_date($item['date']) ) }}
{{ Form::hidden('investigations_amountpaid_array[]',ugandan_shillings($item['patient_amount_paid']) ) }}
{{ Form::hidden('investigations_cost_array[]',ugandan_shillings($item['cost_price']) ) }}
@endforeach
{{ Form::hidden('total', $total) }}
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success ']) }}
{{ Form::close() }}
</th>
@php $grand_total += $total; @endphp
</tr>
<tr>
<th><strong>{{ __('cost_center_performance.total') }}</strong></th>
<th><strong>{{ ugandan_shillings($grand_total) }}</strong></th>
<th></th>
</tr>
</tbody>
</table>
</div>
@else
<div class="row">
<div class="col-md-6">
<div style="width:75%;">
{!! $chartjs->render() !!}
</div>
</div>
<div class="col-md-6">
@if(isset($display))
<h3 class="label label-info col-lg-5 offset-4"> {!! __('cost_center_performance.') . "Records displayed are of ".streamline_date(date('Y-m-d')) !!}</h3>
<br><br>
@endif
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('cost_center_performance.investigation_type') }}</th>
<th>{{ __('cost_center_performance.amount') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@php
$grand_total = 0;
$total = 0;
foreach ($inv_lab as $item){
$total += $item['cost_price'];
}
@endphp
<tr>
<th>{{ __('cost_center_performance.lab') }}</th>
<th>{{ ugandan_shillings($total) }}</th>
<th>
{{ Form::open(['method'=>'post','route' => 'lab_performance.details']) }}
{{ Form::hidden('inv_type', "lab") }}
@foreach ($inv_lab as $item)
{{ Form::hidden('investigations_array[]', $item['item']) }}
{{ Form::hidden('patient_names_array[]',get_full_name($item['patient_id'],'id', 'first_name', 'last_name', 'patients') ) }}
{{ Form::hidden('patients_array[]',get_name($item['patient_id'],'id','number', 'patients') ) }}
{{ Form::hidden('receipt_number_array[]', $item['receipt_number'] ) }}
{{ Form::hidden('investigations_name_array[]',get_name($item['item'], 'id', 'name', 'investigations') ) }}
{{ Form::hidden('investigations_date_array[]',streamline_date($item['date']) ) }}
{{ Form::hidden('investigations_amountpaid_array[]',ugandan_shillings($item['patient_amount_paid']) ) }}
{{ Form::hidden('investigations_cost_array[]',ugandan_shillings($item['cost_price']) ) }}
@endforeach
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success ']) }}
{{ Form::close() }}
</th>
@php $grand_total = $total; @endphp
</tr>
@php
$total = 0;
foreach ($inv_x_ray as $item){
$total += $item['cost_price'];
}
@endphp
<tr>
<th>{{ __('cost_center_performance.xray') }}</th>
<th>{{ ugandan_shillings($total) }}</th>
<th>
{{ Form::open(['method'=>'post','route' => 'lab_performance.details']) }}
{{ Form::hidden('inv_type', "xray") }}
@foreach ($inv_x_ray as $item)
{{ Form::hidden('investigations_array[]', $item['item']) }}
{{ Form::hidden('patient_names_array[]',get_full_name($item['patient_id'],'id', 'first_name', 'last_name', 'patients') ) }}
{{ Form::hidden('patients_array[]',get_name($item['patient_id'],'id','number', 'patients') ) }}
{{ Form::hidden('receipt_number_array[]', $item['receipt_number'] ) }}
{{ Form::hidden('investigations_name_array[]',get_name($item['item'], 'id', 'name', 'investigations') ) }}
{{ Form::hidden('investigations_date_array[]',streamline_date($item['date']) ) }}
{{ Form::hidden('investigations_amountpaid_array[]',ugandan_shillings($item['patient_amount_paid']) ) }}
{{ Form::hidden('investigations_cost_array[]',ugandan_shillings($item['cost_price']) ) }}
@endforeach
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success ']) }}
{{ Form::close() }}
</th>
@php $grand_total += $total; @endphp
</tr>
@php
$total = 0;
foreach ($inv_ultrasound as $item){
$total += $item['cost_price'];
}
@endphp
<tr>
<th>{{ __('cost_center_performance.ultrasound') }}</th>
<th>{{ ugandan_shillings($total) }}</th>
<th>
{{ Form::open(['method'=>'post','route' => 'lab_performance.details']) }}
{{ Form::hidden('inv_type', "ultrasound") }}
@foreach ($inv_ultrasound as $item)
{{ Form::hidden('investigations_array[]', $item['item']) }}
{{ Form::hidden('patient_names_array[]',get_full_name($item['patient_id'],'id', 'first_name', 'last_name', 'patients') ) }}
{{ Form::hidden('patients_array[]',get_name($item['patient_id'],'id','number', 'patients') ) }}
{{ Form::hidden('receipt_number_array[]', $item['receipt_number'] ) }}
{{ Form::hidden('investigations_name_array[]',get_name($item['item'], 'id', 'name', 'investigations') ) }}
{{ Form::hidden('investigations_date_array[]',streamline_date($item['date']) ) }}
{{ Form::hidden('investigations_amountpaid_array[]',ugandan_shillings($item['patient_amount_paid']) ) }}
{{ Form::hidden('investigations_cost_array[]',ugandan_shillings($item['cost_price']) ) }}
@endforeach
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success ']) }}
{{ Form::close() }}
</th>
@php $grand_total += $total; @endphp
</tr>
<tr>
<th><strong>{{ __('cost_center_performance.total') }}</strong></th>
<th><strong>{{ ugandan_shillings($grand_total) }}</strong></th>
<th></th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@endif
@else
<div class="row">
<div class="offset-5"></div>
<div class="col-md-6" style="margin-top: 70px;">
<h3 class="label label-warning"><strong>{{ __('cost_center_performance.select_valid_date') }}</strong></h3>
</div>
</div>
@endif
@else
<div class="row">
<div class="offset-5"></div>
<div class="col-md-6" style="margin-top: 70px;">
<h3 class="label label-warning"><strong>{{ __('cost_center_performance.select_valid_date') }}</strong></h3>
</div>
</div>
@endif
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<!-- Date Picker Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('js/chartjs/chart.bundle.js') }}"></script>
<script src="{{ asset('js/chartjs/utils.js') }}"></script>
<script>
$('#dates').change(function (e) {
if($(this).val() === "custom_date"){
$("#eDate").hide();
$("#sDate").show();
}else if($(this).val() === "custom_date_range"){
$("#sDate").show();
$("#eDate").show();
}else{
$("#eDate").hide();
$("#sDate").hide();
}
});
</script>
<script type="text/javascript">
jQuery('#custom_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
<script type="text/javascript">
jQuery('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
<script type="text/javascript">
jQuery('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script>
$('#staff_member').select2({
placeholder: "-- select --"
});
</script>
@endpush
@@ -0,0 +1,207 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<!-- <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" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@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">{{ __('cost_center_performance.investigation_performance_details') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="/finance_reports">{{ __('cost_center_performance.reports_dashboard') }}</a></li>
<li class="active">{{ __('cost_center_performance.investigation_performance_details') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="panel panel-default">
<div class="panel-body">
{{ Form::open(['method'=>'post','route' => 'lab_performance.index']) }}
<br/>
<h3>{{ __('cost_center_performance.select_date_range') }}</h3>
<br/>
<div class="form-group">
<select class="form-control compulsory required" name="date_type" id="dates" required>
<option value="">-{{ __('cost_center_performance.select') }}-</option>
<option value="today">{{ __('cost_center_performance.today') }}</option>
<option value="yesterday">{{ __('cost_center_performance.yesterday') }}</option>
<option value="custom_date">{{ __('cost_center_performance.custom_date') }}</option>
<option value="custom_date_range">{{ __('cost_center_performance.date_range') }}</option>
</select>
</div>
<div id="sDate" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('cost_center_performance.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control required compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div id="eDate" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('cost_center_performance.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control required compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="form-group">
{{ Form::submit(__('cost_center_performance.submit'), ['class'=>'btn btn-success pull-right']) }}
</div>
{{ Form::close() }}
</div>
</div>
</div>
<!-- <div class="col-xs-1"></div> -->
<div class="col-md-9">
<div class="row">
<div class="panel panel-default col-md-12">
<div class="panel-body panel-primary">
<br/>
@if(isset($display))
<h3 class="label label-info col-lg-5 offset-4"> {!! isset($display) ? $display : '' !!}</h3>
@endif
<br>
<br/>
<div class="table-responsive">
<table id="table" class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('cost_center_performance.patient_number') }}</th>
<th>{{ __('cost_center_performance.patient_name') }}</th>
<th>{{ __('cost_center_performance.receipt_number') }}</th>
<th>{{ __('cost_center_performance.item_name') }}</th>
<th>{{ __('cost_center_performance.date') }}</th>
<th>{{ __('cost_center_performance.amount') }}</th>
</tr>
</thead>
<tbody>
@php
$amount_patient_paid_total = 0;
$donor_discount_total = 0;
$general_discount_total = 0;
@endphp
@for($i=0; $i < count($investigations_array); $i++)
<tr>
<td>{{ $patient_names_array[$i] }}</td>
<td>{{ $patients_array[$i] }}</td>
<td>{{ $receipt_number_array[$i] }}</td>
<td>{{ $investigations_name_array[$i] }}</td>
<td>{{ $investigations_date_array[$i] }}</td>
<td>
{{ isset($investigations_cost_array[$i]) ? $investigations_cost_array[$i] : "" }}
</td>
</tr>
@endfor
</tbody>
<tfoot>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td><strong>{{ __('cost_center_performance.total') }}</strong></td>
<td><strong>{{ ugandan_shillings($invs_grand_total) }}</strong></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<!-- Date Picker Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('js/chartjs/chart.bundle.js') }}"></script>
<script src="{{ asset('js/chartjs/utils.js') }}"></script>
<script>
$('#dates').change(function (e) {
if($(this).val() === "custom_date"){
$("#eDate").hide();
$("#sDate").show();
}else if($(this).val() === "custom_date_range"){
$("#sDate").show();
$("#eDate").show();
}else{
$("#eDate").hide();
$("#sDate").hide();
}
});
</script>
<script type="text/javascript">
jQuery('#custom_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
<script type="text/javascript">
jQuery('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
<script type="text/javascript">
jQuery('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script>
$('#staff_member').select2({
placeholder: "-- select --"
});
</script>
@endpush
@@ -0,0 +1,166 @@
@extends('layouts.main')
@push('styles')
<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" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@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">{{ __('cost_center_performance.top_performing_investigations') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="/finance_reports">{{ __('cost_center_performance.reports_dashboard') }}</a></li>
<li class="active">{{ __('cost_center_performance.top_performing_investigations') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<div class="panel panel-default">
<div class="panel-body">
<!--Flash messages at the top -->
@include('flash::message')
{{ Form::open(['method'=>'post','route' => 'top_performing_investigations']) }}
<br/>
<h3>{{ __('cost_center_performance.select_cost_center') }}</h3>
<br/>
<div class="form-group">
<select class="form-control compulsory required" name="date_type" id="dates" required>
<option value="">-{{ __('cost_center_performance.select') }}-</option>
<option value="today">{{ __('cost_center_performance.today') }}</option>
<option value="yesterday">{{ __('cost_center_performance.yesterday') }}</option>
<option value="custom_date">{{ __('cost_center_performance.custom_date') }}</option>
<option value="custom_date_range">{{ __('cost_center_performance.date_range') }}</option>
</select>
</div>
<div id="sDate" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('cost_center_performance.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control required compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div id="eDate" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('cost_center_performance.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control required compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="form-group">
{{ Form::submit(__('cost_center_performance.submit'), ['class'=>'btn btn-success pull-right']) }}
</div>
{{ Form::close() }}
</div>
</div>
</div>
<div class="col-sm-9">
<div class="white-box">
<div class="row">
<div class="col-sm-12">
{!! isset($display) ? '<strong><font color="blue">'.$display.'</font></strong>' : '' !!}
</div>
</div>
<div class="row">
@if($request != [])
<div style="width:75%;">
{!! $chartjs->render() !!}
</div>
@else
<div class="offset-5"></div>
<div class="col-md-6" style="margin-top: 70px;">
<h3 class="label label-warning"><strong>{{ __('cost_center_performance.select_valid_date') }}</strong></h3>
</div>
@endif
</div>
</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 src="{{ asset('js/chartjs/chart.bundle.js') }}"></script>
<script src="{{ asset('js/chartjs/utils.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script type="text/javascript">
$('#drugs_selected').select2({
placeholder: "Select drugs"
});
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 100,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
$('#datepicker-autoclose1,#datepicker-autoclose2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'yyyy-mm-dd',
});
$('#dates').change(function (e) {
if($(this).val() === "custom_date"){
$("#eDate").hide();
$("#sDate").show();
}else if($(this).val() === "custom_date_range"){
$("#sDate").show();
$("#eDate").show();
}else{
$("#eDate").hide();
$("#sDate").hide();
}
});
jQuery('#custom_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
jQuery('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
jQuery('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
@endpush
@@ -0,0 +1,85 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('title', '| Add Equity')
@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">New Equity</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">Dashboard</a></li>
<li><a href="/equities/">Equities</a></li>
<li class="active">Register</li>
</ol>
</div>
<!-- /.col-lg-12 -->
</div>
<div class="row">
<div class="col-sm-12">
@include('finance::equity.menu')
</div>
</div>
@include('flash::message')
<div class="panel panel-default" style="border-radius: 5px;">
<div class="panel-body">
{{ Form::open(['route' => 'equities.store','data-toggle'=>'validator']) }}
<div class="form-group">
{{ Form::label('name', 'Equity Name') }}
{{ Form::text('name', '', ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('amount', 'Amount') }}
{{ Form::number('amount', '', ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('account_id', 'Chart Of Account') }}
{{ Form::select('account_id', $chart_of_accounts, '', ['class' => 'form-control compulsory' , 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('deposit_to', 'Deposit To ?') }}
{{ Form::select('deposit_to', $banks, '', ['class' => 'form-control compulsory' , 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('deposit_date', 'Deposit Date ?') }}
{{ Form::text('deposit_date', '', ['class' => 'form-control compulsory' , 'readonly', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<button class="btn btn-rounded btn-success pull-right" onclick="return confirm('Are you sure you wish to deposit this equity ?')">Submit Equity</button>
{{ Form::close() }}
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script>
jQuery('#deposit_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
@endpush
@@ -0,0 +1,86 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('title', '| Add Equity')
@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">Edit Equity</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">Dashboard</a></li>
<li><a href="/equities/">Equities</a></li>
<li class="active">Edit</li>
</ol>
</div>
<!-- /.col-lg-12 -->
</div>
<div class="row">
<div class="col-sm-12">
@include('finance::equity.menu')
</div>
</div>
@include('flash::message')
<div class="panel panel-default" style="border-radius: 5px;">
<div class="panel-body">
{{ Form::model($equity, ['method' => 'PUT', 'route' => ['equities.update',$equity]]) }}
<div class="form-group">
{{ Form::label('name', 'Equity Name') }}
{{ Form::text('name', $equity->name, ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('amount', 'Amount') }}
{{ Form::number('amount', $equity->amount, ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('account_id', 'Chart Of Account') }}
{{ Form::select('account_id', $chart_of_accounts, $equity->account_id, ['class' => 'form-control compulsory' , 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('deposit_to', 'Deposit To ?') }}
{{ Form::select('deposit_to', $banks, $equity->deposited_to, ['class' => 'form-control compulsory' , 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('deposit_date', 'Deposit Date ?') }}
{{ Form::text('deposit_date', $equity->deposit_date, ['class' => 'form-control compulsory' , 'readonly', 'required']) }}
<div class="help-block with-errors"></div>
</div>
{{ Form::button('Submit',['type'=>'submit','class'=>'btn btn-success btn-rounded waves-effect waves-light m-r-10']) }}
{{ Form::button('Cancel',['type'=>'reset','class'=>'btn btn-default btn-rounded waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script>
jQuery('#deposit_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
@endpush
@@ -0,0 +1,72 @@
@extends('layouts.main')
@push('styles')
<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">Equities</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">Dashboard</a></li>
<li class="active">Equities</li>
</ol>
</div>
<!-- /.col-lg-12 -->
</div>
<div class="row">
<div class="col-sm-12">
@include('finance::equity.menu')
</div>
</div>
@include('flash::message')
<div class="panel panel-default" style="border-radius: 5px;">
<div class="panel-body">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Amount</th>
<th>Chart Of Account</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($equities as $equity)
<tr>
<td>{{ $equity->name }}</td>
<td>{{ ugandan_shillings($equity->amount) }}</td>
<td>{{ get_name($equity->account_id, 'id', 'name', 'chart_of_accounts') }}</td>
<td>
{{ Form::model($equity->id ,['method' => 'POST', 'route' => ['equities.activate', $equity->id]]) }}
<button type="submit" class="btn btn-rounded btn-warning" onclick="return confirm('Are you sure?')"><i class="fa fa-check"></i> Activate</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script>
$('.table').DataTable();
</script>
@endpush
@@ -0,0 +1,78 @@
@extends('layouts.main')
@push('styles')
<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">Equities</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">Dashboard</a></li>
<li class="active">Equities</li>
</ol>
</div>
<!-- /.col-lg-12 -->
</div>
<div class="row">
<div class="col-sm-12">
@include('finance::equity.menu')
</div>
</div>
@include('flash::message')
<div class="panel panel-default" style="border-radius: 5px;">
<div class="panel-body">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Amount</th>
<th>Chart Of Account</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($equities as $equity)
<tr>
<td>{{ $equity->name }}</td>
<td>{{ ugandan_shillings($equity->amount) }}</td>
<td>{{ get_name($equity->account_id, 'id', 'name', 'chart_of_accounts') }}</td>
<td>
<a href="/equities/{{ $equity->id }}/edit/" class="btn btn-warning btn-rounded"><i class="fa fa-pencil"></i> Edit</a>
</td>
<td>
{{ Form::model($equity->id ,['method' => 'DELETE', 'route' => ['equities.destroy', $equity->id]]) }}
<button type="submit" class="btn btn-danger btn-rounded" onclick="return confirm('Are you sure?')"><i class="fa fa-trash"></i> Delete</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script>
$('.table').DataTable({
pageLength: 100
});
</script>
@endpush
@@ -0,0 +1,7 @@
<div class="panel panel-default" style="border-radius: 5px;">
<div class="panel-body">
<a href="{{ route('equities.create') }}" class="nav-item btn btn-success"><i class="fa fa-plus"></i> <span style="margin-left: 10px;">Add Equity</span></a>
<a href="{{ route('equities.index') }}" class="nav-item btn btn-info"><i class="fa fa-eye"></i> <span style="margin-left: 10px;">View Equities</span></a>
<a href="{{ route('equities.inactive') }}" class="nav-item btn btn-danger"><i class="fa fa-trash"></i> <span style="margin-left: 10px;">Activate Equities</span></a>
</div>
</div>
@@ -0,0 +1,255 @@
@php use Illuminate\Support\Facades\Auth; @endphp
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<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" />
<style type="text/css">
.color-tr {
background: #FFFF99;
}
</style>
@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">{{ __('finance.incoming_patient_payments') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('finance.home') }}</a></li>
<li><a href="{{ url('finance') }}">{{ __('finance.finance_home') }}</a></li>
<li><a class="active"> {{ __('finance.incoming_patient_payments') }}</a></li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
{{ Form::open(['route' => 'finance.incoming_opd_payments', 'method' => 'ANY']) }}
<div class="row">
<div class="col-md-2">
<div class="form-group">
{{ Form::label('clinic_id', __('finance.clinic')) }}
{{ Form::select('clinic_id', $clinics, '', ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-2">
<div class="form-group" id="searchby">
{{ Form::label('search_by', __('finance.date')) }}
{{ Form::select('search_by', ['0'=>'Today','1'=>'Yesterday','2'=>'Custom Date','3'=>'Custom Range'], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-3" style="display: none;" id="date_search">
<div class="form-group" id="reg_date" style="padding-top: 23px;">
<div class="input-group">
{{ Form::text('reg_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-autoclose']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-3" style="display: none;" id="date_range_search">
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('start_date', __('finance.from')) }}
<div class="input-group">
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-1']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="reg_date">
{{ Form::label('end_date', __('finance.to')) }}
<div class="input-group">
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-2']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
{{ Form::label('search_patient', 'Search By Patient') }}
<div class="input-group">
<select class="form-control" name="patient_number" id="patient_number"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" style="padding-top: 5px;"><br>
{{ Form::button('Filter',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_patient']) }}
</div>
</div>
</div>
{{ Form::close() }}
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('finance.patient_number') }}</th>
<th>{{ __('finance.full_names') }}</th>
<th>{{ __('finance.age') }}</th>
<th>{{ __('finance.phone') }}</th>
<th>{{ __('finance.category') }}</th>
<th>{{ __('finance.un-billed_items') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($patient_episodes as $episode)
@php
$dob = new Carbon\Carbon($episode->date_of_birth);
$has_procedures = is_integer($episode->procedure_id) && $episode->procedures_payment_status == 0 && $episode->procedures_is_inpatient == 0;
$has_investigations = is_integer($episode->investigation_id) && $episode->investigation_payment_status == 0 && $episode->invs_is_inpatient == 0;
$has_sundries = is_integer($episode->sundries_id) && $episode->sundries_payment_status == 0 && $episode->sundry_is_inpatient == 0;
$has_services = is_integer($episode->service_id) && $episode->service_payment_status == 0 && $episode->service_is_inpatient == 0;
$has_treatment = is_integer($episode->treatment_id) && $episode->treatment_payment_status == 0 && $episode->treatment_is_inpatient == 0;
@endphp
<tr>
<td>{{ $episode->number }}</td>
<td>{!! insurance_flag($episode->patient_id) !!}</td>
<td>{{ $dob->diffInYears(Carbon\Carbon::now()) }} (yrs)</td>
<td>{{ $episode->phone }}</td>
<td>{{ $patient_categories[$episode->category_id] ?? "N/A" }}</td>
<td>
{{ Form::open(['route' => 'patient_finance.select_payment_option']) }}
{{ Form::hidden('episode_id', $episode->episode_id)}}
{{ Form::hidden('patient_id', $episode->patient_id)}}
<ol>
@if($has_services && Auth::user()->can('make-consultation-deposits'))
<li><button type="submit" name="consultation" class="btn btn-primary btn-xs btn-rounded" value="consultation">{{ __('finance.consultations') }}</button></li>
<br>
@endif
@if($has_treatment && Auth::user()->can('make-treatment-deposits'))
<li><button type="submit" name="treatment" class="btn btn-warning btn-xs btn-rounded" value="treatment">{{ __('finance.treatments') }}</button></li>
<br>
@endif
@if($has_investigations && Auth::user()->can('make-investigations-deposits'))
<li><button type="submit" name="investigations" class="btn btn-info btn-xs btn-rounded" value="investigations">{{ __('finance.investigations') }}</button></li>
<br>
@endif
@if($has_procedures && Auth::user()->can('make-procedures-deposits'))
<li><button type="submit" name="procedures" class="btn btn-default btn-xs btn-rounded" value="procedures">{{ __('finance.procedures') }}</button></li>
<br>
@endif
@if($has_sundries && Auth::user()->can('make-sundries-deposits'))
<li><button type="submit" name="sundries" class="btn btn-default btn-xs btn-rounded" value="sundries" style="background: #73bcdca6;">{{ __('finance.sundries') }}</button></li>
<br>
@endif
@if(Auth::user()->can('make-central-billing'))
<li><button type="submit" name="central_billing" class="btn btn-danger btn-xs btn-rounded" value="central_billing" style="background: #9e9627">{{ __('finance.pay_for_all_items') }}</button></li>
@endif
</ol>
{{ Form::close() }}
</td>
<td>
{{ Form::model($episode->patient_id ,['method' => 'POST', 'route' => ['patient_finance.set_patient_session', $episode->patient_id]]) }}
<button type="submit" class="btn btn-success btn-sm">{{ __('finance.select') }}</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<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>
<!-- Date Picker Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script>
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
autoclose: true,
pageLength: 100,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#patient_number').select2({
placeholder: 'Search by patient details (names and number)',
ajax: {
url: '/patients/search_patient_by_name_number',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
id: item.id
}
})
};
},
cache: true
}
});
$('#search_by').change(function () {
if ($(this).val() == 2) {
$('#date_search').show();
$('#date_range_search').hide();
}
else if ($(this).val() == 3) {
$('#date_range_search').show();
$('#date_search').hide();
}
else {
$('#date_search,#date_range_search').hide();
}
});
$('.table').DataTable({
dom: 'Bfrtip',
bInfo: false,
bPaginate: false,
buttons: [
{extend: 'pdf',
exportOptions: {
stripHtml: false,
columns: [0, 1, 2, 3, 4, 5, 6]
}
},
{extend: 'print',
exportOptions: {
stripHtml: false,
columns: [0, 1, 2, 3, 4, 5, 6]
}
}
]
});
function show(episodeId) {
$('#menu1').show();
$('#row'+episodeId).addClass('color-tr');
}
</script>
@endpush
@@ -0,0 +1,524 @@
@extends('layouts.main')
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-3 col-sm-4 col-xs-12">
<h5 class="page-title">{{ __('finance.finance') }}</h5>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('finance.home') }}</a></li>
<li><a class="active"> {{ __('finance.finance_home') }}</a></li>
</ol>
</div>
</div>
<div class="white-box">
@if(Auth::user()->can('finance-patient-search') || Auth::user()->can('incoming-inpatient-bills') || Auth::user()->can('nssf-rate-edit')
|| Auth::user()->can('streamline-bills-create') || Auth::user()->can('streamline-bills-index'))
<div class="row">
<div class="col-md-3">
<h3 class="box-title">{{ __('finance.patient_finance') }}</h3>
<ul class="feeds">
@if(Auth::user()->can('finance-patient-search'))
<a href="{{ route('patient_finance.search_patients') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.select_patient') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
<a href="{{ route('finance.incoming_opd_payments') }}">
<li>
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.incoming_patient_payments') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('incoming-inpatient-bills'))
<a href="{{ route('inpatient_bills.incoming') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>Incoming IPD Bills<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
</ul>
</div>
<div class="col-md-3">
<h3 class="box-title">{{ __('finance.streamline_bills') }}</h3>
<ul class="feeds">
@if(Auth::user()->can('streamline-bills-create'))
<a href="{{ route('streamline_bill.create') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.generate_bills') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('streamline-bills-index'))
<a href="{{ route('streamline_bill') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.view_generated_bills') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
</ul>
</div>
<div class="col-md-3">
<h3 class="box-title">{{ __('finance.payroll_defaults') }}</h3>
<ul class="feeds">
@if(Auth::user()->can('nssf-rate-edit'))
<a href="{{ route('payroll_defaults.edit_nssf_rate') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.edit_social_security_rate') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('tax-rate-edit'))
<a href="{{ route('payroll_defaults.edit_tax_rate') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.edit_tax_rate') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
</ul>
</div>
<div class="col-md-3">
@if(Auth::user()->can('payroll-category-create') || Auth::user()->can('payroll-category-view') || Auth::user()->can('payroll-category-delete'))
<h3 class="box-title">{{ __('payroll_categories.payroll_categories') }}</h3>
<ul class="feeds">
@if(Auth::user()->can('payroll-category-create'))
<a href="{{ route('payroll_categories.create') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('payroll_categories.add_category') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('payroll-category-view'))
<a href="{{ route('payroll_categories.index') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('payroll_categories.view_category') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('payroll-category-delete'))
<a href="{{ route('payroll_categories.inactive') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('payroll_categories.inactive_category') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
</ul>
@endif
</div>
</div>
<hr/>
@endif
<div class="row">
<div class="col-md-3">
<h3 class="box-title">{{ __('finance.expenses_or_payments') }}</h3>
<ul class="feeds">
<!--start of payments-->
@if(Auth::user()->can('Payments-create-payment-item') || Auth::user()->can('Payments-list-payment-items')|| Auth::user()->can('Payments-make-payment')
|| Auth::user()->can('Payments-view-payments-history') || Auth::user()->can('Payments-activate-payment-item'))
@if(Auth::user()->can('Payments-make-payment'))
<a href="{{ route('payments.new_payment') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.manage_bills_or_expenses') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('Payments-create-payment-item'))
<a href="{{ route('payment_items.create') }}">
<li>
<div class="bg-info"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.manage_payment_items') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
{{-- @if(Auth::user()->can('Payments-list-payment-items'))--}}
{{-- <a href="{{ route('payment_items.index') }}">--}}
{{-- <li>--}}
{{-- <div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> View Payment Item<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>--}}
{{-- </li>--}}
{{-- </a>--}}
{{-- @endif--}}
{{-- @if(Auth::user()->can('Payments-activate-payment-item'))--}}
{{-- <a href="{{ url('/payment_items/inactive') }}">--}}
{{-- <li>--}}
{{-- <div class="bg-danger"><i class="fa fa-plus-circle text-white"></i></div> Inactive Payment Items<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>--}}
{{-- </li>--}}
{{-- </a>--}}
{{-- @endif--}}
@if(Auth::user()->can('Payments-view-payments-history'))
<a href="{{ route('payments.view_payments') }}">
<li>
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.view_expenses_report') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@endif
<!--end of payments-->
</ul>
</div>
<div class="col-md-3">
@if(Auth::user()->can('price-list-category-create') || Auth::user()->can('price-list-category-view') || Auth::user()->can('price-list-category-delete'))
<h3 class="box-title">{{ __('finance.price_list') }}</h3>
<ul class="feeds">
@if(Auth::user()->can('price-list-category-create'))
<a href="{{ route('price_list_category.create') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.add_category') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('price-list-category-view'))
<a href="{{ route('price_list_category.index') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.view_categories') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('price-list-category-delete'))
<a href="{{ route('price_list_category.inactive') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.inactive_categories') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
</ul>
@endif
</div>
<div class="col-md-3">
<h3 class="box-title">{{ __('finance.chart_of_accounts') }}</h3>
<ul class="feeds">
<!--start of chart of accounts listing-->
@if(Auth::user()->can('chart-of-accounts-list') || Auth::user()->can('create-chart-of-accounts') || Auth::user()->can('view-of-account-details') || Auth::user()->can('activate-chart-of-accounts'))
@if(Auth::user()->can('create-chart-of-accounts'))
<a href="{{ route('chart_of_accounts.create') }}">
<li>
<div class="bg-info"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.add_account') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-chart-of-account-details'))
<a href="{{ route('chart_of_accounts.index') }}">
<li>
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.view_accounts') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('activate-chart-of-accounts') || Auth::user()->can('de-activate-chart-of-accounts'))
<a href="{{ route('chart_of_accounts.inactive') }}">
<li>
<div class="bg-danger"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.inactive_accounts') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@endif
<!--end of chart of accounts listing-->
</ul>
</div>
<div class="col-md-3">
<h3 class="box-title">{{ __('finance.account_types') }}</h3>
<ul class="feeds">
<!--start of account types listing-->
@if(Auth::user()->can('account-types-list') || Auth::user()->can('create-account-types') || Auth::user()->can('view-account-type-details') || Auth::user()->can('activate-account-types'))
<!-- NO ONE SHOULD BE ABLE TO ADD A NEW ACCOUNT TYPE -->
<!-- @if(Auth::user()->can('create-account-types'))
<a href="{{ route('account_types.create') }}">
<li>
<div class="bg-info"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.add_account_type') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif -->
@if(Auth::user()->can('account-types-list'))
<a href="{{ route('account_types.index') }}">
<li>
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.view_account_types') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('activate-account-types'))
<a href="{{ route('account_types.inactive') }}">
<li>
<div class="bg-danger"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.inactive_account_types') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@endif
<!--end of account types listing-->
</ul>
</div>
</div>
<hr/>
<div class="row">
<div class="col-md-3">
<h3 class="box-title">{{ __('finance.banking') }}</h3>
<ul class="feeds">
<!--start of banking-->
@if(Auth::user()->can('banking-make-deposit'))
<a href="{{ route('banking.deposit') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.make_bank_deposit') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('banking-make-transfers'))
<a href="{{ route('banking.transfer') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.make_bank_transfer') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('banking-make-deposit'))
<a href="{{ route('banking.deposit_history') }}">
<li>
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.bank_deposit_history') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('banking-view-history'))
<a href="{{ route('banking.transfer_history') }}">
<li>
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.bank_transfer_history') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('banking-register'))
<a href="{{ route('banking.register') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.bank_register_report') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('banking-reconciliation'))
<a href="{{ route('banking.reconcile') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.bank_reconciliation') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
<a href="{{ route('banking.reconcile.reports') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.bank_reconciliation_reports') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
<!--end of banking-->
</ul>
</div>
@if( Auth::user()->can('payroll-create') || Auth::user()->can('payroll-list') || Auth::user()->can('payroll-delete'))
<div class="col-md-3">
<h3 class="box-title">{{ __('finance.payrolls') }}</h3>
<ul class="feeds">
@if( Auth::user()->can('payroll-create'))
<a href="{{ route('payroll.create') }}">
<li>
<div class="bg-info"><i class="fa fa-plus-circle text-white"></i></div> {{ __('payroll.add_payroll_employee') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if( Auth::user()->can('payroll-create'))
<a href="{{ route('payroll.bulk_create') }}">
<li>
<div class="bg-info"><i class="fa fa-plus-circle text-white"></i></div> {{ __('payroll.add_multiple_payroll_employees') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if( Auth::user()->can('payroll-list'))
<a href="{{ route('payroll.index') }}">
<li>
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('payroll.view_payrolls') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if( Auth::user()->can('payroll-delete'))
<a href="{{ route('payroll.inactive') }}">
<li>
<div class="bg-danger"><i class="fa fa-plus-circle text-white"></i></div> {{ __('payroll.inactive_payrolls') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if( Auth::user()->can('payroll-list'))
<a href="{{ route('payroll.view_payroll_payments') }}">
<li>
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.view_payslips') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if( Auth::user()->can('payroll-delete'))
<a href="{{ route('payroll.inactive_payslips') }}">
<li>
<div class="bg-danger"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.deleted_payslips') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
</ul>
</div>
@endif
<div class="col-md-3">
<h3 class="box-title">{{ __('finance.items') }}</h3>
<ul class="feeds">
@if(Auth::user()->can('fixed-assets-list') || Auth::user()->can('view-family-account'))
<a href="{{ route('equities.index') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.equity_management') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@if(Auth::user()->can('fixed-assets-list'))
<a href="{{ route('fixed_assets.index') }}">
<li>
<div class="bg-danger"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.fixed_assets') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(is_family_account_feature_enabled())
@if(Auth::user()->can('view-family-account'))
<a href="{{ route('family_accounts.index') }}">
<li>
<div class="bg-info"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.family_accounts') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
<a href="{{ route('family_accounts.consumption_report') }}">
<li>
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.family_accounts_consumption_report') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
<a href="{{ route('family_accounts.deposit_report') }}">
<li>
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.family_accounts_deposit_report') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@endif
@endif
<!--end of chart of accounts listing-->
</ul>
</div>
<div class="col-md-3">
<h3 class="box-title">{{ __('finance.discounts') }}</h3>
<ul class="feeds">
<!--start of discounts-->
@if( Auth::user()->can('discount-create') || Auth::user()->can('discount-list') || Auth::user()->can('discount-category-list') ||
Auth::user()->can('discount-category-create') || Auth::user()->can('discount-category-delete') || Auth::user()->can('change-drugs-covered-by-category'))
@if(Auth::user()->can('discount-create'))
<a href="{{ route('discounts.create') }}">
<li>
<div class="bg-info"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.new_patient_discount') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('discount-list') || Auth::user()->can('change-drugs-covered-by-category'))
<a href="{{ route('discounts.index') }}">
<li>
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.view_patient_discounts') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('discount-category-list'))
<a href="{{ route('discount_category.create') }}">
<li>
<div class="bg-info"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.new_discount_category') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('discount-category-create'))
<a href="{{ route('discount_category.index') }}">
<li>
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.view_discount_categories') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('discount-category-delete'))
<a href="{{ route('discount_category.inactive') }}">
<li>
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.view_inactive_discount_categories') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@endif
<!--end of discounts-->
</ul>
</div>
</div>
<hr/>
<div class="row">
<div class="col-md-3">
<h3 class="box-title">{{ __('finance.reports_title') }}</h3>
<ul class="feeds">
@if(Auth::user()->can('finance-reports-activate'))
<a href="{{ route('finance_reports.index') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.reports') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
</ul>
</div>
<div class="col-md-3">
<h3 class="box-title">{{ __('finance.invoices_title') }}</h3>
<ul class="feeds">
@if(Auth::user()->can('Invoices-generate') || Auth::user()->can('Invoices-receive-payments') || Auth::user()->can('Invoices-view-payments-history'))
<a href="{{ route('invoices') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.invoices') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
</ul>
</div>
@if( Auth::user()->can('journals-view') )
<div class="col-md-3">
<h3 class="box-title">{{ __('finance.journals_title') }}</h3>
<ul class="feeds">
<a href="{{ route('journals') }}">
<li>
<div class="bg-info"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.journals') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
</ul>
</div>
@endif
@if( Auth::user()->can('budget-list') )
<div class="col-md-3">
<h3 class="box-title">{{ __('finance.title_budgets') }}</h3>
<ul class="feeds">
<a href="{{ route('budgets.index') }}">
<li>
<div class="bg-info"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.budgets') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
</ul>
</div>
@endif
</div>
</div>
@endsection
@@ -0,0 +1,206 @@
@extends('layouts.main')
@push('styles')
<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" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.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">{{ __('fixed_assets.fixed_assets') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('fixed_assets.dashboard') }}</a></li>
<li><a href="{{ route('fixed_assets.index') }}">{{ __('fixed_assets.fixed_assets') }}</a></li>
<li class="active">{{ __('fixed_assets.add') }}</li>
</ol>
</div>
</div>
@include('flash::message')
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
@include('finance::fixed_assets.menu')
<div class="row">
<div class="col-sm-12">
<div class="white-box">
{{ Form::open(['route' => 'fixed_assets.store','data-toggle'=>'validator']) }}
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('name', __('fixed_assets.asset_name')) }}
{{ Form::text('name', '', ['class'=>'form-control compulsory','required']) }}
</div>
<div class="form-group">
{{ Form::label('serial_number', __('fixed_assets.serial_number')) }}
{{ Form::text('serial_number', '', ['class'=>'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('cost_price', __('fixed_assets.cost_price') ." / Asset Value") }}
{{ Form::number('cost_price', '', ['class'=>'form-control compulsory', 'id'=>'cost_price', 'required']) }}
</div>
<div class="form-group">
{{ Form::label('acquisition_date', __('fixed_assets.acquisition_date')) }}
<div class="input-group">
{{ Form::text('acquisition_date','',['class' => 'form-control compulsory','required'=>'true','readonly'=>'true','id'=>'datepicker-autoclose']) }}
<span class="input-group-addon" required><i class="icon-calender"></i></span>
</div>
</div>
<div class="form-group">
{{ Form::label('depreciation', __('fixed_assets.depreciation')) }}
{{ Form::number('depreciation', '', ['class'=>'form-control', 'step' => 'any']) }}
</div>
<div class="form-group">
{{ Form::label('item_condition',__('fixed_assets.item_condition')) }}
<br>
<div>
&nbsp;{{ Form::radio('item_condition', 1, false, ["required"]) }} New
&nbsp;{{ Form::radio('item_condition', 0, false, ["required"]) }} Used
</div>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('supplier', __('fixed_assets.supplier')) }}
{{ Form::select('supplier', $suppliers, null, ['class'=>'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('fixed_asset_account', __('fixed_assets.fixed_asset_account')) }}
{{ Form::select('fixed_asset_account', $fixed_asset_chart_of_accounts, null, ['class'=>'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('warranty_expiration_date',__('fixed_assets.warranty_expiry')) }}
<div class="input-group">
{{ Form::text('warranty_expiration_date','',['class' => 'form-control','readonly'=>'true','id'=>'datepicker-autoclose2']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
@php $payment_type = array(''=>'-select-','cash'=>'Cash / EFT / CHEQUE', 'bill'=>'Bill', 'asset_exists'=>'Already Existing Asset'); @endphp
<div class="form-group">
{{ Form::label('payment_type', 'Payment Type') }}
{{ Form::select('payment_type', $payment_type, null, ['class'=>'form-control compulsory', 'required', 'id'=>'payment_type']) }}
</div>
<div id="cash_div" style="display: none">
<div class="form-group">
{{ Form::label('bank_account_id', __('fixed_assets.bank_account')) }}
{{ Form::select('bank_account_id', $bank_chart_of_accounts, null, ['class'=>'form-control']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('amount_paid', 'Amount Paid') }}
{{ Form::number('amount_paid', 0, ['class'=>'form-control compulsory', 'required', 'id'=>'amount_paid', 'onkeyup'=>'get_balance()']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('balance', 'balance') }}
{{ Form::number('balance', 0, ['class'=>'form-control', 'readonly', 'id'=>'balance']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div id="bill_div" style="display: none">
<div class="form-group">
{{ Form::label('payable_account', 'Payable Account') }}
{{ Form::select('payable_account', $payable_accounts, 14, ['class'=>'form-control']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
{{ Form::label('description', __('fixed_assets.description')) }}
{{ Form::textArea('description', '', ['class'=>'form-control', 'rows' => 4]) }}
</div>
<button class="btn btn-rounded btn-success pull-right" onclick="return confirm('Are you sure you wish to purchase this asset ?')">{{ __('fixed_assets.create_fixed_asset') }}</button>
</div>
</div>
{{ Form::close() }}
</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>
<!-- data time piker dependency -->
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<!-- -->
<script>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
$('#datepicker-autoclose,#datepicker-autoclose2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy',
setDate: new Date(),
readOnly: true
});
$('#payment_type').change(function() {
if (this.value === 'cash') {
$('#cash_div').show();
$('#bill_div').hide();
} else if (this.value === 'bill') {
$('#cash_div').hide()
$('#bill_div').show()
} else {
$('#cash_div').hide()
$('#bill_div').hide()
}
});
function get_balance() {
var bill_div = $('#bill_div');
let cost_price = $('#cost_price').val();
let amount_paid = $('#amount_paid').val();
let balance = parseInt(cost_price) - parseInt(amount_paid);
$('#balance').val(balance);
(balance > 0) ? bill_div.show(): bill_div.hide();
}
</script>
@endpush
@@ -0,0 +1,248 @@
@extends('layouts.main')
@push('styles')
<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" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.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">{{ __('fixed_assets.fixed_assets') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('fixed_assets.dashboard') }}</a></li>
<li><a href="{{ route('fixed_assets.index') }}">{{ __('fixed_assets.fixed_assets') }}</a></li>
<li class="active">{{ __('fixed_assets.edit') }}</li>
</ol>
</div>
</div>
@include('flash::message')
@include('finance::fixed_assets.menu')
<div class="row">
<div class="col-sm-12">
<div class="white-box">
{{ Form::model($fixed_asset, ['method' => 'PUT', 'route' => ['fixed_assets.update',$fixed_asset], 'data-toggle' => 'validator']) }}
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('name', __('fixed_assets.asset_name')) }}
{{ Form::text('name', $fixed_asset->name, ['class'=>'form-control compulsory','required']) }}
</div>
<div class="form-group">
{{ Form::label('serial_number', __('fixed_assets.serial_number')) }}
{{ Form::text('serial_number', $fixed_asset->serial_number , ['class'=>'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('cost_price', __('fixed_assets.cost_price')) }}
{{ Form::number('cost_price', $fixed_asset->cost_price , ['class'=>'form-control', 'readonly','onkeyup'=>'get_balance()']) }}
</div>
<div class="form-group"> @php $acquisition_date = \Carbon\Carbon::parse($fixed_asset->acquisition_date)->format('d-m-Y'); @endphp
{{ Form::label('acquisition_date', __('fixed_assets.acquisition_date')) }}
<div class="input-group">
{{ Form::text('acquisition_date', $acquisition_date, ['class' => 'form-control compulsory', 'required','readonly'=>'true','id'=>'datepicker-autoclose']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
<div class="form-group">
{{ Form::label('depreciation', __('fixed_assets.depreciation')) }}
{{ Form::number('depreciation', $fixed_asset->depreciation , ['class'=>'form-control', 'step' => 'any']) }}
</div>
<div class="form-group">
{{ Form::label('item_condition',__('fixed_assets.item_condition')) }}
<br>
<div>
&nbsp;{{ Form::radio('item_condition', 1, false, ["required"]) }} New
&nbsp;{{ Form::radio('item_condition', 0, false, ["required"]) }} Used
</div>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('supplier', __('fixed_assets.supplier')) }}
{{ Form::select('supplier', $suppliers, $fixed_asset->supplier_id, ['class'=>'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('fixed_asset_account', __('fixed_assets.fixed_asset_account')) }}
{{ Form::select('fixed_asset_account', $fixed_asset_chart_of_accounts, $fixed_asset->fixed_asset_account_id, ['class'=>'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('warranty_expiration_date',__('fixed_assets.warranty_expiry')) }}
<div class="input-group">
{{ Form::text('warranty_expiration_date',$fixed_asset->warranty_expiration_date,['class' => 'form-control compulsory', 'required','readonly'=>'true','id'=>'datepicker-autoclose2']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
<div class="form-group">
{{ Form::label('edit_payment_type', 'Edit payment options') }}
<br>
<div>
&nbsp;{{ Form::radio('edit_payment_type', 1, false, ["required", "id" => "edit_payment"]) }} Yes
&nbsp;{{ Form::radio('edit_payment_type', 0, false, ["required", "id" => "do_not_edit_payment"]) }} No
</div>
<div class="help-block with-errors"></div>
</div>
@php
$payment_type = array(''=>'-select-','cash'=>'Cash / EFT / CHEQUE', 'bill'=>'Bill', 'asset_exists'=>'Already Existing Asset');
$balance = 0;
$payable_account_id = 14; //default payable
$bill = \Streamline\Models\HospitalBill::where(['item_ids' => $fixed_asset->id, 'bill_type' => 'ASSETS'])->first();
if ($bill) {
$balance = (int)$bill->total_amount;
$payable_account_id = $bill->payable_account;
}
@endphp
<div id="edit_payment_type_div" style="display: none;">
@if($fixed_asset->payment_type != null)
<div class="form-group">
{{ Form::label('payment_type', 'Payment Type') }}
{{ Form::select('payment_type', $payment_type, $fixed_asset->payment_type, ['class'=>'form-control compulsory', 'required', 'id'=>'payment_type']) }}
</div>
<div id="cash_div" @if($fixed_asset->payment_type != "cash") style="display: none" @endif>
<div class="form-group">
{{ Form::label('bank_account_id', __('fixed_assets.bank_account')) }}
{{ Form::select('bank_account_id', $bank_chart_of_accounts, $fixed_asset->bank_account_id, ['class'=>'form-control']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('amount_paid', 'Amount Paid') }}
{{ Form::number('amount_paid', $fixed_asset->cost_price-$balance, ['class'=>'form-control compulsory', 'required', 'id'=>'amount_paid', 'onkeyup'=>'get_balance()']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('balance', 'balance') }}
{{ Form::number('balance', $balance, ['class'=>'form-control', 'readonly', 'id'=>'balance']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div id="bill_div" @if($fixed_asset->payment_type != "bill") style="display: none" @endif>
<div class="form-group">
{{ Form::label('payable_account', 'Payable Account') }}
{{ Form::select('payable_account', $payable_accounts, $payable_account_id, ['class'=>'form-control']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
{{ Form::label('description', __('fixed_assets.description')) }}
{{ Form::textArea('description', $fixed_asset->description , ['class'=>'form-control', 'rows' => 4]) }}
</div>
@else
<div class="alert alert-info">Can not edit payment type</div>
@endif
</div>
</div>
{{ Form::button(__('fixed_assets.update'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('fixed_assets.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
</div>
{{ Form::close() }}
</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>
<!-- data time piker dependency -->
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<!-- -->
<script>
window.onload = function(){
var fixed_asset = {!! json_encode($fixed_asset) !!};
console.log(fixed_asset);
$('#datepicker-autoclose').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy',
setDate: fixed_asset.acquisition_date,
readOnly: true
});
$('#datepicker-autoclose2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy',
setDate: fixed_asset.warranty_expiration_date,
readOnly: true
});
}
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
$('#payment_type').change(function() {
if (this.value === 'cash') {
$('#cash_div').show();
$('#bill_div').hide();
} else if (this.value === 'bill') {
$('#cash_div').hide()
$('#bill_div').show()
} else {
$('#cash_div').hide()
$('#bill_div').hide()
}
});
$('#edit_payment,#do_not_edit_payment').click(function(){
if($('#edit_payment').is(':checked')) {
$('#edit_payment_type_div').show();
$("#cost_price").removeAttr("readonly");
}
if($('#do_not_edit_payment').is(':checked')) {
$('#edit_payment_type_div').hide();
}
});
function get_balance() {
var bill_div = $('#bill_div');
let cost_price = $('#cost_price').val();
let amount_paid = $('#amount_paid').val();
let balance = parseInt(cost_price) - parseInt(amount_paid);
$('#balance').val(balance);
(balance > 0) ? bill_div.show(): bill_div.hide();
}
</script>
@endpush
@@ -0,0 +1,151 @@
@extends('layouts.main')
@push('styles')
<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">{{ __('fixed_assets.fixed_assets') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('fixed_assets.dashboard') }}</a></li>
<li><a href="/service_items/index">{{ __('fixed_assets.fixed_assets') }}</a></li>
<li class="active">{{ __('fixed_assets.view') }}</li>
</ol>
</div>
</div>
@include('flash::message')
@include('finance::fixed_assets.menu')
<div class="row">
<div class="col-sm-12">
<div class="white-box">
<p class="text-muted m-b-30">{{ __('fixed_assets.export_to_pdf') }}</p>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>{{ __('fixed_assets.asset_name') }}</th>
<th>{{ __('fixed_assets.serial_number') }}</th>
<th>{{ __('fixed_assets.cost_price') }}</th>
<th>{{ __('fixed_assets.acquisition_date') }}</th>
<th>{{ __('fixed_assets.description') }}</th>
<th>{{ __('fixed_assets.warranty_expiry') }}</th>
<th>{{ __('fixed_assets.item_condition') }}</th>
<th>{{ __('fixed_assets.supplier') }}</th>
<th>{{ __('fixed_assets.payment_type') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@php $total_fixed_assets_value = 0; @endphp
@if(count($fixed_assets) > 0)
@foreach($fixed_assets as $fixed_asset)
@php $total_fixed_assets_value += $fixed_asset->cost_price; @endphp
<tr>
<td>{{ $fixed_asset->name }}</td>
<td>{{ $fixed_asset->serial_number }}</td>
<td>{{ ugandan_shillings($fixed_asset->cost_price) }}</td>
<td>{{ $fixed_asset->acquisition_date }}</td>
<td>{{ $fixed_asset->description }}</td>
<td>{{ $fixed_asset->warranty_expiration_date }}</td>
<td>{{ $fixed_asset->item_condition == 1 ? 'New' : 'Used' }}</td>
<td>{{ isset($suppliers[$fixed_asset->supplier_id]) ? $suppliers[$fixed_asset->supplier_id] : "" }}</td>
<td>
@switch($fixed_asset->payment_type)
@case("cash")
<span>Cash/EFT/Cheque</span>
@break
@case("bill")
<span>Bill</span>
@break
@case("asset_exists")
<span>Already existing asset</span>
@break
@default
@endswitch
</td>
<td>
@if(Auth::user()->can('edit-fixed-assets'))
<a href="/fixed_assets/{{ $fixed_asset->id }}/edit/" class="btn btn-default btn-sm"><i class="fa fa-pencil"></i> {{ __('fixed_assets.edit') }}</a>
@endif
</td>
<td>
@if(Auth::user()->can('delete-fixed-assets'))
{{ Form::model($fixed_asset->id ,['method' => 'DELETE', 'route' => ['fixed_assets.destroy', $fixed_asset->id]]) }}
<button type="submit" class="btn btn-danger btn-sm deleteButton" value="{{$fixed_asset->id}}"><i class="fa fa-trash"></i>
{{ __('fixed_assets.delete') }}</button>
{{ Form::close() }}
@endif
</td>
</tr>
@endforeach
@endif
</tbody>
<tfoot>
<tr>
<td></td>
<td><strong>{{ __('family_accounts.total') }}</strong></td>
<td colspan="9"><strong>{{ ugandan_shillings($total_fixed_assets_value) }}</strong></td>
</tr>
</tfoot>
</table>
</div>
</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>
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 50,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
$(".deleteButton").click(function(e){
//e.preventDefault();
var fixedAssetId = $(this).val();
console.log(fixedAssetId);
checkBeforeSubmission(fixedAssetId);
})
function checkBeforeSubmission(fixedAssetId) {
$.ajax({
url: '/is_fixed_asset_attached_to_bill',
data: {'fixed_asset_id':fixedAssetId},
success: function(response){
if (response == "has_attached_bill") {
return confirm('The corresponding bill attached to this asset will also be deleted. Do you want to proceed');
} else {
return confirm('The corresponding chart of accounts will be affected by this action. Do you want to proceed');
}
}
});
}
</script>
@endpush
@@ -0,0 +1,8 @@
<div class="panel panel-default">
<div class="panel-body">
<a href="\fixed_assets\create" class="nav-item btn btn-default ti-plus"> {{ __('fixed_assets.add_fixed_asset') }}</a>
<!-- <a href="\fixed_assets\edit" class="nav-item btn btn-default ti-pencil"> Edit Fixed Asset</a> -->
<a href="\fixed_assets" class="nav-item btn btn-default ti-pencil"> {{ __('fixed_assets.view_fixed_assets') }}</a>
<!-- <a href="#" class="nav-item btn btn-danger ti-pencil"> Delete Fixed Asset</a> -->
</div>
</div>
@@ -0,0 +1,188 @@
@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" />
<style type="text/css">
.color-bordered-table.success-bordered-table {
border-top: 0px;
}
</style>
@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">{{ __('markup_tags.create_markup_tag') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('markup_tags.dashboard') }}</a></li>
<li><a href="{{ route('stores.index') }}">{{ __('markup_tags.stores') }}</a></li>
<li class="active">{{ __('markup_tags.create_markup_tag') }}</li>
</ol>
</div>
</div>
@include('finance::markup_tags.menu')
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
<div class="row">
<div class="col-sm-4">
<strong>{{ __('markup_tags.existing_markups') }}</strong>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>#</th>
<th>{{ __('markup_tags.name') }}</th>
<th>{{ __('markup_tags.percentage') }}</th>
</tr>
</thead>
<tbody>
@php $counter = 1; @endphp
@foreach($tags as $tag)
<tr>
<td>{{ $counter }}</td>
<td>{{ $tag->name }}</a></td>
<td>{{ $tag->percentage }}%</td>
</tr>
@php $counter++; @endphp
@endforeach
</tbody>
</table>
</div>
</div>
<div class="col-sm-8">
{{ Form::open(['route' => 'markup_tag.drug_markup_search', 'method' => 'ANY', 'role' => 'search']) }}
<div class="row">
<div class="col-md-8">
<div class="form-group" id="drug_names">
{{ Form::text('drug_name', '', ['class' => 'form-control typeahead', 'placeholder' => __('markup_tags.search_name'), 'autocomplete' => 'off', 'spellcheck' => false]) }}
</div>
</div>
<div class="col-md-4">
<button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-search"></span> {{ __('markup_tags.search') }}</button>
</div>
</div>
@if(isset($criteria) && isset($resultCount))
<p>
{{ __('markup_tags.search_criteria') }} : <code>{{ $criteria }}</code> &nbsp;&nbsp;&nbsp;{{ __('markup_tags.total_results') }} : <code>{{ $resultCount }}</code> &nbsp;&nbsp;&nbsp;<a href="{{ route('drugs.index') }}">{{ __('markup_tags.clear_search') }}</a>
</p>
@endif
{{ Form::close() }}
{{ Form::open(['route' => 'markup_tag.update_mark_up_to_drug', 'data-toggle' => 'validator']) }}
<div class="form-group">
{{ Form::label('markup_tag', __('markup_tags.select_markup')) }}
{{ Form::select('markup_tag', $tags_select, '', ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<input id="select_all" type="checkbox"> {{ __('markup_tags.select_all_drugs') }}
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th style="width: 5%">#</th>
<th style="width: 60%">{{ __('markup_tags.name') }}</th>
<th style="width: 30%">{{ __('markup_tags.current_markup') }}</th>
<th style="width: 5%"></th>
</tr>
</thead>
<tbody>
@php $counter = 1; @endphp
@foreach($drugs as $drug)
<tr>
<td>{{ $counter }}</td>
<td>{{ $drug->name }}</td>
<td><font color="blue">{{ isset($tags_array[$drug->markup_tag_id]) ? $tags_array[$drug->markup_tag_id] : "" }}</font></td>
<td><input type="checkbox" name="checked_drug[]" value="{{ $drug->id }}" class="item_checkbox"></td>
</tr>
@php $counter++; @endphp
@endforeach
</tbody>
</table>
</div>
{{ Form::button(__('markup_tags.apply'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('markup_tags.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
</div>
{{ Form::close() }}
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
<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>
var substringMatcher = function (strs) {
return function findMatches(q, cb) {
var matches, substringRegex;
// an array that will be populated with substring matches
matches = [];
// regex used to determine if a string contains the substring `q`
substrRegex = new RegExp(q, 'i');
// iterate through the pool of strings and for any string that
// contains the substring `q`, add it to the `matches` array
$.each(strs, function (i, str) {
if (substrRegex.test(str)) {
matches.push(str);
}
});
cb(matches);
};
};
$('#drug_names .typeahead').typeahead(
{
hint: true,
highlight: true,
minLength: 1
},
{
name: 'drug_names',
source: substringMatcher(<?php echo json_encode($names_array); ?>)
}
);
/*$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});*/
$('#select_all').change(function() {
if (this.checked === true) {
$(".item_checkbox").each(function() {
this.checked = true;
});
} else {
$(".item_checkbox").each(function() {
this.checked = false;
});
}
});
</script>
@endpush
@@ -0,0 +1,187 @@
@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" />
<style type="text/css">
.color-bordered-table.success-bordered-table {
border-top: 0px;
}
</style>
@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">{{ __('markup_tags.create_markup_tag') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('markup_tags.dashboard') }}</a></li>
<li><a href="{{ route('stores.index') }}">{{ __('markup_tags.stores') }}</a></li>
<li class="active">{{ __('markup_tags.create_markup_tag') }}</li>
</ol>
</div>
</div>
@include('finance::markup_tags.menu')
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
<div class="row">
<div class="col-sm-4">
<strong>{{ __('markup_tags.existing_markups') }}</strong>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>#</th>
<th>{{ __('markup_tags.name') }}</th>
<th>{{ __('markup_tags.percentage') }}</th>
</tr>
</thead>
<tbody>
@php $counter = 1; @endphp
@foreach($tags as $tag)
<tr>
<td>{{ $counter }}</td>
<td>{{ $tag->name }}</a></td>
<td>{{ $tag->percentage }}%</td>
</tr>
@php $counter++; @endphp
@endforeach
</tbody>
</table>
</div>
</div>
<div class="col-sm-8">
{{ Form::open(['route' => 'markup_tag.sundry_markup_search', 'method' => 'ANY', 'role' => 'search']) }}
<div class="row">
<div class="col-md-8">
<div class="form-group" id="sundry_names">
{{ Form::text('sundry_name', '', ['class' => 'form-control typeahead', 'placeholder' => __('markup_tags.search_name'), 'autocomplete' => 'off', 'spellcheck' => false]) }}
</div>
</div>
<div class="col-md-4">
<button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-search"></span> {{ __('markup_tags.search') }}</button>
</div>
</div>
@if(isset($criteria) && isset($resultCount))
<p>
{{ __('markup_tags.search_criteria') }} : <code>{{ $criteria }}</code> &nbsp;&nbsp;&nbsp;{{ __('markup_tags.total_results') }} : <code>{{ $resultCount }}</code> &nbsp;&nbsp;&nbsp;<a href="{{ route('sundries.index') }}">{{ __('markup_tags.clear_search') }}</a>
</p>
@endif
{{ Form::close() }}
{{ Form::open(['route' => 'markup_tag.update_mark_up_to_sundry', 'data-toggle' => 'validator']) }}
<div class="form-group">
{{ Form::label('markup_tag', __('markup_tags.select_markup')) }}
{{ Form::select('markup_tag', $tags_select, '', ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<input id="select_all" type="checkbox"> {{ __('markup_tags.select_all_drugs') }}
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th style="width: 5%">#</th>
<th style="width: 60%">{{ __('markup_tags.name') }}</th>
<th style="width: 30%">{{ __('markup_tags.current_markup') }}</th>
<th style="width: 5%"></th>
</tr>
</thead>
<tbody>
@php $counter = 1; @endphp
@foreach($sundries as $sundry)
<tr>
<td>{{ $counter }}</td>
<td>{{ $sundry->name }}</td>
<td><font color="blue">{{ isset($tags_array[$sundry->markup_tag_id]) ? $tags_array[$sundry->markup_tag_id] : "" }}</font></td>
<td><input type="checkbox" name="checked_sundry[]" value="{{ $sundry->id }}" class="item_checkbox"></td>
</tr>
@php $counter++; @endphp
@endforeach
</tbody>
</table>
</div>
{{ Form::button(__('markup_tags.apply'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('markup_tags.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
</div>
{{ Form::close() }}
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
<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>
var substringMatcher = function (strs) {
return function findMatches(q, cb) {
var matches, substringRegex;
// an array that will be populated with substring matches
matches = [];
// regex used to determine if a string contains the substring `q`
substrRegex = new RegExp(q, 'i');
// iterate through the pool of strings and for any string that
// contains the substring `q`, add it to the `matches` array
$.each(strs, function (i, str) {
if (substrRegex.test(str)) {
matches.push(str);
}
});
cb(matches);
};
};
$('#sundry_names .typeahead').typeahead(
{
hint: true,
highlight: true,
minLength: 1
},
{
name: 'sundry_names',
source: substringMatcher(<?php echo json_encode($names_array); ?>)
}
);
/*$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});*/
$('#select_all').change(function() {
if (this.checked === true) {
$(".item_checkbox").each(function() {
this.checked = true;
});
} else {
$(".item_checkbox").each(function() {
this.checked = false;
});
}
});
</script>
@endpush
@@ -0,0 +1,87 @@
@extends('layouts.main')
@push('styles')
<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" />
<style type="text/css">
.color-bordered-table.success-bordered-table {
border-top: 0px;
}
</style>
@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">{{ __('markup_tags.create_markup_tag') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('markup_tags.dashboard') }}</a></li>
<li><a href="{{ route('stores.index') }}">{{ __('markup_tags.stores') }}</a></li>
<li class="active">{{ __('markup_tags.create_markup_tag') }}</li>
</ol>
</div>
</div>
@include('finance::markup_tags.menu')
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
<div class="row">
<div class="col-sm-4">
<h3>{{ __('markup_tags.create_new_markup_tag') }}</h3>
</div>
<div class="col-sm-4">
{{ Form::open(['route' => 'markup_tag.store', 'data-toggle' => 'validator']) }}
<div class="form-group">
{{ Form::label('name', __('markup_tags.name')) }}
{{ Form::text('name', '', ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('percentage', __('markup_tags.percentage')) }}
{{ Form::number('percentage', '', ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
{{ Form::button(__('markup_tags.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('markup_tags.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
</div>
&nbsp;&nbsp;
<div class="col-sm-4">
</div>
<div class="col-sm-1"></div>
{{ Form::close() }}
</div>
</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>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
</script>
@endpush
@@ -0,0 +1,87 @@
@extends('layouts.main')
@push('styles')
<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" />
<style type="text/css">
.color-bordered-table.success-bordered-table {
border-top: 0px;
}
</style>
@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">{{ __('markup_tags.edit_markup_tag') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('markup_tags.dashboard') }}</a></li>
<li><a href="{{ route('stores.index') }}">{{ __('markup_tags.stores') }}</a></li>
<li class="active">{{ __('markup_tags.edit_markup_tag') }}</li>
</ol>
</div>
</div>
@include('finance::markup_tags.menu')
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
<div class="row">
<div class="col-sm-4">
<h3>{{ __('markup_tags.edit_markup_tag_per') }}</h3>
</div>
<div class="col-sm-4">
{{ Form::model($tag, ['method' => 'PUT', 'route' => ['markup_tag.update',$tag] , 'data-toggle' => 'validator']) }}
<div class="form-group">
{{ Form::label('name', __('markup_tags.name')) }}
{{ Form::text('name', $tag->name, ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('percentage', __('markup_tags.percentage')) }}
{{ Form::number('percentage', $tag->percentage, ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
{{ Form::button(__('markup_tags.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('markup_tags.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
</div>
&nbsp;&nbsp;
<div class="col-sm-4">
</div>
<div class="col-sm-1"></div>
{{ Form::close() }}
</div>
</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>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
</script>
@endpush
@@ -0,0 +1,89 @@
@extends('layouts.main')
@push('styles')
<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" />
<style type="text/css">
.color-bordered-table.success-bordered-table {
border-top: 0px;
}
</style>
@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">{{ __('markup_tags.inactive_markup_tag') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('stores.index') }}">{{ __('markup_tags.stores') }}</a></li>
<li class="active">{{ __('markup_tags.inactive_markup_tag') }}</li>
</ol>
</div>
</div>
@include('finance::markup_tags.menu')
<div class="row">
<div class="col-sm-12">
@include('flash::message')
<div class="white-box">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>#</th>
<th>{{ __('markup_tags.name') }}</th>
<th>{{ __('markup_tags.percentage') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@php $counter = 1; @endphp
@foreach($tags as $tag)
<tr>
<td>{{ $counter }}</td>
<td><a href="#">{{ $tag->name }}</a></td>
<td>{{ $tag->percentage }}%</td>
<td>
<a href="/markup_tag/{{ $tag->id }}/edit/" class="btn btn-info btn-sm"><i class="fa fa-pencil"></i> {{ __('markup_tags.edit') }}</a>
</td>
<td>
{{ Form::model($tag->id ,['method' => 'DELETE', 'route' => ['markup_tag.destroy', $tag->id]]) }}
<button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure?')"><i class="fa fa-trash"></i> {{ __('markup_tags.delete') }}</button>
{{ Form::close() }}
</td>
</tr>
@php $counter++; @endphp
@endforeach
</tbody>
</table>
</div>
</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>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
</script>
@endpush
@@ -0,0 +1,90 @@
@extends('layouts.main')
@push('styles')
<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" />
<style type="text/css">
.color-bordered-table.success-bordered-table {
border-top: 0px;
}
</style>
@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">{{ __('markup_tags.markup_tags') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('markup_tags.dashboard') }}</a></li>
<li><a href="{{ route('stores.index') }}">{{ __('markup_tags.stores') }}</a></li>
<li class="active">{{ __('markup_tags.markup_tags') }}</li>
</ol>
</div>
</div>
@include('finance::markup_tags.menu')
<div class="row">
<div class="col-sm-12">
@include('flash::message')
<div class="white-box">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>#</th>
<th>{{ __('markup_tags.name') }}</th>
<th>{{ __('markup_tags.percentage') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@php $counter = 1; @endphp
@foreach($markup_tags as $tag)
<tr>
<td>{{ $counter }}</td>
<td><a href="{{ url('view_markup_drugs') }}/{{ $tag->id }}">{{ $tag->name }}</a> <small>({{ __('markup_tags.click_view_drug_list') }})</small></td>
<td>{{ $tag->percentage }}%</td>
<td>
<a href="/markup_tag/{{ $tag->id }}/edit/" class="btn btn-info btn-sm"><i class="fa fa-pencil"></i> {{ __('markup_tags.edit') }}</a>
</td>
<td>
{{ Form::model($tag->id ,['method' => 'DELETE', 'route' => ['markup_tag.destroy', $tag->id]]) }}
<button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure?')"><i class="fa fa-trash"></i> {{ __('markup_tags.delete') }}</button>
{{ Form::close() }}
</td>
</tr>
@php $counter++; @endphp
@endforeach
</tbody>
</table>
</div>
</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>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
</script>
@endpush
@@ -0,0 +1,7 @@
<div class="panel panel-default">
<div class="panel-body">
<a href="{{ route('markup_tag.create') }}" class="nav-item btn btn-default ti-plus"> {{ __('markup_tags.create_markup_tag') }}</a>
<a href="{{ route('markup_tag.index') }}" class="nav-item btn btn-default ti-pencil"> {{ __('markup_tags.view_markup_tag') }}</a>
<a href="{{ route('markup_tag.inactive') }}" class="nav-item btn btn-default ti-pencil"> {{ __('markup_tags.activate_markup_tag') }}</a>
</div>
</div>
@@ -0,0 +1,98 @@
@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" />
<style type="text/css">
.color-bordered-table.success-bordered-table {
border-top: 0px;
}
</style>
@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">{{ __('markup_tags.markup_tags') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('markup_tags.dashboard') }}</a></li>
<li><a href="{{ route('stores.index') }}">{{ __('markup_tags.stores') }}</a></li>
<li class="active">{{ __('markup_tags.markup_tags') }}</li>
</ol>
</div>
</div>
@include('finance::markup_tags.menu')
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
<div class="row">
<div class="col-sm-4">
<strong>{{ __('markup_tags.markup') }}</strong>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('markup_tags.name') }}</th>
<th>{{ __('markup_tags.percentage') }}</th>
</tr>
</thead>
<tbody>
<tr style="color: blue;">
<td>{{ $tag->name }}</a></td>
<td>{{ $tag->percentage }}%</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-sm-8">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th style="width: 5%">#</th>
<th style="width: 45%">{{ __('markup_tags.name') }}</th>
<th style="width: 25%">{{ __('markup_tags.cost_price') }}</th>
<th style="width: 25%">{{ __('markup_tags.sell_price') }}</th>
</tr>
</thead>
<tbody>
@php $counter = 1; @endphp
@foreach($drugs as $drug)
<tr>
<td>{{ $counter }}</td>
<td>{{ $drug->name }}</td>
<td>{{ ugandan_shillings($drug->cost_price) }}</td>
<td>{{ ugandan_shillings($drug->non_insured_price) }}</td>
</tr>
@php $counter++; @endphp
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
<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>
@endpush
@@ -0,0 +1,328 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
<style>
.no-padding {
padding: 0px;
}
</style>
<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-4 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('general_settings.create_staff_payment_configuration') }} {!! (is_null($price_list_category_id) || $price_list_category_id == 0) ? "<font color='blue'>Cash</font>" : "<font color='blue'>".get_name(get_name($price_list_category_id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories')."</font>" !!}</h4>
</div>
<div class="col-lg-8 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('general_settings.dashboard') }}</a></li>
<li><a href="{{ route('staff_payment_configuration.index') }}">{{ __('general_settings.view_staff_payment_configurations') }}</a></li>
<li class="active">{{ __('general_settings.create_staff_payment_configuration') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('flash::message')
</div>
</div>
{{ Form::open(['route' => 'staff_payment_configuration.store']) }}
<div class="white-box">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-sm-4">
{{ Form::label('staff', 'Staff:') }}
{{ Form::select('user_id', $users_array, '', ['class' => 'form-control', 'id' => 'staff_id']) }}
</div>
<div class="col-sm-4">
{{ Form::label('price_list', 'Price List:') }}
<select name="price_list_category_id" class="form-control" id="price_list_id">
<option value="0"> {{ __('general_settings.cash') }} </option>
@foreach($price_list_categories as $record)
<option value="{{ $record->id }}" {!! (!is_null($price_list_category_id) && $price_list_category_id == $record->id) ? 'selected' : '' !!}>{{ get_name($record->patient_category_id, 'id', 'name', 'patient_categories') }}</option>
@endforeach
</select>
</div>
<div class="col-sm-2">
{{ Form::label('payment_type', 'Payment Type:') }}<br>
{{ Form::radio('payment_type', 0, false, ['id'=> 'fixed_amount','onclick'=>'setRangeOrOptions()']) }}&nbsp;{{ __('general_settings.fixed_amount') }}&nbsp;&nbsp;
{{ Form::radio('payment_type', 1, false, ['id'=> 'percentage','onclick'=>'setRangeOrOptions()']) }}&nbsp;{{ __('general_settings.percentage') }}
</div>
<div class="col-sm-2">
<br>
{{ Form::button('Change Price List',['type'=>'submit','class'=>'btn btn-success btn-rounded','name'=>'submit-btn','value'=>'change_pricing']) }}
</div>
</div>
<div class="row">
<div class="col-sm-12">
<br>
<h5><b>You are setting price for category :</b><font color='blue'> {!! (is_null($price_list_category_id) || $price_list_category_id == 0) ? "Cash" : get_name(get_name($price_list_category_id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories') !!}</font></h5>
</div>
</div>
<br>
<div class="card">
<div class="card-header">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active nav-item"> <a href="#procedures_section" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> Procedures</a> </li>
<li role="presentation" class="nav-item"> <a href="#consultations_section" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> Consultation and services</a> </li>
<li role="presentation" class="nav-item"> <a href="#investigations_section" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> Investigations</a> </li>
</ul>
</div>
<div class="card-block">
<div class="tab-content">
<div id="procedures_section" class="tab-pane active">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>Name</th>
<th>Price</th>
<th class="staff_fixed_amount">Staff Fee</th>
<th style="display: none;" class="staff_percentage">Staff Percentage</th>
</tr>
</thead>
<tbody>
@if(count($procedures) > 0)
@foreach($procedures as $procedure)
<tr>
<td>
{{ $procedure->name }}
</td>
<td>
@if(!is_null($price_list_category_id))
@php
$key = array_search($price_list_category_id, explode(",", $procedure->price_list_category));
$price_list_price_array = explode(",", $procedure->price_list_price);
$price_list_price = isset($price_list_price_array[$key]) ? $price_list_price_array[$key] : 0;
@endphp
{{ ugandan_shillings($price_list_price) }}
<input type="hidden" name="selected_price_list_category_id" value="{{ $price_list_category_id }}">
@else
{{ ugandan_shillings($procedure->non_insured_price) }}
@endif
</td>
<td class="staff_fixed_amount">
{{ Form::hidden('procedure_id[]', $procedure->id) }}
{{ Form::number('procedure_fee[]', '', ['class' => 'form-control']) }}
</td>
<td style="display: none" class="staff_percentage">
{{ Form::number('procedure_percentage[]', '', ['class' => 'form-control', 'max' => '100']) }}
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
</div>
<div id="consultations_section" class="tab-pane">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>Name</th>
<th>Price</th>
<th class="staff_fixed_amount">Staff Fee</th>
<th style="display: none;" class="staff_percentage">Staff Percentage</th>
</tr>
</thead>
<tbody>
@if(count($services) > 0)
@foreach($services as $service)
<tr>
<td>
{{ $service->name }}
</td>
<td>
@if(!is_null($price_list_category_id))
@php
$key = array_search($price_list_category_id, explode(",", $service->price_list_category));
$price_list_price_array = explode(",", $service->price_list_price);
$price_list_price = isset($price_list_price_array[$key]) ? $price_list_price_array[$key] : 0;
@endphp
{{ ugandan_shillings($price_list_price) }}
<input type="hidden" name="selected_price_list_category_id" value="{{ $price_list_category_id }}">
@else
{{ ugandan_shillings($service->cost_price) }}
@endif
</td>
<td class="staff_fixed_amount">
{{ Form::hidden('service_id[]', $service->id) }}
{{ Form::number('service_fee[]', '', ['class' => 'form-control']) }}
</td>
<td style="display: none" class="staff_percentage">
{{ Form::number('service_percentage[]', '', ['class' => 'form-control', 'max' => '100']) }}
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
</div>
<div id="investigations_section" class="tab-pane">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<tr>
<th>Name</th>
<th>Price</th>
<th class="staff_fixed_amount">Staff Fee</th>
<th style="display: none;" class="staff_percentage">Staff Percentage</th>
</tr>
</thead>
<tbody>
@if(count($investigations) > 0)
@foreach($investigations as $investigation)
<tr>
<td>
{{ $investigation->name }}
</td>
<td>
@if(!is_null($price_list_category_id))
@php
$key = array_search($price_list_category_id, explode(",", $investigation->price_list_category));
$price_list_price_array = explode(",", $investigation->price_list_price);
$price_list_price = isset($price_list_price_array[$key]) ? $price_list_price_array[$key] : 0;
@endphp
{{ ugandan_shillings($price_list_price) }}
<input type="hidden" name="selected_price_list_category_id" value="{{ $price_list_category_id }}">
@else
{{ ugandan_shillings($investigation->non_insured_price) }}
@endif
</td>
<td class="staff_fixed_amount">
{{ Form::hidden('investigation_id[]', $investigation->id) }}
{{ Form::number('investigation_fee[]', '', ['class' => 'form-control']) }}
</td>
<td style="display: none" class="staff_percentage">
{{ Form::number('investigation_percentage[]', '', ['class' => 'form-control', 'max' => '100']) }}
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
</div>
{{ Form::button('Save Fees', ['type' => 'submit', 'name' => 'submit_fees', 'class' => 'btn btn-success', 'id' => 'save_fees']) }}
</div>
</div>
</div>
</div>
</div>
</div>
{{ Form::close() }}
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<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/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/js/validator.js') }}"></script>
<script>
$('#staff_id,#procedures,#investigations,#price_list_id').select2({
placeholder: "Select",
width: "100%"
});
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 100,
buttons: [
'copy',
{ extend: 'csv',
message: 'STAFF PAYMENTS'
},
{ extend: 'excel',
message: 'STAFF PAYMENTS',
exportOptions: {
columns: [ 0, 1, 2, 4, 5 ]
},
sheetName: 'STAFF PAYMENTS ON STREAMLINE'
},
{ extend: 'pdf',
message: 'STAFF PAYMENTS',
orientation: 'landscape',
pageSize: 'LETTER',
exportOptions: {
columns: [ 0, 1, 2, 4, 5 ]
},
customize: function(doc) {
doc.defaultStyle.fontSize = 10;
}
},
{ extend: 'print',
message: 'STAFF PAYMENTS',
exportOptions: {
columns: [ 0, 1, 2, 4, 5 ]
},
customize: function (win) {
$(win.document.body)
.css('font-size', '10pt')
.css('background', '#fff')
.prepend(
'<img src="<?php echo asset('uploads/logo/logo-sm.png'); ?>" style="position:absolute; top:0; right:0;" />'
);
$(win.document.body).find('table')
.addClass('compact')
.css('font-size', 'inherit');
}
}
]
});
function setRangeOrOptions() {
if (document.getElementById("fixed_amount").checked) {
$(".staff_fixed_amount").show();
$(".staff_percentage").hide();
}
if (document.getElementById("percentage").checked) {
$(".staff_percentage").show();
$(".staff_fixed_amount").hide();
}
}
$('#save_fees').click(function() {
if (!$("input[name='payment_type']:checked").val() || $("#staff_id").val() == "") {
alert('Please make sure you select the payment type and staff');
return false;
}
});
</script>
@endpush
@@ -0,0 +1,555 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
<style>
.no-padding {
padding: 0px;
}
</style>
<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-6 col-md-6 col-sm-6 col-xs-12">
<h4 class="page-title">
{{ __('general_settings.view_staff_payment_configurations') }} <font color="blue">{{ isset($searched_staff_name) ? $searched_staff_name : "" }}</font> {!! (is_null($price_list_category_id) || $price_list_category_id == 0) ? "" : " for <font color='blue'>".get_name(get_name($price_list_category_id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories')."</font>" !!}
<!-- display cash category -->
{!! $price_list_category_id == 0 ? "for <font color='blue'>Cash</font>" : "" !!}
</h4>
</div>
<div class="col-lg-6 col-sm-6 col-md-6 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('general_settings.dashboard') }}</a></li>
<li><a href="{{ route('staff_payment_configuration.create') }}">{{ __('general_settings.create_staff_payment_configuration') }}</a></li>
<li class="active">{{ __('general_settings.view_staff_payment_configurations') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('flash::message')
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="panel panel-default">
<div class="panel-body">
{{ Form::open(['method'=>'post','route' => 'staff_payment_configuration.search']) }}
<div class="form-group">
{{ Form::label('staff_id', 'Staff') }}
{{ Form::select('staff_id', $users_array, null, ['class' => 'form-control', 'id' => 'staff_member', 'required']) }}
</div>
<div class="form-group">
{{ Form::label('price_list', 'Price List:') }}
<select name="price_list_category_id" class="form-control" id="price_list_id">
<option value="0">{{ __('general_settings.cash') }}</option>
@foreach($price_list_categories as $record)
<option value="{{ $record->id }}">{{ get_name($record->patient_category_id, 'id', 'name', 'patient_categories') }}</option>
@endforeach
</select>
</div>
<div class="form-group">
{{ Form::submit('Submit', ['class'=>'btn btn-success pull-right']) }}
</div>
{{ Form::close() }}
</div>
</div>
</div>
<div class="col-md-9">
<div class="row">
<div class="panel panel-default col-md-12">
<div class="panel-body panel-primary">
<div class="card">
<div class="card-header">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active nav-item"> <a href="#procedures_section" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> Procedures</a> </li>
<li role="presentation" class="nav-item"> <a href="#consultations_section" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> Consultation and services</a> </li>
<li role="presentation" class="nav-item"> <a href="#investigations_section" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> Investigations</a> </li>
</ul>
</div>
@php
$counter = 0;
$consultations_counter = 0;
$invs_counter = 0;
@endphp
<div class="card-block">
<div class="tab-content">
<div id="procedures_section" class="tab-pane active">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>Name</th>
<th>Price</th>
<th class="staff_fixed_amount">Staff Fee</th>
<th style="display: none;" class="staff_percentage">Staff Percentage</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<!-- procedures -->
@if(isset($search_complete))
@if(count($staff_payment_configurations) > 0)
@foreach($staff_payment_configurations as $config_record)
@if($config_record->item_category == 1)
@php
$procedure = \Streamline\Models\Procedure::withTrashed()->find($config_record->item_id);
@endphp
@if(!is_null($procedure))
<tr>
<td>
{{ $procedure->name }}
</td>
<td>
@if(!is_null($price_list_category_id) && $price_list_category_id != 0)
@php
$key = array_search($price_list_category_id, explode(",", $procedure->price_list_category));
$price_list_price_array = explode(",", $procedure->price_list_price);
$price_list_price = isset($price_list_price_array[$key]) ? $price_list_price_array[$key] : 0;
@endphp
{{ ugandan_shillings($price_list_price) }}
@else
{{ ugandan_shillings($procedure->non_insured_price) }}
@endif
</td>
<td @if(is_null($config_record->amount_fee)) style="display: none" @endif class="staff_fixed_amount">
{{ Form::hidden('procedure_id[]', $procedure->id) }}
{{ Form::number('procedure_fee[]', $config_record->amount_fee, ['class' => 'form-control', 'readonly', 'id' => 'procedures' . $counter]) }}
</td>
<td @if(is_null($config_record->amount_percentage)) style="display: none" @endif class="staff_percentage">
Percentage
{{ Form::number('procedure_percentage[]', $config_record->amount_percentage, ['class' => 'form-control', 'max' => '100', 'readonly']) }}
</td>
<td>
<div class="row" id="procedures_button_group{{$counter}}">
<div class="col-md-6">
<a class="btn btn-sm btn-info" onclick="edit_configuration({{ $counter }})">Edit</a>
</div>
<div class="col-md-6">
<a class="btn btn-sm btn-danger" onclick="delete_staff_payment({{ $config_record->id }})">Delete</a>
</div>
</div>
<div class="row" style="display: none" id="procedures_save_button{{$counter}}">
<div class="col-md-12">
<a class="btn btn-success btn-block" onclick="save_edited_staff_config({{ $config_record->id }})">Save</a>
</div>
</div>
</td>
</tr>
@php $counter++; @endphp
@endif
@endif
@endforeach
@endif
@endif
</tbody>
</table>
</div>
</div>
<div id="consultations_section" class="tab-pane">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>Name</th>
<th>Price</th>
<th class="staff_fixed_amount">Staff Fee</th>
<th style="display: none;" class="staff_percentage">Staff Percentage</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@if(isset($search_complete))
@if(count($staff_payment_configurations) > 0)
@foreach($staff_payment_configurations as $config_record)
@if($config_record->item_category == 3)
@php
$service = \Streamline\Models\Services::withTrashed()->find($config_record->item_id);
@endphp
@if(!is_null($service))
<tr>
<td>
{{ $service->name }}
</td>
<td>
@if(!is_null($price_list_category_id) && $price_list_category_id != 0)
@php
$key = array_search($price_list_category_id, explode(",", $service->price_list_category));
$price_list_price_array = explode(",", $service->price_list_price);
$price_list_price = isset($price_list_price_array[$key]) ? $price_list_price_array[$key] : 0;
@endphp
{{ ugandan_shillings($price_list_price) }}
@else
{{ ugandan_shillings($service->cost_price) }}
@endif
</td>
<td @if(is_null($config_record->amount_fee)) style="display: none" @endif class="staff_fixed_amount">
{{ Form::hidden('service_id[]', $service->id) }}
{{ Form::number('service_fee[]', $config_record->amount_fee, ['class' => 'form-control', 'readonly','id' => 'consultations' . $consultations_counter]) }}
</td>
<td @if(is_null($config_record->amount_percentage)) style="display: none" @endif class="staff_percentage">
{{ Form::number('service_percentage[]', $config_record->amount_percentage, ['class' => 'form-control', 'max' => '100', 'readonly']) }}
</td>
<td>
<div class="row" id="consultations_button_group{{$consultations_counter}}">
<div class="col-md-6">
<a class="btn btn-sm btn-info" onclick="edit_consultation_configuration({{ $consultations_counter }})">Edit</a>
</div>
<div class="col-md-6">
<a class="btn btn-sm btn-danger" onclick="delete_consultation_staff_payment({{ $config_record->id }})">Delete</a>
</div>
</div>
<div class="row" style="display: none" id="consultations_save_button{{$consultations_counter}}">
<div class="col-md-12">
<a class="btn btn-success btn-block" onclick="save_edited_consultation_staff_config({{ $config_record->id }})">Save</a>
</div>
</div>
</td>
</tr>
@endif
@endif
@php $consultations_counter++; @endphp
@endforeach
@endif
@endif
</tbody>
</table>
</div>
</div>
<div id="investigations_section" class="tab-pane">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>Name</th>
<th>Price</th>
<th class="staff_fixed_amount">Staff Fee</th>
<th style="display: none;" class="staff_percentage">Staff Percentage</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@if(isset($search_complete))
@if(count($staff_payment_configurations) > 0)
@foreach($staff_payment_configurations as $config_record)
@if($config_record->item_category == 2)
@php
$investigation = \Streamline\Models\Investigation::withTrashed()->find($config_record->item_id);
@endphp
@if(!is_null($investigation))
<tr>
<td>
{{ $investigation->name }}
</td>
<td>
@if(!is_null($price_list_category_id) && $price_list_category_id != 0)
@php
$key = array_search($price_list_category_id, explode(",", $investigation->price_list_category));
$price_list_price_array = explode(",", $investigation->price_list_price);
$price_list_price = isset($price_list_price_array[$key]) ? $price_list_price_array[$key] : 0;
@endphp
{{ ugandan_shillings($price_list_price) }}
@else
{{ ugandan_shillings($investigation->non_insured_price) }}
@endif
</td>
<td @if(is_null($config_record->amount_fee)) style="display: none" @endif class="staff_fixed_amount">
{{ Form::hidden('investigation_id[]', $investigation->id) }}
{{ Form::number('investigation_fee[]', $config_record->amount_fee, ['class' => 'form-control', 'readonly','id' => 'investigations' . $invs_counter]) }}
</td>
<td @if(is_null($config_record->amount_percentage)) style="display: none" @endif class="staff_percentage">
{{ Form::number('investigation_percentage[]', $config_record->amount_percentage, ['class' => 'form-control', 'max' => '100', 'readonly']) }}
</td>
<td>
<div class="row" id="investigations_button_group{{$invs_counter}}">
<div class="col-md-6">
<a class="btn btn-sm btn-info" onclick="edit_investigation_configuration({{ $invs_counter }})">Edit</a>
</div>
<div class="col-md-6">
<a class="btn btn-sm btn-danger" onclick="delete_investigation_staff_payment({{ $config_record->id }})">Delete</a>
</div>
</div>
<div class="row" style="display: none" id="investigations_save_button{{$counter}}">
<div class="col-md-12">
<a class="btn btn-success btn-block" onclick="save_edited_investigation_staff_config({{ $config_record->id }})">Save</a>
</div>
</div>
</td>
</tr>
@endif
@endif
@php $invs_counter++; @endphp
@endforeach
@endif
@endif
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<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/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/js/validator.js') }}"></script>
<script>
// is there any config under edit 0 - no, any other is the id
let is_edit_active = 0;
$('#staff_id,#procedures,#investigations,#staff_member').select2({
placeholder: "Select",
width: "100%"
});
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 100,
buttons: [
'copy',
{ extend: 'csv',
message: 'STAFF PAYMENTS'
},
{ extend: 'excel',
message: 'STAFF PAYMENTS',
exportOptions: {
columns: [ 0, 1, 2, 4, 5 ]
},
sheetName: 'STAFF PAYMENTS ON STREAMLINE'
},
{ extend: 'pdf',
message: 'STAFF PAYMENTS',
orientation: 'landscape',
pageSize: 'LETTER',
exportOptions: {
columns: [ 0, 1, 2, 4, 5 ]
},
customize: function(doc) {
doc.defaultStyle.fontSize = 10;
}
},
{ extend: 'print',
message: 'STAFF PAYMENTS',
exportOptions: {
columns: [ 0, 1, 2, 4, 5 ]
},
customize: function (win) {
$(win.document.body)
.css('font-size', '10pt')
.css('background', '#fff')
.prepend(
'<img src="<?php echo asset('uploads/logo/logo-sm.png'); ?>" style="position:absolute; top:0; right:0;" />'
);
$(win.document.body).find('table')
.addClass('compact')
.css('font-size', 'inherit');
}
}
]
});
function setRangeOrOptions() {
if (document.getElementById("fixed_amount").checked) {
$(".staff_fixed_amount").show();
$(".staff_percentage").hide();
}
if (document.getElementById("percentage").checked) {
$(".staff_percentage").show();
$(".staff_fixed_amount").hide();
}
}
function delete_staff_payment(config_id) {
if (confirm("Are you sure you want to delete this record?")) {
$.ajax({
url: '/delete_staff_configuration',
data: {'config_id':config_id},
success: function(response){
if (response == 1) {
alert("Staff configuration record has been deleted");
window.location.reload();
} else {
alert("Staff configuration record deletion failed");
}
}
});
}
}
function edit_configuration(id) {
if (is_edit_active === 0) {
is_edit_active = id;
} else {
$(".under_edit").attr("readonly", true);
$("#procedures" + is_edit_active).removeClass('under_edit');
$('#procedures_button_group' + is_edit_active).show();
$('#procedures_save_button' + is_edit_active).hide();
}
$('#procedures_save_button' + id).show();
$('#procedures_button_group' + id).hide();
$("#procedures" + id).attr("readonly", false);
$("#procedures" + id).addClass('under_edit');
}
function save_edited_staff_config(config_id) {
let amount_fee = $("#procedures" + is_edit_active).val();
$.ajax({
url: '/edit_staff_configuration',
data: {'config_id':config_id, 'amount_fee':amount_fee},
success: function(response){
if (response == 1) {
alert("Staff configuration record has been edited");
window.location.reload();
} else {
alert("Staff configuration record editing failed");
}
}
});
}
function delete_consultation_staff_payment(config_id) {
if (confirm("Are you sure you want to delete this record?")) {
$.ajax({
url: '/delete_staff_configuration',
data: {'config_id':config_id},
success: function(response){
if (response == 1) {
alert("Staff configuration record has been deleted");
window.location.reload();
} else {
alert("Staff configuration record deletion failed");
}
}
});
}
}
function edit_consultation_configuration(id) {
if (is_edit_active === 0) {
is_edit_active = id;
} else {
$(".under_edit").attr("readonly", true);
$("#consultations" + is_edit_active).removeClass('under_edit');
$('#consultations_button_group' + is_edit_active).show();
$('#consultations_save_button' + is_edit_active).hide();
}
$('#consultations_save_button' + id).show();
$('#consultations_button_group' + id).hide();
$("#consultations" + id).attr("readonly", false);
$("#consultations" + id).addClass('under_edit');
}
function save_edited_consultation_staff_config(config_id) {
let amount_fee = $("#consultations" + is_edit_active).val();
$.ajax({
url: '/edit_staff_configuration',
data: {'config_id':config_id, 'amount_fee':amount_fee},
success: function(response){
if (response == 1) {
alert("Staff configuration record has been edited");
window.location.reload();
} else {
alert("Staff configuration record editing failed");
}
}
});
}
function delete_investigation_staff_payment(config_id) {
if (confirm("Are you sure you want to delete this record?")) {
$.ajax({
url: '/delete_staff_configuration',
data: {'config_id':config_id},
success: function(response){
if (response == 1) {
alert("Staff configuration record has been deleted");
window.location.reload();
} else {
alert("Staff configuration record deletion failed");
}
}
});
}
}
function edit_investigation_configuration(id) {
if (is_edit_active === 0) {
is_edit_active = id;
} else {
$(".under_edit").attr("readonly", true);
$("#investigations" + is_edit_active).removeClass('under_edit');
$('#investigations_button_group' + is_edit_active).show();
$('#investigations_save_button' + is_edit_active).hide();
}
$('#investigations_save_button' + id).show();
$('#investigations_button_group' + id).hide();
$("#investigations" + id).attr("readonly", false);
$("#investigations" + id).addClass('under_edit');
}
function save_edited_investigation_staff_config(config_id) {
let amount_fee = $("#investigations" + is_edit_active).val();
$.ajax({
url: '/edit_staff_configuration',
data: {'config_id':config_id, 'amount_fee':amount_fee},
success: function(response){
if (response == 1) {
alert("Staff configuration record has been edited");
window.location.reload();
} else {
alert("Staff configuration record editing failed");
}
}
});
}
</script>
@endpush
@@ -0,0 +1,382 @@
@extends('layouts.main')
@push('styles')
<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" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-6 col-md-7 col-sm-7 col-xs-12">
<h4 class="page-title">{{ __('general_settings.payments_report') }}</h4>
</div>
<div class="col-lg-6 col-sm-5 col-md-5 col-xs-12">
<ol class="breadcrumb">
<li class="active">{{ __('general_settings.payments_report') }}</li>
@if(Auth::user()->can('record-staff-service-performance'))
<li><a href="{{ url('record_staff_service_performance') }}">Record staff performance</a></li>
@endif
<li><a href="{{ url('finance') }}">Finance Home</a></li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('flash::message')
</div>
</div>
<div class="row">
<div class="col-sm-12">
{{ Form::open(['route' => 'staff_payments.payments_report' , 'data-toggle' => 'validator']) }}
<div class="white-box">
<div class="row">
<div class="col-md-2">
<div class="form-group">
{{ Form::label('report_by', __('general_settings.report_by')) }}
{{ Form::select('report_by', ['' => __('ward_consumption.select'), 1 => __('general_settings.staff'), 2 => __('general_settings.services')], '', ['class' => 'form-control', 'id'=>'report_by', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-2">
<div id="staff_div" style="display: none;">
<div class="form-group">
{{ Form::label('staff', __('general_settings.staff')) }}
{{ Form::select('staff', $users_array, '', ['class' => 'form-control col-sm-12', 'id' => 'staff_select']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div id="services_div" style="display: none;">
<div class="form-group">
{{ Form::label('services_rendered_id', __('general_settings.services')) }}
{{ Form::select('services_rendered_id', $services_rendered_array, '', ['class' => 'form-control col-sm-12', 'id' => 'services_select']) }}
<div class="help-block with-errors"></div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group" id="searchby">
{{ Form::label('search_by', __('ward_consumption.date')) }}
{{ Form::select('search_by', ['0'=>__('ward_consumption.last_24_hours'),'1'=>__('ward_consumption.custom_date'),'2'=>__('ward_consumption.custom_range')], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-3" style="display: none;" id="date_search">
<div class="form-group" id="reg_date" style="padding-top: 23px;">
<div class="input-group">
{{ Form::text('reg_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-autoclose']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-3" style="display: none;" id="date_range_search">
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('start_date', __('ward_consumption.from')) }}
<div class="input-group">
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-1']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="reg_date">
{{ Form::label('end_date', __('ward_consumption.to')) }}
<div class="input-group">
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-2']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-2">
<br>
{{ Form::button(__('ward_consumption.search'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
</div>
</div>
</div>
{{ Form::close() }}
</div>
</div>
@if($search_complete)
@if($report_by == 1)
<!-- show the report based on staff -->
<div class="row">
<div class="col-md-12">
<div class="white-box">
<!-- show the lable -->
<div><h3 style="color: blue">{{ $search_text }}</h3></div>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>#</th>
<th>Staff</th>
<th>Amount</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@php
$grand_total = 0;
$counter = 1;
@endphp
@if(count($staff_performed_items_array) > 0)
@foreach($staff_performed_items_array as $staff_id => $amount)
<tr>
<td>{{ $counter }}</td>
<td>
{{ get_full_name($staff_id, "id", "first_name", "last_name", "users") }}
</td>
<td>
{{ ugandan_shillings((int)$amount) }}
</td>
<td>
{{ Form::open(['route' => 'staff_payments.payments_details_report']) }}
{{ Form::hidden('details_report_by', $details_report_by) }}
{{ Form::hidden('details_staff', $staff_id) }}
{{ Form::hidden('details_services_rendered_id', $details_services_rendered_id) }}
{{ Form::hidden('details_search_by', $details_search_by) }}
{{ Form::hidden('details_reg_date', $details_reg_date) }}
{{ Form::hidden('details_start_date', $details_start_date) }}
{{ Form::hidden('details_end_date', $details_end_date) }}
<button type="submit" class="btn btn-success">Details</button>
{{ Form::close() }}
</td>
</tr>
@php
$grand_total += $amount;
$counter++;
@endphp
@endforeach
@endif
</tbody>
<tfoot>
<td></td>
<td><strong>Total</strong></td>
<td><strong>{{ ugandan_shillings((int)$grand_total) }}</strong></td>
<td></td>
</tfoot>
</table>
</div>
</div>
</div>
</div>
@elseif($report_by == 2)
<div class="row">
<div class="col-md-12">
<div class="white-box">
<!-- show the label for search -->
<div><h3 style="color: blue">{{ $search_text }}</h3></div>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>#</th>
<th>Category</th>
<th>Amount</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@php
$grand_total = 0;
$counter = 1;
@endphp
@if(count($staff_performed_items_array) > 0)
@foreach($staff_performed_items_array as $item_category => $amount)
<tr>
<td>{{ $counter }}</td>
<td>
@if($item_category == 1)
Procedures
@elseif($item_category == 2)
Investigations
@elseif($item_category == 3)
Consultations
@endif
</td>
<td>
{{ ugandan_shillings((int)$amount) }}
</td>
<td>
{{ Form::open(['route' => 'staff_payments.payments_details_report']) }}
{{ Form::hidden('details_report_by', $details_report_by) }}
{{ Form::hidden('details_staff', $details_staff) }}
{{ Form::hidden('details_services_rendered_id', $item_category) }}
{{ Form::hidden('details_search_by', $details_search_by) }}
{{ Form::hidden('details_reg_date', $details_reg_date) }}
{{ Form::hidden('details_start_date', $details_start_date) }}
{{ Form::hidden('details_end_date', $details_end_date) }}
<button type="submit" class="btn btn-success">Details</button>
{{ Form::close() }}
</td>
</tr>
@php
$grand_total += $amount;
$counter++;
@endphp
@endforeach
@endif
</tbody>
<tfoot>
<tr>
<td></td>
<td><strong>Total</strong></td>
<td><strong>{{ ugandan_shillings((int)$grand_total) }}</strong></td>
<td></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
@endif
@endif
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<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/tables/js/buttons.colVis.min.js') }}"></script>
<script>
$(document).ready(function() {
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 100,
footer: true,
buttons: [
'copy',
{ extend: 'csv',
footer: true,
message: '<?php echo __('general_settings.staff_payments_report');?>'
},
{ extend: 'excel',
message: '<?php echo __('general_settings.staff_payments_report');?>',
footer: true,
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6 ]
},
sheetName: '<?php echo __('general_settings.staff_payments_report');?>'
},
{ extend: 'pdf',
message: '<?php echo __('general_settings.staff_payments_report');?>',
footer: true,
orientation: 'landscape',
pageSize: 'LETTER',
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6 ]
},
customize: function(doc) {
doc.defaultStyle.fontSize = 10;
// doc.styles.tableHeader.alignment = 'left';
}
},
{ extend: 'print',
message: '<?php echo __('general_settings.staff_payments_report');?>',
footer: true,
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6 ]
},
customize: function (win) {
$(win.document.body)
.css('font-size', '10pt')
.css('background', '#fff')
.prepend(
'<img src="<?php echo asset('uploads/logo/logo-sm.png'); ?>" style="position:absolute; top:0; right:0;" />'
);
$(win.document.body).find('table')
.addClass('compact')
.css('font-size', 'inherit');
}
}
]
});
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'yyyy-mm-dd'
});
$('#search_by').change(function () {
if ($(this).val() == 1) {
$('#date_search').show();
$('#date_range_search').hide();
}
else if ($(this).val() == 2) {
$('#date_range_search').show();
$('#date_search').hide();
}
else {
$('#date_search,#date_range_search').hide();
}
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'yyyy/mm/dd',
orientation: 'bottom'
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'yyyy/mm/dd',
orientation: 'bottom'
});
$('#report_by').change(function () {
if ($(this).val() == 1) {
$('#staff_div').show();
$('#services_div').hide();
//$('.select2-selection.select2-selection--single').css('height','calc(3.85rem)');
$('.select2-selection.select2-selection--single').css('max-width','100%');
$('.select2-selection.select2-selection--single').css('padding','7px 12px');
}
else if ($(this).val() == 2) {
$('#services_div').show();
$('#staff_div').hide();
}
else {
$('#staff_div,#services_div').hide();
}
});
$('#services_select,#staff_select').select2({
placeholder: "-- select --",
width: "100%"
});
$('.select2-selection.select2-selection--single').css('height','calc(3.85rem)');
$('.select2-selection.select2-selection--single').css('padding-top','5px');
//$('.select2-selection.select2-selection--single').css('border-left', '3px solid #F08080');/*add compulsory class*/
$('.select2-selection.select2-selection--single.sec_d').css('border-left', '3px solid #aaa');
$('.select2-selection__arrow').css('top','3px');
});
</script>
@endpush
@@ -0,0 +1,336 @@
@extends('layouts.main')
@push('styles')
<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" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-6 col-md-7 col-sm-7 col-xs-12">
<h4 class="page-title">{{ __('general_settings.payments_report_details') }}</h4>
</div>
<div class="col-lg-6 col-sm-5 col-md-5 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('staff_payments.payments_report') }}">{{ __('general_settings.payments_report') }}</a></li>
<li class="active">{{ __('general_settings.payments_report_details') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('flash::message')
</div>
</div>
<!-- show the report based on staff -->
<div class="row">
<div class="col-md-12">
<div class="white-box">
{!! $search_string ?? $search_string !!}
<!-- show the lable -->
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>#</th>
<th>{{ __('general_settings.patient_name') }}</th>
<th>{{ __('general_settings.patient_category') }}</th>
<th>{{ __('general_settings.staff_payment_status') }}</th>
<th>{{ __('general_settings.patient_payment_status') }}</th>
<th>{{ __('general_settings.date') }}</th>
<th>{{ __('general_settings.item_name') }}</th>
<th>{{ __('general_settings.item_price') }}</th>
<th>{{ __('general_settings.staff_name') }}</th>
<th>{{ __('general_settings.amount_for_staff') }}</th>
</tr>
</thead>
<tbody>
@php
$grand_staff_amount_total = 0;
$grand_prices_amount_total = 0;
$counter = 1;
@endphp
@if(count($staff_performed_services) > 0)
@foreach($staff_performed_services as $record)
@php
if ($record->item_category == 1){
$procedure = \Streamline\Models\Procedure::withTrashed()->find($record->item_id);
$non_insured_price = $procedure->non_insured_price;
$item_name = $procedure->name;
}elseif ($record->item_category == 2){
$investigation = \Streamline\Models\Investigation::withTrashed()->find($record->item_id);
$non_insured_price = $investigation->non_insured_price;
$item_name = $investigation->name;
}elseif ($record->item_category == 3){
$service = \Streamline\Models\Services::withTrashed()->find($record->item_id);
$non_insured_price = $service->cost_price;
$item_name = $service->name;
}
@endphp
<tr>
<td>{{ $counter }}</td>
<td>
{{ get_full_name($record->patient_id, "id", "first_name", "last_name", "patients") }} ({{ get_name($record->patient_id, "id", "number", "patients") }})
</td>
<td>
{{ get_name(get_name($record->patient_id, "id", "category_id", "patients"), "id", "name", "patient_categories") }}
</td>
<td>
@if($record->is_staff_paid == 0)
<font color='red'>{{ __('investigations.not_paid') }}</font>
@else
<font color='green'>{{ __('investigations.paid') }}</font>
@endif
</td>
<td>
@if(is_null($record->patient_receipt_number))
<font color='red'>{{ __('investigations.not_paid') }}</font>
@else
<font color='green'>{{ __('investigations.paid') }}</font>
@endif
</td>
<td>
{{ streamline_date($record->created_at) }}
</td>
<td>
{{ $item_name }}
</td>
<td>
@php
//handle previous records b4 i added performace fee column
$item_price = 0;
if(is_null($record->item_price)){
$item_price = $non_insured_price;
} else {
$item_price = $record->item_price;
}
@endphp
{{ ugandan_shillings((int)$item_price) }}
@php
$grand_prices_amount_total += $item_price;
@endphp
</td>
<td>
{{ get_full_name($record->performed_by, "id", "first_name", "last_name", "users") }}
</td>
<td>
<?php
//$staff_fee_amount = $record->performance_fee;
//handle previous records b4 i added performace fee column
if(is_null($record->performance_fee)){
if ($report_based_on_staff_or_category == 1 /*staff*/) {
$staff_fee_amount = get_fee_owed_to_staff_for_perfomed_service($record->item_id, $record->item_category, $record->performed_by);
}
if ($report_based_on_staff_or_category == 2 /*item_categ*/) {
$staff_fee_amount = get_fee_owed_to_staff_for_perfomed_service_based_on_category($record->item_id, $record->performed_by, $record->item_category);
}
$staff_fee_amount = is_numeric($staff_fee_amount) ? $staff_fee_amount : 0;
} else {
$staff_fee_amount = $record->performance_fee;
}
$grand_staff_amount_total += $staff_fee_amount;
?>
{{ ugandan_shillings((int)$staff_fee_amount) }}
</td>
</tr>
@php
$counter++;
@endphp
@endforeach
@endif
@if (count($ward_procedures_records) > 0)
@foreach ($ward_procedures_records as $ward_procedure)
<tr>
<td>{{ $counter }}</td>
<td>
{{ get_full_name($ward_procedure->patient_id, "id", "first_name", "last_name", "patients") }} ({{ get_name($ward_procedure->patient_id, "id", "number", "patients") }})
</td>
<td>
{{ get_name(get_name($ward_procedure->patient_id, "id", "category_id", "patients"), "id", "name", "patient_categories") }}
</td>
<td>
<span class="label label-info">{{ get_name($ward_procedure->ward_id, "id", "name", "wards") }}</span>
</td>
<td>
</td>
<td>
{{ streamline_date($ward_procedure->created_at) }}
</td>
<td>
{{ get_name($ward_procedure->procedure_id, "id", "name", "procedures") }}
</td>
<td>
{{ ugandan_shillings($ward_procedure->hospital_fee + $ward_procedure->staff_fee) }}
</td>
<td>
{{ get_full_name($ward_procedure->performed_by, "id", "first_name", "last_name", "users") }}
</td>
<td>
{{ ugandan_shillings((int)$ward_procedure->staff_fee) }}
</td>
</tr>
@php
$ward_procedure_cost = $ward_procedure->hospital_fee + $ward_procedure->staff_fee;
$grand_prices_amount_total += $ward_procedure_cost;
$grand_staff_amount_total += $ward_procedure->staff_fee;
$counter++;
@endphp
@endforeach
@endif
@if (count($ward_services_records) > 0)
@foreach ($ward_services_records as $ward_service)
<tr>
<td>{{ $counter }}</td>
<td>
{{ get_full_name($ward_service->patient_id, "id", "first_name", "last_name", "patients") }} ({{ get_name($ward_service->patient_id, "id", "number", "patients") }})
</td>
<td>
{{ get_name(get_name($ward_service->patient_id, "id", "category_id", "patients"), "id", "name", "patient_categories") }}
</td>
<td>
<span class="label label-info">{{ get_name($ward_service->ward_id, "id", "name", "wards") }}</span>
</td>
<td>
</td>
<td>
{{ streamline_date($ward_service->created_at) }}
</td>
@php
$service_consumed = $ward_service->service_id;
$performed_by = null;
if (str_contains($service_consumed, '__')){
$service_and_performed_by_array = explode("__", $service_consumed);
$service_id = $service_and_performed_by_array[0];
$performed_by = $service_and_performed_by_array[1];
} else{
$service_id = $service_consumed;
}
@endphp
<td>
{{ get_name($service_id, "id", "name", "services") }}
</td>
<td>
{{ ugandan_shillings($ward_service->unit_price) }}
</td>
<td>
{{ get_full_name($performed_by, "id", "first_name", "last_name", "users") }}
</td>
<td>
{{ ugandan_shillings((int)$ward_service->staff_fee) }}
</td>
</tr>
@php
$ward_service_cost = $ward_service->unit_price;
$grand_prices_amount_total += $ward_service_cost;
$grand_staff_amount_total += $ward_service->staff_fee;
$counter++;
@endphp
@endforeach
@endif
</tbody>
<tfoot>
<td></td>
<td><strong>Total</strong></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><strong>{{ ugandan_shillings($grand_prices_amount_total) }}</strong></td>
<td></td>
<td><strong>{{ ugandan_shillings($grand_staff_amount_total) }}</strong></td>
</tfoot>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<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/tables/js/buttons.colVis.min.js') }}"></script>
<script>
$(document).ready(function() {
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 100,
footer: true,
buttons: [
'copy',
{ extend: 'csv',
footer: true,
message: '<?php echo __('general_settings.staff_payments_report');?>'
},
{ extend: 'excel',
message: '<?php echo __('general_settings.staff_payments_report');?>',
footer: true,
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
},
sheetName: '<?php echo __('general_settings.staff_payments_report');?>'
},
{ extend: 'pdf',
message: '<?php echo __('general_settings.staff_payments_report');?>',
footer: true,
orientation: 'landscape',
pageSize: 'LETTER',
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
},
customize: function(doc) {
doc.defaultStyle.fontSize = 10;
}
},
{ extend: 'print',
message: '<?php echo __('general_settings.staff_payments_report');?>',
footer: true,
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
},
customize: function (win) {
$(win.document.body)
.css('font-size', '10pt')
.css('background', '#fff')
.prepend(
'<img src="<?php echo asset('uploads/logo/logo-sm.png'); ?>" style="position:absolute; top:0; right:0;" />'
);
$(win.document.body).find('table')
.addClass('compact')
.css('font-size', 'inherit');
}
}
]
});
$('.select2-selection.select2-selection--single').css('height','calc(3.85rem)');
$('.select2-selection.select2-selection--single').css('padding-top','5px');
//$('.select2-selection.select2-selection--single').css('border-left', '3px solid #F08080');/*add compulsory class*/
$('.select2-selection.select2-selection--single.sec_d').css('border-left', '3px solid #aaa');
$('.select2-selection__arrow').css('top','3px');
});
</script>
@endpush
@@ -0,0 +1,478 @@
@extends('layouts.main')
@push('styles')
<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" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-6 col-md-7 col-sm-7 col-xs-12">
<h4 class="page-title">Record performed services</h4>
</div>
<div class="col-lg-6 col-sm-5 col-md-5 col-xs-12">
<ol class="breadcrumb">
<li class="active">Record performed services</li>
<li><a href="{{ url('staff_payments_report') }}">Staff payments report</a></li>
<li><a href="{{ url('finance') }}">Finance Home</a></li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('flash::message')
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="white-box">
{{ Form::open(['method'=>'post','url' => 'store_recorded_performed_service']) }}
@php $patient_insurance_status = patient_insurance_status($patient_id); @endphp
{{ Form::hidden('patient_id', $patient_id, ['id' => 'patient_id'])}}
{{ Form::hidden('patient_insurance_status', $patient_insurance_status, ['id' => 'patient_insurance_status'])}}
<div class='row'>
<div class='col-md-12'>
<div id='payments_items'>
<table class='table color-bordered-table success-bordered-table'>
<thead>
<tr>
<th>
<div class='row'>
<div class='col-2'>Item Category</div>
<div class='col-2'>Performed Item</div>
<div class='col-1'>Item Unit Price</div>
<div class='col-1'>Item Total Price</div>
<div class='col-1'>Quantity</div>
<div class='col-2'>Performed By</div>
<div class='col-2'>Performance Fee</div>
<div class='col-1'></div>
</div>
</th>
</tr>
</thead>
@php
$option_employees = "<option value=''>-select-</option>";
foreach ($employees as $employee){
$employee_first_name = str_replace("'", '', $employee->first_name);
$employee_first_name = str_replace("\"", '', $employee_first_name);
$employee_last_name = str_replace("'", '', $employee->last_name);
$employee_last_name = str_replace("\"", '', $employee_last_name);
$option_employees .= "<option value='$employee->id'>$employee_first_name $employee_last_name</option>";
}
$option_procedures = "<option value=''>-select-</option>";
foreach ($procedures as $procedure){
$procedure_name = str_replace("'", '', $procedure->name);
$procedure_name = str_replace("\"", '', $procedure_name);
$procedure_name = preg_replace('/[^A-Za-z0-9\-]/', '', $procedure_name);
$option_procedures .= "<option value='$procedure->id'>$procedure_name</option>";
}
$option_investigations = "<option value=''>-select-</option>";
foreach ($investigations as $investigation){
$inv_name = str_replace("'", '', $investigation->name);
$inv_name = str_replace("\"", '', $inv_name);
$inv_name = preg_replace('/[^A-Za-z0-9\-]/', '', $inv_name);
$option_investigations .= "<option value='$investigation->id'>$inv_name</option>";
}
$option_services = "<option value=''>-select-</option>";
foreach ($services as $service){
$service_name = str_replace("'", '', $service->name);
$service_name = str_replace("\"", '', $service_name);
$service_name = str_replace("+", '', $service_name);
$service_name = preg_replace('/[^A-Za-z0-9\-]/', '', $service_name);
$option_services .= "<option value='$service->id'>$service_name</option>";
}
$option_sundries = "<option value=''>-select-</option>";
foreach ($sundries as $sundry){
$sundry_name = str_replace("'", '', $sundry->name);
$sundry_name = str_replace("\"", '', $sundry_name);
$sundry_name = preg_replace('/[^A-Za-z0-9\-]/', '', $sundry_name);
$option_sundries .= "<option value='$sundry->id'>$sundry->name</option>";
}
@endphp
<tbody class='input_fields_wrap'>
<tr>
<td>
<div class='row'>
<div class='col-2'>
<div class='control-group'>
<div class='form-group'>
<select name='item_category[]' id='item_category_0' class='form-control compulsory required item_category_select' required>
<option value=''>-Select-</option>
<option value='1'>Procedure</option>
<option value='2'>Investigation</option>
<option value='3'>Service Or Consultation</option>
<option value='4'>Sundry</option>
</select>
</div>
</div>
</div>
<div class='col-2'>
<div class='form-group'>
<div class='controls' id="investigations_div_0">
<select name='performed_investigation_item[]' id='performed_inv_item_0' class='form-control compulsory required performed_item_select'>
@php echo $option_investigations; @endphp
</select>
</div>
<div class='controls' id="procedures_div_0" style="display: none;">
<select name='performed_procedure_item[]' id='performed_pro_item_0' class='form-control compulsory required performed_item_select'>
@php echo $option_procedures; @endphp
</select>
</div>
<div class='controls' id="services_div_0" style="display: none;">
<select name='performed_service_item[]' id='performed_serv_item_0' class='form-control compulsory required performed_item_select'>
@php echo $option_services; @endphp
</select>
</div>
<div class='controls' id="sundries_div_0" style="display: none;">
<select name='performed_sundry_item[]' id='performed_sundry_item_0' class='form-control compulsory required performed_item_select'>
@php echo $option_sundries; @endphp
</select>
</div>
</div>
</div>
<div class='col-1'>
<div class='form-group'>
<div class='controls'>
<input type='number' name='item_price[]' id='item_price_0' class='form-control item_price compulsory' required/>
</div>
</div>
</div>
<div class='col-1'>
<div class='form-group'>
<div class='controls'>
<input type='number' name='item_total_price[]' id='item_total_price_0' class='form-control item_total_price compulsory' required readonly/>
</div>
</div>
</div>
<div class='col-1'>
<div class='form-group'>
<div class='controls'>
<input type='number' name='item_quantity[]' id='item_quantity_0' class='form-control item_quantity compulsory' required/>
</div>
</div>
</div>
<div class='col-2'>
<div class='control-group'>
<div id='performed_by_div_0' class='form-group'>
<select name='performed_by_id[]' id='performed_by_0' class='form-control performed_by_select'>
@php echo $option_employees; @endphp
</select>
</div>
</div>
</div>
<div class='col-2'>
<div class='control-group'>
<div id='performance_fee_0' class='form-group name_select'>
<input name='performance_fee[]' id='performance_fee_0' class='form-control item_select'>
</div>
</div>
</div>
<div class='col-1'>
<div class='form-group' style='margin-top: 10px;'>
<button class='btn btn-sm btn-rounded btn-success add_item' style='color: white; margin-left: 25px;'><i class='fa fa-plus'></i></button>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<br/>
<div class='row'>
<div style="float: right;">
<h3>Total:<span id="itemGrandTotal"></span></h3>
</div>
</div>
<div class='row'>
<div class='col-md-9'>
</div>
<div class='col-md-3'>
<button class='btn btn-rounded btn-info pull-right' id='save_performances_action' name='save_performances_action' value='save'>Save Performances</button>
</div>
</div>
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<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/tables/js/buttons.colVis.min.js') }}"></script>
<script>
var max_rows = 20;
var wrapper = $(".input_fields_wrap"); //Fields wrapper
var add_button = $(".add_item");
var x = 1; // initial row count
add_button.click(function (e) { // on add input button click
e.preventDefault();
if (x < max_rows) {
$(wrapper).append("\
\<tr>\
<td>\
<div class='row'>\
\
<div class='col-2'>\
<div class='control-group'>\
<div class='form-group'>\
<select name='item_category[]' id='item_category_" + x + "' class='form-control compulsory required item_category_select' required><option value=''>-Select-</option><option value='1'>Procedure</option><option value='2'>Investigation</option><option value='3'>Service Or Consultation</option><option value='4'>Sundry</option>" +
"</select>\
</div>\
</div>\
</div>\
\
<div class='col-2'>\
<div class='form-group'>\
<div class='controls' id='investigations_div_" + x + "'>\
<div id='performed_item_div_" + x + "' class='form-group'>\
<select name='performed_investigation_item[]' id='performed_inv_item_" + x + "' class='form-control compulsory required performed_item_select'>" +
"<?php echo $option_investigations ?>" +
"</select>\
</div>\
</div>\
<div class='controls' id='procedures_div_" + x + "' style='display:none;'>\
<div id='performed_item_div_" + x + "' class='form-group'>\
<select name='performed_procedure_item[]' id='performed_pro_item_" + x + "' class='form-control compulsory required performed_item_select'>" +
"<?php echo $option_procedures ?>" +
"</select>\
</div>\
</div>\
<div class='controls' id='services_div_" + x + "' style='display:none;'>\
<div id='performed_item_div_" + x + "' class='form-group'>\
<select name='performed_service_item[]' id='performed_serv_item_" + x + "' class='form-control compulsory required performed_item_select'>" +
"<?php echo $option_services ?>" +
"</select>\
</div>\
</div>\
<div class='controls' id='sundries_div_" + x + "' style='display:none;'>\
<div id='performed_item_div_" + x + "' class='form-group'>\
<select name='performed_sundry_item[]' id='performed_sundry_item_" + x + "' class='form-control compulsory required performed_item_select'>" +
"<?php echo $option_sundries ?>" +
"</select>\
</div>\
</div>\
</div>\
</div>\
\
<div class='col-1'>\
<div class='form-group'>\
<div class='controls'>\
<input type='number' name='item_price[]' id ='item_price_" + x + "' class='form-control item_price compulsory' required>\
</div>\
</div>\
</div>\
<div class='col-1'>\
<div class='form-group'>\
<div class='controls'>\
<input type='number' name='item_total_price[]' id ='item_total_price_" + x + "' class='form-control item_total_price compulsory' required readonly>\
</div>\
</div>\
</div>\
\
<div class='col-1'>\
<div class='form-group'>\
<div class='controls'>\
<input type='number' name='item_quantity[]' id ='item_quantity_" + x + "' class='form-control item_quantity compulsory' required>\
</div>\
</div>\
</div>\
\
<div class='col-2'>\
<div class='control-group'>\
<div id='performed_by_div_" + x + "' class='form-group'>\
<select name='performed_by_id[]' id='performed_by_" + x + "' class='form-control performed_by_select'>" +
"<?php echo $option_employees ?>" +
"</select>\
</div>\
</div>\
</div>\
\
<div class='col-2'>\
<div class='control-group'>\
<div id='performance_fee_" + x + "' class='form-group name_select'>\
<input type='number' name='performance_fee[]' id='performance_fee_" + x + "' class='form-control item_select'>\
</div>\
</div>\
</div>\
\
<div class='col-1'>\
<div class='form-group' style='margin-top: 10px;'>\
<button class='remove_field btn btn-sm btn-rounded btn-danger' style='color: white; margin-left: 25px;'><i class='fa fa-trash'></i></button>\
</div>\
</div>\
</div>\
</td>\
</tr>"); // add row
generalSelect2Set('performed_by_'+x);
generalSelect2Set('performed_inv_item_'+x);
generalSelect2Set('performed_pro_item_'+x);
generalSelect2Set('performed_serv_item_'+x);
generalSelect2Set('performed_sundry_item_'+x);
$("select.item_select").change(function(){
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
var name_selected = $(this).children("option:selected").val();
$("#name_" + id).val(parseInt(name_selected));
});
x++;
}
});
$(wrapper).on("click", ".remove_field", function (e) {
e.preventDefault();
$(this).parent('div').parent('div').parent('div').parent('td').parent('tr').remove();
// x--; // decrementing messes up the id referencing. If you're decrementing in this way, you're probably not submitting some data!!!!!!
});
$(".input_fields_wrap").on('change', ".performed_item_select", function () {
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
var category = $("#item_category_" + id).val();
var item = 0;
if(category === "1"){
item = $("#performed_pro_item_" + id).val();
} else if(category === "2"){
item = $("#performed_inv_item_" + id).val();
} else if(category === "3"){
item = $("#performed_serv_item_" + id).val();
} else if(category === "4"){
item = $("#performed_sundry_item_" + id).val();
}
let patient_id = $('#patient_id').val();
let patient_insurance_status = $('#patient_insurance_status').val();
$.ajax({
url: '/get_item_price',
data: {'category':category, 'item':item, 'patient_id': patient_id, 'patient_insurance_status': patient_insurance_status},
success: function(response){
$("#item_price_"+id).val(response);
$("#item_total_price_"+id).val(response);
calculateItemsTotal();
}
});
});
$(".performed_item_select,.performed_by_select").select2({
width: "100%"
});
$(".input_fields_wrap").on('change', ".item_category_select", function () {
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
console.log("The selected category row id ==" + id);
//change the drop down options
var category = $("#item_category_" + id).val();
if (category === "1") {
$("#procedures_div_"+id).show();
$("#investigations_div_"+id).hide();
$("#services_div_"+id).hide();
$("#sundries_div_"+id).hide();
$("#item_quantity_"+id).attr('readonly', 'true');
$("#item_quantity_"+id).attr('value', 1);
} else if(category === "2"){
$("#procedures_div_"+id).hide();
$("#investigations_div_"+id).show();
$("#services_div_"+id).hide();
$("#sundries_div_"+id).hide();
$("#item_quantity_"+id).attr('readonly', 'true');
$("#item_quantity_"+id).attr('value', 1);
} else if(category === "3"){
$("#procedures_div_"+id).hide();
$("#investigations_div_"+id).hide();
$("#services_div_"+id).show();
$("#sundries_div_"+id).hide();
$("#item_quantity_"+id).removeAttr('readonly');
} else if(category === "4"){
$("#sundries_div_"+id).show();
$("#procedures_div_"+id).hide();
$("#investigations_div_"+id).hide();
$("#services_div_"+id).hide();
$("#item_quantity_"+id).removeAttr('readonly');
}
var item1 = $("#performed_inv_item_" + id).val();
var item2 = $("#performed_pro_item_" + id).val();
var item3 = $("#performed_serv_item_" + id).val();
});
$(".input_fields_wrap").on('change', ".item_quantity", function () {
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
var quantity = $("#item_quantity_" + id).val();
var unit_price = $("#item_price_" + id).val();
var total_price = quantity * unit_price;
$("#item_total_price_" + id).val(total_price);
calculateItemsTotal();
});
$(".input_fields_wrap").on('keyup', ".item_price", function () {
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
var quantity = $("#item_quantity_" + id).val();
var unit_price = $("#item_price_" + id).val();
var total_price = quantity * unit_price;
$("#item_total_price_" + id).val(total_price);
calculateItemsTotal();
});
function calculateItemsTotal() {
//loop through the prices
var auto_price_grand_total = 0;
$("[id^=item_total_price_]").each(function(){
var auto_price = $(this).val();
auto_price_grand_total += parseInt(auto_price);
});
//recalculate the grand total
$("#itemGrandTotal").html(auto_price_grand_total);
}
function generalSelect2Set(id) {
$('#'+id).select2({
width: "100%"
});
}
</script>
@endpush
@@ -0,0 +1,275 @@
@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/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<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" />
<style type="text/css">
#discounts_table td{
border-left: 1px solid #dddddd;
}
#paid_services_table td{
border-left: 1px solid #dddddd;
}
#services_table td{
border-left: 1px solid #dddddd;
}
</style>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-7">
<h4>{{ __('streamline_bills.streamline_bills') }}</h4>
</div>
<div class="col-md-5">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('streamline_bills.home') }}</a></li>
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('streamline_bills.finance_home') }}</a></li>
<li class="active"><i class="fa fa-bil"></i> {{ __('streamline_bills.streamline_bills') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-md-12">
@include('flash::message')
<div class="white-box" style="background-color: #F5FFFA">
<div class="row">
<div class="col-md-12">
<div class="pull-left">
<address>
<h3> &nbsp;<b class="text-danger">{{ $hospital_information->name }}</b></h3>
<p class="text-muted m-l-5">{{ $hospital_information->phone_number }}, {{ $hospital_information->email }},
<br/> {{ get_name($hospital_information->sub_county,'id', 'name', 'subcounties') }}, {{ get_name($hospital_information->district,'id', 'name', 'districts') }},
<br/> {{ $hospital_information->country }}.</p>
</address>
</div>
<div class="pull-right text-right">
<address>
<p class="m-t-30"><b> {{ __('streamline_bills.date') }} : </b> <i class="fa fa-calendar"></i> {{ streamline_date_time(\Carbon\Carbon::now()->toDateTimeString()) }}</p>
</address>
</div>
<br/>
</div>
</div>
<br/>
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col">
<div class="panel panel-default">
<div class="panel-heading">
<div class="row">
<div class="col text-left">
{{ __('streamline_bills.details') }}
</div>
</div>
</div>
{{ Form::open(['method'=>'post','route' => 'streamline_bill.generate']) }}
<div class="panel-body">
<div class="input_fields_wrap">
<div class="row">
<div class="span1"></div>
<div class="col">
<div class=" control-group">
<label class="control-label" for="dates">{{ __('streamline_bills.processed_by') }}:</label>
<div class="form-group">
<div class="input-group">
{{ Form::text('processed_by', get_full_name($user, 'id', 'first_name', 'last_name', 'users'),
['class'=>'form-control required compulsory', 'readonly', 'id'=>'processed_by']) }}
</div>
</div>
</div>
</div>
<div class="form-group col">
<label class="control-label" for="dates">{{ __('streamline_bills.date_type') }}:</label>
<select class="form-control compulsory required" name="dates" id="dates" required>
<option value="">{{ __('streamline_bills.select') }}</option>
<option value="today">{{ __('streamline_bills.today') }}</option>
<option value="yesterday">{{ __('streamline_bills.yesterday') }}</option>
<option value="custom_date">{{ __('streamline_bills.custom_date') }}</option>
<option value="custom_date_range">{{ __('streamline_bills.date_range') }}</option>
</select>
</div>
<div id="sDate" class="col" style="display: none;">
<div class="form-group">
{{ Form::label('start_date',__('streamline_bills.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control required compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div id="eDate" class="col" style="display: none;">
<div class="form-group">
{{ Form::label('end_date',__('streamline_bills.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control required compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class='col'>
<div class="input-group" style="margin-top: 28px">
<button class="btn btn-success btn-block btn-rounded">submit</button>
</div>
</div>
</div>
</div>
</div>
{{ Form::close() }}
</div>
</div>
</div>
<div class="row">
<div class="col panel">
<div class="panel-body">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('streamline_bills.patient_name') }}</th>
<th>{{ __('streamline_bills.patient_number') }}</th>
<th>{{ __('streamline_bills.first_visit') }}</th>
<th class="text-center">{{ __('streamline_bills.recorded_by') }}</th>
</tr>
</thead>
<tbody>
@if(count($patients) > 0)
@foreach($patients as $id)
<tr>
<th>{{ get_name($id, 'id', 'first_name', 'patients') }} {{ get_name($id, 'id', 'last_name', 'patients') }}</th>
<th>{{ get_name($id, 'id', 'number', 'patients') }}</th>
<th>{{ streamline_date(get_name($id, 'id', 'created_at', 'patients')) }}</th>
@php $created_by = get_name($id, 'id', 'created_by', 'patients'); @endphp
<th class="text-center">{{ get_full_name($created_by, 'id', 'first_name', 'last_name', 'users') }}</th>
</tr>
@endforeach
@else
<tr>
<th>{{ __('streamline_bills.no_results_found') }}</th>
<th></th>
<th></th>
<th></th>
</tr>
@endif
</tbody>
</table>
<br/>
<div class="text-right">
<h5><strong>{{ __('streamline_bills.number_of_patients') }}: <div class="label label-success">{{ count($patients) }}</div></strong></h5> <br>
<h5><strong>{{ __('streamline_bills.cost_per_patient_annually') }} : <div class="label label-success">{{ ugandan_shillings(1000) }}</div></strong></h5><br>
@php
$total = count($patients) * 1000;
@endphp
<h2><strong>{{ __('streamline_bills.total') }} : {{ ugandan_shillings($total) }}</strong></h2><br>
{{ Form::open(['method'=>'post', 'route'=>'streamline_bill.transfer']) }}
<input type="hidden" name="patient_string" value="{{ $patient_string }}">
<input type="hidden" name="total" value="{{ $total }}">
<button class="btn-danger btn btn-rounded">{{ __('streamline_bills.save_bill') }}</button>
{{ Form::close() }}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<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>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
"aoColumnDefs": [{
"aTargets": [2,3],
"defaultContent": "",
}]
});
</script>
<script type="text/javascript">
jQuery('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
<script type="text/javascript">
jQuery('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
<script>
$('#dates').change(function (e) {
if($(this).val() === "custom_date"){
$("#eDate").hide();
$("#sDate").show();
}else if($(this).val() === "custom_date_range"){
$("#sDate").show();
$("#eDate").show();
}else{
$("#eDate").hide();
$("#sDate").hide();
}
});
</script>
@endpush
@@ -0,0 +1,201 @@
@extends('layouts.main')
@push('styles')
<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" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-7">
<h4>{{ __('streamline_bills.streamline_bills') }}</h4>
</div>
<div class="col-md-5">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('streamline_bills.home') }}</a></li>
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('streamline_bills.finance_home') }}</a></li>
<li class="active"><i class="fa fa-bil"></i> {{ __('streamline_bills.streamline_bills') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-sm-12">
<div style="float: right;">
<button class="btn btn-rounded" style="background-color: #03C03C; color: white;" id="printPurchaseOrderReceipt">
<i class="fa fa-print"></i>
<span style="margin-left: 10px;">{{ __('streamline_bills.print') }}</span>
</button>
<br>
</div>
</div>
</div><br>
@include('flash::message')
<div class="white-box" style="background-color: #F5FFFA" id="printableContent">
<div class="row">
<div class="col-md-12">
<div class="pull-left">
<address>
<h3> &nbsp;<b class="text-danger">{{ $hospital_information->name }}</b></h3>
<p class="text-muted m-l-5">{{ $hospital_information->phone_number }}, {{ $hospital_information->email }},
<br/> {{ get_name($hospital_information->sub_county,'id', 'name', 'subcounties') }}, {{ get_name($hospital_information->district,'id', 'name', 'districts') }},
<br/> {{ $hospital_information->country }}.</p>
</address>
</div>
<div class="pull-right text-right">
<address>
<p class="m-t-30"><b> {{ __('streamline_bills.date') }} : </b> <i class="fa fa-calendar"></i> {{ streamline_date_time(\Carbon\Carbon::now()->toDateTimeString()) }}</p>
</address>
<button class="btn-success btn btn-rounded" disabled>{{ __('streamline_bills.bill_generated') }}</button>
</div>
<br/>
</div>
</div>
<br/>
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col panel">
<div class="panel-default">
<div class="panel-heading">
<div class="row">
<div class="col text-left">
{{ __('streamline_bills.billing_date') }}
</div>
<div class="col text-right">
@php
if(isset($report->time_frame)){ $time_frame = explode("&", $report->time_frame);}
@endphp
<div class="btn btn-info btn-rounded">{{ streamline_date(isset($time_frame[0]) ? streamline_date($time_frame[0]) : "" ) }}
@if(isset($time_frame[1]))
<b>{{ __('streamline_bills.to') }}</b>
{{ streamline_date($time_frame[1]) }}
@endif
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br/>
<div class="row">
<div class="col panel">
<div class="panel-body">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('streamline_bills.patient_name') }}</th>
<th>{{ __('streamline_bills.patient_number') }}</th>
<th>{{ __('streamline_bills.first_visit') }}</th>
<th class="text-center">{{ __('streamline_bills.recorded_by') }}</th>
</tr>
</thead>
<tbody>
@if(isset($report) > 0)
@php
$patients = explode("/", $report->patients);
@endphp
@foreach($patients as $id)
<tr>
<td>{{ get_full_name($id, 'id', 'first_name', 'last_name', 'patients') }}</td>
<td>{{ get_name($id, 'id', 'number', 'patients') }}r</td>
<td>
@php
$episode_date = \Streamline\Models\PatientEpisode::where('patient_id', $id)->pluck('created_at')->first();
echo streamline_date($episode_date);
@endphp
</td>
<td class="text-center">
@php
$recorded_by = \Streamline\Models\PatientEpisode::where('patient_id', $id)->pluck('created_by')->first();
echo get_full_name($recorded_by, 'id', 'first_name', 'last_name', 'users');
@endphp
</td>
</tr>
@endforeach
@else
<tr>
<th>{{ __('streamline_bills.no_records_found') }}</th>
<th></th>
<th></th>
<th></th>
</tr>
@endif
</tbody>
</table>
<br/>
<div class="text-right">
<h5><strong>{{ __('streamline_bills.number_of_patients') }}: <div class="label label-success"></div></strong></h5> <br>
<h5><strong>{{ __('streamline_bills.cost_per_patient_annually') }} : <div class="label label-success">{{ ugandan_shillings(1000) }}</div></strong></h5><br>
@php
$total = count($patients) * 1000;
@endphp
<h2><strong>Total : {{ ugandan_shillings($total) }}</strong></h2><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
@push('scripts')
<script type="text/javascript">
function printElementContent(elem,title){
var mywindow = window.open('', 'PRINT', 'height=400,width=600');
var css = '<link href="/elite/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">';
mywindow.document.write('<html><head><title></title>');
mywindow.document.write('</head><body >');
mywindow.document.write(css);
mywindow.document.write('<center><h3>' + title + '</h3></center>');
mywindow.document.write(document.getElementById(elem).innerHTML);
mywindow.document.write('</body></html>');
mywindow.document.close(); // necessary for IE >= 10
//mywindow.focus(); // necessary for IE >= 10*/
setTimeout(function () {
mywindow.focus();
mywindow.print();
mywindow.remove();
}, 500);
return true;
}
$("#printPurchaseOrderReceipt").click(function(e){
printElementContent('printableContent','Stre@mline Bill');
});
</script>
@endpush
@endpush
@@ -0,0 +1,232 @@
@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/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<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" />
<style type="text/css">
#discounts_table td{
border-left: 1px solid #dddddd;
}
#paid_services_table td{
border-left: 1px solid #dddddd;
}
#services_table td{
border-left: 1px solid #dddddd;
}
</style>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-7">
<h4>{{ __('streamline_bills.streamline_bills') }}</h4>
</div>
<div class="col-md-5">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('streamline_bills.home') }}</a></li>
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('streamline_bills.finance_home') }}</a></li>
<li class="active"><i class="fa fa-bil"></i> {{ __('streamline_bills.streamline_bills') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-md-12">
@include('flash::message')
<div class="white-box" style="background-color: #F5FFFA">
<div class="row">
<div class="col-md-12">
<div class="pull-left">
<address>
<h3> &nbsp;<b class="text-danger">{{ $hospital_information->name }}</b></h3>
<p class="text-muted m-l-5">{{ $hospital_information->phone_number }}, {{ $hospital_information->email }},
<br/> {{ get_name($hospital_information->sub_county,'id', 'name', 'subcounties') }}, {{ get_name($hospital_information->district,'id', 'name', 'districts') }},
<br/> {{ $hospital_information->country }}.</p>
</address>
<br/>
<a role="button" class="btn btn-success btn-rounded btn-block" href="{{ route('streamline_bill.create') }}">{{ __('streamline_bills.generate_bill') }}</a>
</div>
<div class="pull-right text-right">
<address>
<p class="m-t-30"><b> {{ __('streamline_bills.date') }} : </b> <i class="fa fa-calendar"></i> {{ streamline_date_time(\Carbon\Carbon::now()->toDateTimeString()) }}</p>
</address>
</div>
<br/>
</div>
</div>
<br/>
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col panel">
<div class="panel-body">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('streamline_bills.number_of_patients') }}</th>
<th>{{ __('streamline_bills.time_frame') }}</th>
<th>{{ __('streamline_bills.amount_to_be_paid') }}</th>
<th>{{ __('streamline_bills.amount_paid') }}</th>
<th>{{ __('streamline_bills.generated_by') }}</th>
<th></th>
<th>{{ __('streamline_bills.action') }}</th>
</tr>
</thead>
<tbody>
@if(count($reports) > 0)
@foreach($reports as $item)
@php
$ids = explode('/', $item['patients']);
$dates = explode('&', $item['time_frame']);
$count = count($ids);
@endphp
<tr>
<td>
<button onclick="view_patients('{{$item['id']}}')" class="btn btn-info btn-rounded">{{ $count }}</button>
</td>
<td>
<div class="label label-info">
{{ streamline_date($dates[0]) }} to @php if(isset($dates[1])){ echo streamline_date($dates[1]); }else{ echo ""; } @endphp
</div>
</td>
<td>{{ ugandan_shillings($item['amount_to_be_paid']) }}</td>
<td>{{ ugandan_shillings($item['amount_paid']) }}</td>
<td>{{ get_full_name($item['created_by'], 'id', 'first_name', 'last_name', 'users') }}</td>
<td><a href="{{ route('streamline_bill.detail', $item->id) }}" class="btn btn-primary btn-sm btn-rounded"><i class="fa fa-eye"></i> {{ __('streamline_bills.view_invoice') }}</a></td>
<td>
<a href="{{ url('/streamline_bill/delete', $item['id']) }}" onclick="return confirm('Are you sure?')" class="btn btn-danger btn-sm btn-rounded" role="button">
<i class="fa fa-trash"></i>
{{ __('streamline_bills.delete') }}
</a>
</td>
</tr>
@endforeach
@else
<tr>
<th>{{ __('streamline_bills.no_results_found') }}</th>
<th></th>
<th></th>
<th></th>
</tr>
@endif
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="displayPatientsModal" tabindex="-1" role="dialog" aria-labelledby="displayPatientsModalLabel" aria-hidden="true" style="border-radius: 10px; margin-top: 200px ">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Patient on this Bill</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div id="patients_listing"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<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>
function view_patients(id) {
$.ajax({
method: 'POST',
url: '/streamline_bill/view_patients',
data: {
'id':id
},
success: function(response){
patients = "<ol>"+response+"</ol>";
$('#patients_listing').html(patients);
$('#displayPatientsModal').modal('show');
},
error: function (error) {
console.log(error);
}
});
}
</script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
"aoColumnDefs": [{
"aTargets": [2,3],
"defaultContent": "",
}]
});
</script>
<script>
$('#dates').change(function (e) {
if($(this).val() === "custom_date"){
$("#eDate").hide();
$("#sDate").show();
}else if($(this).val() === "custom_date_range"){
$("#sDate").show();
$("#eDate").show();
}else{
$("#eDate").hide();
$("#sDate").hide();
}
});
</script>
@endpush