resolved conflicts

This commit is contained in:
2025-03-31 03:46:05 +03:00
6454 changed files with 1520539 additions and 9 deletions
@@ -0,0 +1,54 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/icheck/skins/all.css') }}" rel="stylesheet">
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-7">
<h4 class="page-title">{{ __('patient_refund.refund_point') }}</h4>
</div>
<div class="col-md-5">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('patient_refund.dashboard') }}</a></li>
<li class="active">{{ __('patient_refund.patient_refund') }}</li>
</ol>
</div>
</div>
<div class="white-box">
<h3 class="text-center">{{ __('patient_refund.choose_a_refund_point') }}</h3>
<br>
{{ Form::open(['route' => 'patient_refund.register_refund_details', 'data-toggle' => 'validator']) }}
<div class="row">
<div class="col-md-4">
{{ Form::radio('refund_point', 1, false, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green', ($consultations == 0) ? 'disabled' : '']) }} {{ __('patient_refund.consultations') }} <br><br>
{{--{{ Form::radio('refund_point', 2, false, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green', ($prescription == 0) ? 'disabled' : '']) }} {{ __('patient_refund.treatments') }} <br><br>--}}
{{ Form::radio('refund_point', 3, false, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green', ($investigations == 0) ? 'disabled' : '']) }} {{ __('patient_refund.investigations') }} <br><br>
</div>
<div class="col-md-4">
{{ Form::radio('refund_point', 4, false, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green', ($procedures_paid == 0) ? 'disabled' : '']) }} {{ __('patient_refund.procedures') }} <br><br>
{{ Form::radio('refund_point', 5, false, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green', ($other_services == 0) ? 'disabled' : '']) }} {{ __('patient_refund.other_services') }} <br><br>
{{--{{ Form::radio('refund_point', 7, false, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green', ($sundries_paid == 0) ? 'disabled' : '']) }} {{ __('patient_refund.sundries') }} <br><br>--}}
</div>
<div class="col-md-4">
{{ Form::radio('refund_point', 6, false, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green', ($inpatient_deposits == 0) ? 'disabled' : '']) }} {{ __('patient_refund.inpatient_deposits') }} <br><br>
{{ Form::radio('refund_point', 8, false, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green', ($co_payment == 0) ? 'disabled' : '']) }} {{ __('patient_refund.co_payment') }} <br><br>
</div>
</div>
<div class="text-center">
{{ Form::button('Continue',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
</div>
{{ Form::close() }}
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/icheck/icheck.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/icheck/icheck.init.js') }}"></script>
@endpush
@@ -0,0 +1,136 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
<style type="text/css">
#divToPrint{
font-size: 13px;
color: #7c7c7c;
}
#receipt_table{
font-size: 1em;
font-weight: normal;
font-family: monospace
}
#receipt_table th{
border: 1px solid #dddddd;
}
#receipt_table td{
border: 1px solid #dddddd;
}
.receipt-label{
margin-top: 10px;
padding: 10px;
}
.receipt-title{
font-weight: bolder;
text-decoration: underline;
display: block; font-family:
monospace
}
</style>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-7">
<h4>{{ __('patient_refund.patient_refund_receipt') }}</h4>
</div>
<div class="col-md-5">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('patient_refund.dashboard') }}</a></li>
<li><a href="{{ route('patient_finance.home') }}">{{ __('patient_refund.finance_home') }}</a></li>
<li class="active">{{ __('patient_refund.patient_refund') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="white-box">
@if (!empty(session()->get('episode_id')))
<div class="row">
<div class="col-9"></div>
<div class="col-1" style="float:right;"><button class="btn btn-success" onclick="print_receipt()"><span class="glyphicon glyphicon-print"></span> {{ __('patient_finance.print') }}</button></div>
<div class="col-2">
@if(Auth::user()->can('view-episode-summary'))
<a type="button" class="btn btn-primary" href="/patients/episode_summary/{{ session()->get('episode_id') }}" target="_blank" id="patient_file">{{ __('patient_episode.episode_summary') }}</a>
@endif
</div>
</div>
@else
<div class="row" style="float:right;"><button class="btn btn-success glyphicon glyphicon-print" onclick="print_receipt()"> {{ __('patient_refund.print') }}</button></div>
@endif
<div class="row" id="divToPrint">
<div class="col-sm-3"></div>
<div class="col-sm-6" style="text-align: center;">
<p style="text-align: center; font-size: 1em">
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace"><b>{{ $hospital_information->name }}</b></span>
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace">{{ $hospital_information->address }}</span>
<span class="receipt-label"><b>{{ __('patient_refund.tel') }}:</b> {{ $hospital_information->phone_number }}</span><br>
<span class="receipt-label"><b>{{ __('patient_refund.email') }}:</b> {{ $hospital_information->email }}</span><br>
<span class="receipt-label"><b>{{ __('patient_refund.cashier') }}:</b> {{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</span><br>
<span class="receipt-label"><b>{{ __('consultations.date') }}:</b> {{ streamline_date_time_short($receipt_date) }}</span><br>
<span class="receipt-label"><b>{{ __('patient_refund.credit_memo_number') }}:</b> {{ $receipt_number }}</span><br>
<span class="receipt-label"><b>{{ __('patient_refund.patient') }}</b> : {{ $patient->first_name }} {{ $patient->last_name }}</span><br>
<span class="receipt-label"><b>{{ __('finance.patient_number') }}</b> : {{ $patient->number }}</span><br>
<span class="receipt-label"><b>{{ __('patient_refund.category') }} :</b> {{ get_name($patient->category_id, "id", "name", "patient_categories") }}</span>
</p>
<div>
<table class="table" id="receipt_table">
<thead>
<th style="width: 60%"><b>{{ __('patient_refund.description') }}</b></th>
<th style="width: 20%"><b>{{ __('patient_refund.price') }}</b></th>
</thead>
<tbody>
<tr>
<td><b>{{ __('patient_refund.refund_amount') }}</b></td>
<td><b>{{ ugandan_shillings($refund_amount) }}</b></td>
</tr>
<tr>
<td><b>{{ __('patient_refund.refund_reason') }}</b></td>
<td><b>{{ $refund_reason }}</b></td>
</tr>
<tr>
<td><b>{{ __('patient_refund.refund_reference_receipt_number') }}</b></td>
<td><b>{{ $original_receipt_number }}</b></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-sm-3">
</div>
<i style="font-size: 0.8em; margin-left: 50%;">&copy; {{ __('patient_refund.streamline') }}</i>
</div>
</div>
</div>
</div>
@endsection
@push('styles')
<script type="text/javascript">
function print_receipt() {
let myDiv = document.getElementById('divToPrint');
let newWindow = window.open('', 'SecondWindow', 'toolbar=0,stat=0');
newWindow.document.write("<html><body " +
"class='' " +
" onload='window.print()'>" +
myDiv.innerHTML +
"</body></html>");
newWindow.document.close();
return false;
}
</script>
@endpush
@@ -0,0 +1,618 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<style>
.color-tr{
background: #FFFF99;
}
</style>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-7">
<h4 class="page-title">{{ __('patient_refund.refund_details') }}</h4>
</div>
<div class="col-md-5">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('patient_refund.dashboard') }}</a></li>
<li class="active">{{ __('patient_refund.patient_refund') }}</li>
</ol>
</div>
</div>
@if($refund_point == 1)
<div class="white-box">
<div class="row">
<div class="col-md-12">
<h4>{{ __('patient_refund.consultation_payments') }}</h4>
<table class="table color-bordered-table success-bordered-table" id="paid_services_table">
<thead>
<tr>
<th></th>
<th>{{ __('patient_refund.receipt_number') }}</th>
<th>{{ __('patient_refund.service_items') }}</th>
<th>{{ __('patient_refund.service_prices') }}</th>
<th>{{ __('patient_refund.patient_amount_paid') }}</th>
<th>{{ __('patient_refund.collected_by') }}</th>
<th>{{ __('patient_refund.payment_date') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($services as $service)
<tr id="row_{{ $service->id }}">
<td>{{ Form::radio('selected_item', false, false, ['onclick' => 'update_refund_status(' . $service->id . ',' . $service->patient_amount_paid . ')']) }}</td>
<td>{{ $service->receipt_number }}</td>
<td>
@php $items_counter = 1; @endphp
@php $service_items_array = explode(",", $service->items_ids); @endphp
@foreach($service_items_array as $item)
{{ $items_counter }}. {{ get_name($item, 'id', 'name', 'services') }} <br>
@php $items_counter++; @endphp
@endforeach
</td>
<td>
@php $items_counter = 1; @endphp
@php $service_price_array = explode(",", $service->items_amounts); @endphp
@foreach($service_price_array as $price)
{{ $items_counter }}. {{ ugandan_shillings($price) }} <br>
@php $items_counter++; @endphp
@endforeach
</td>
<td>
{{ ugandan_shillings($service->patient_amount_paid) }}
@if($service->refund_amount > 0)
<br><br>
<span style="color: orangered">
{{ ugandan_shillings($service->refund_amount) }} {{ __('patient_refund.was_refunded') }}
</span>
@endif
</td>
<td>{{ get_full_name($service->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
<td>{{ streamline_date($service->created_at) }}</td>
<td>
<a class="btn btn-success btn-sm" href="/patient_finance/print_service_receipt/1/{{ $service->id }}">{{ __('patient_finance.print_receipt') }}</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endif
@if($refund_point == 2)
<div class="row">
<div class="col-sm-12">
<div class="white-box">
<h4>{{ __('patient_refund.treatment_payments') }}</h4>
<table class="table color-bordered-table success-bordered-table" id="paid_treatments_table">
<thead>
<tr>
<th></th>
<th>{{ __('patient_refund.receipt_number') }}</th>
<th>{{ __('patient_refund.treatment_items') }}</th>
<th>{{ __('patient_refund.treatment_quantities') }}</th>
<th>{{ __('patient_refund.treatment_subtotals') }}</th>
<th>{{ __('patient_refund.patient_amount_paid') }}</th>
<th>{{ __('patient_refund.collected_by') }}</th>
<th>{{ __('patient_refund.payment_date') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($paid_treatments as $paid_treatment)
<tr id="row_{{ $paid_treatment->id }}">
<td>{{ Form::radio('selected_item', false, false, ['onclick' => 'update_refund_status(' .$paid_treatment->id . ',' .$paid_treatment->patient_amount_paid . ')']) }}</td>
<td>{{ $paid_treatment->receipt_number }}</td>
<td>
@php $items_counter = 1; @endphp
@php $treatment_items_array = explode(",", $paid_treatment->treatment_items); @endphp
@foreach($treatment_items_array as $item)
{{ $items_counter }}. {{ get_name($item, 'id', 'name', 'drugs') }} <br>
@php $items_counter++; @endphp
@endforeach
</td>
<td>
@php $items_counter = 1; @endphp
@php $treatment_quantity_array = explode(",", $paid_treatment->treatment_quantities); @endphp
@foreach($treatment_quantity_array as $quantity)
{{ $items_counter }}. {{ $quantity }} <br>
@php $items_counter++; @endphp
@endforeach
</td>
<td>
@php $items_counter = 1; @endphp
@php $treatment_price_array = explode(",", $paid_treatment->treatment_subtotals); @endphp
@foreach($treatment_price_array as $price)
{{ $items_counter }}. {{ ugandan_shillings($price) }} <br>
@php $items_counter++; @endphp
@endforeach
</td>
<td>
{{ ugandan_shillings($paid_treatment->patient_amount_paid) }}
@if($paid_treatment->refund_amount > 0)
<br><br>
<span style="color: orangered">
{{ ugandan_shillings($paid_treatment->refund_amount) }} {{ __('patient_refund.was_refunded') }}
</span>
@endif
</td>
<td>{{ get_full_name($paid_treatment->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
<td>{{ streamline_date($paid_treatment->created_at) }}</td>
<td>
<a class="btn btn-success btn-sm" href="/patient_finance/print_treatment_receipt/1/{{ $paid_treatment->id }}">{{ __('patient_finance.print_receipt') }}</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endif
@if($refund_point == 3)
<div class="white-box">
<div class="row">
<div class="col-md-12">
<h4>{{ __('patient_refund.investigation_payments') }}</h4>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table" id="paid_investigations_table">
<thead>
<tr>
<th></th>
<th>{{ __('patient_refund.receipt_number') }}</th>
<th>{{ __('patient_refund.investigation_items') }}</th>
<th>{{ __('patient_refund.investigation_prices') }}</th>
<th>{{ __('patient_refund.patient_amount_paid') }}</th>
<th>{{ __('patient_refund.collected_by') }}</th>
<th>{{ __('patient_refund.payment_date') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($investigations as $investigation)
<tr id="row_{{ $investigation->id }}">
<td>{{ Form::radio('selected_item', false, false, ['onclick' => 'update_refund_status(' .$investigation->id . ',' .$investigation->patient_amount_paid . ')']) }}</td>
<td>{{ $investigation->receipt_number }}</td>
<td>
@php $items_counter = 1; @endphp
@php $investigation_items_array = explode(",", $investigation->investigation_items); @endphp
@foreach($investigation_items_array as $item)
{{ $items_counter }}. {{ get_name($item, 'id', 'name', 'investigations') }} <br>
@php $items_counter++; @endphp
@endforeach
</td>
<td>
@php $items_counter = 1; @endphp
@php $investigation_price_array = explode(",", $investigation->investigation_amounts); @endphp
@foreach($investigation_price_array as $price)
{{ $items_counter }}. {{ ugandan_shillings($price) }} <br>
@php $items_counter++; @endphp
@endforeach
</td>
<td>
{{ ugandan_shillings($investigation->patient_amount_paid) }}
@if($investigation->refund_amount > 0)
<br><br>
<span style="color: orangered">
{{ ugandan_shillings($investigation->refund_amount) }} {{ __('patient_refund.was_refunded') }}
</span>
@endif
</td>
<td>{{ get_full_name($investigation->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
<td>{{ streamline_date($investigation->created_at) }}</td>
<td>
<a class="btn btn-success btn-sm" href="/patient_finance/print_investigation_receipt/1/{{ $investigation->id }}">{{ __('patient_finance.print_receipt') }}</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endif
@if($refund_point == 4)
<div class="white-box">
<div class="row">
<div class="col-md-12">
<h4>{{ __('patient_refund.procedure_payments') }}</h4>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table" id="paid_procedures_table">
<thead>
<tr>
<th></th>
<th>{{ __('patient_refund.receipt_number') }}</th>
<th>{{ __('patient_refund.procedure_items') }}</th>
<th>{{ __('patient_refund.procedure_prices') }}</th>
<th>{{ __('patient_refund.patient_amount_paid') }}</th>
<th>{{ __('patient_refund.collected_by') }}</th>
<th>{{ __('patient_refund.payment_date') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($procedures as $procedure)
<tr id="row_{{ $procedure->id }}">
<td>{{ Form::radio('selected_item', false, false, ['onclick' => 'update_refund_status(' .$procedure->id . ',' .$procedure->patient_amount_paid . ')']) }}</td>
<td>{{ $procedure->receipt_number }}</td>
<td>
@php $items_counter = 1; @endphp
@php $procedure_items_array = explode(",", $procedure->procedure_items); @endphp
@foreach($procedure_items_array as $item)
{{ $items_counter }}. {{ get_name($item, 'id', 'name', 'procedures') }} <br>
@php $items_counter++; @endphp
@endforeach
</td>
<td>
@php $items_counter = 1; @endphp
@php $procedure_price_array = explode(",", $procedure->procedure_amounts); @endphp
@foreach($procedure_price_array as $price)
{{ $items_counter }}. {{ ugandan_shillings($price) }} <br>
@php $items_counter++; @endphp
@endforeach
</td>
<td>
{{ ugandan_shillings($procedure->patient_amount_paid) }}
@if($procedure->refund_amount > 0)
<br><br>
<span style="color: orangered">
{{ ugandan_shillings($procedure->refund_amount) }} {{ __('patient_refund.was_refunded') }}
</span>
@endif
</td>
<td>{{ get_full_name($procedure->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
<td>{{ streamline_date($procedure->created_at) }}</td>
<td>
<a class="btn btn-success btn-sm" href="/patient_finance/print_procedures_receipt/1/{{ $procedure->id }}">{{ __('patient_finance.print_receipt') }}</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endif
@if($refund_point == 5)
<div class="white-box">
<div class="row">
<div class="col-md-12">
<h4>{{ __('patient_refund.service_payments') }}</h4>
<table class="table color-bordered-table success-bordered-table" id="paid_services_table">
<thead>
<tr>
<th></th>
<th>{{ __('patient_refund.receipt_number') }}</th>
<th>{{ __('patient_refund.service_items') }}</th>
<th>{{ __('patient_refund.service_prices') }}</th>
<th>{{ __('patient_refund.patient_amount_paid') }}</th>
<th>{{ __('patient_refund.collected_by') }}</th>
<th>{{ __('patient_refund.payment_date') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($services as $service)
<tr id="row_{{ $service->id }}">
<td>{{ Form::radio('selected_item', false, false, ['onclick' => 'update_refund_status(' .$service->id . ',' .$service->patient_amount_paid . ')']) }}</td>
<td>{{ $service->receipt_number }}</td>
<td>
@php $items_counter = 1; @endphp
@php $service_items_array = explode(",", $service->items_ids); @endphp
@foreach($service_items_array as $item)
{{ $items_counter }}. {{ get_name($item, 'id', 'name', 'services') }} <br>
@php $items_counter++; @endphp
@endforeach
</td>
<td>
@php $items_counter = 1; @endphp
@php $service_price_array = explode(",", $service->items_amounts); @endphp
@foreach($service_price_array as $price)
{{ $items_counter }}. {{ ugandan_shillings($price) }} <br>
@php $items_counter++; @endphp
@endforeach
</td>
<td>
{{ ugandan_shillings($service->patient_amount_paid) }}
@if($service->refund_amount > 0)
<br><br>
<span style="color: orangered">
{{ ugandan_shillings($service->refund_amount) }} {{ __('patient_refund.was_refunded') }}
</span>
@endif
</td>
<td>{{ get_full_name($service->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
<td>{{ streamline_date($service->created_at) }}</td>
<td>
<a class="btn btn-success btn-sm" href="/patient_finance/print_service_receipt/1/{{ $service->id }}">{{ __('patient_finance.print_receipt') }}</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endif
@if($refund_point == 6)
<div class="white-box">
<div class="row">
<div class="col-md-12">
<h4>{{ __('patient_refund.inpatient_deposits') }}</h4>
<table class="table color-bordered-table success-bordered-table" id="paid_services_table">
<thead>
<tr>
<th></th>
<th>{{ __('patient_refund.receipt_number') }}</th>
<th>{{ __('patient_refund.patient_amount_paid') }}</th>
<th>{{ __('patient_refund.collected_by') }}</th>
<th>{{ __('patient_refund.payment_date') }}</th>
</tr>
</thead>
<tbody>
@foreach($inpatient_fees as $inpatient_fee)
<tr id="row_{{ $inpatient_fee->id }}">
<td>{{ Form::radio('selected_item', false, false, ['onclick' => 'update_refund_status(' .$inpatient_fee->id . ',' .$inpatient_fee->patient_amount_paid . ')']) }}</td>
<td>{{ $inpatient_fee->receipt_number }}</td>
<td>{{ ugandan_shillings($inpatient_fee->patient_amount_paid) }}</td>
<td>{{ get_full_name($inpatient_fee->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
<td>{{ streamline_date($inpatient_fee->created_at) }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endif
@if($refund_point == 7)
<div class="row">
<div class="col-md-12">
<div class="white-box">
<h4>{{ __('patient_refund.sundries_payments') }}</h4>
<table class="table color-bordered-table success-bordered-table" id="paid_sundries_table">
<thead>
<tr>
<th></th>
<th>{{ __('patient_refund.receipt_number') }}</th>
<th>{{ __('patient_refund.sundries_items') }}</th>
<th>{{ __('patient_refund.sundries_quantities') }}</th>
<th>{{ __('patient_refund.sundries_subtotals') }}</th>
<th>{{ __('patient_refund.patient_amount_paid') }}</th>
<th>{{ __('patient_refund.collected_by') }}</th>
<th>{{ __('patient_refund.payment_date') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($paid_sundries as $sundry)
<tr id="row_{{ $sundry->id }}">
<td>{{ Form::radio('selected_item', false, false, ['onclick' => 'update_refund_status(' .$sundry->id . ',' .$sundry->patient_amount_paid . ')']) }}</td>
<td>{{ $sundry->receipt_number }}</td>
<td>
@php $items_counter = 1; @endphp
@php $sundry_items_array = explode(",", $sundry->sundry_items); @endphp
@foreach($sundry_items_array as $item)
{{ $items_counter }}. {{ get_name($item, 'id', 'name', 'sundries') }} <br>
@php $items_counter++; @endphp
@endforeach
</td>
<td>
@php $items_counter = 1; @endphp
@php $sundry_quantity_array = explode(",", $sundry->sundry_quantity); @endphp
@foreach($sundry_quantity_array as $quantity)
{{ $items_counter }}. {{ $quantity }} <br>
@php $items_counter++; @endphp
@endforeach
</td>
<td>
@php $items_counter = 1; @endphp
@php $sundry_price_array = explode(",", $sundry->sundry_subtotals); @endphp
@foreach($sundry_price_array as $price)
{{ $items_counter }}. {{ ugandan_shillings($price) }} <br>
@php $items_counter++; @endphp
@endforeach
</td>
<td>
{{ ugandan_shillings($sundry->patient_amount_paid) }}
@if($sundry->refund_amount > 0)
<br><br>
<span style="color: orangered">
{{ ugandan_shillings($sundry->refund_amount) }} {{ __('patient_refund.was_refunded') }}
</span>
@endif
</td>
<td>{{ get_full_name($sundry->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
<td>{{ streamline_date($sundry->created_at) }}</td>
<td>
<a class="btn btn-success btn-sm" href="/patient_finance/print_sundries_receipt/1/{{ $sundry->id }}">{{ __('patient_finance.print_receipt') }}</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endif
@if($refund_point == 8)
<div class="white-box">
<div class="row">
<div class="col-md-12">
<h4>{{ __('patient_refund.co_payment_payments') }}</h4>
<table class="table color-bordered-table success-bordered-table" id="paid_services_table">
<thead>
<tr>
<th></th>
<th>{{ __('patient_refund.receipt_number') }}</th>
<th>{{ __('patient_refund.service_items') }}</th>
<th>{{ __('patient_refund.service_prices') }}</th>
<th>{{ __('patient_refund.patient_amount_paid') }}</th>
<th>{{ __('patient_refund.collected_by') }}</th>
<th>{{ __('patient_refund.payment_date') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($services as $service)
<tr id="row_{{ $service->id }}">
<td>{{ Form::radio('selected_item', false, false, ['onclick' => 'update_refund_status(' . $service->id . ',' . $service->patient_amount_paid . ')']) }}</td>
<td>{{ $service->receipt_number }}</td>
<td>
@php $items_counter = 1; @endphp
@php $service_items_array = explode(",", $service->items_ids); @endphp
@foreach($service_items_array as $item)
{{ $items_counter }}. {{ get_name($item, 'id', 'name', 'services') }} <br>
@php $items_counter++; @endphp
@endforeach
</td>
<td>
@php $items_counter = 1; @endphp
@php $service_price_array = explode(",", $service->items_amounts); @endphp
@foreach($service_price_array as $price)
{{ $items_counter }}. {{ ugandan_shillings($price) }} <br>
@php $items_counter++; @endphp
@endforeach
</td>
<td>
{{ ugandan_shillings($service->patient_amount_paid) }}
@if($service->refund_amount > 0)
<br><br>
<span style="color: orangered">
{{ ugandan_shillings($service->refund_amount) }} {{ __('patient_refund.was_refunded') }}
</span>
@endif
</td>
<td>{{ get_full_name($service->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
<td>{{ streamline_date($service->created_at) }}</td>
<td>
<a class="btn btn-success btn-sm" href="/patient_finance/print_service_receipt/1/{{ $service->id }}">{{ __('patient_finance.print_receipt') }}</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endif
<div class="white-box">
{{ Form::open(['route' => 'patient_refund.save_refund_details', 'data-toggle' => 'validator']) }}
{{ Form::hidden('maximum_refund_amount', 0, ['id' => 'maximum_refund_amount']) }}
{{ Form::hidden('id', 0, ['id' => 'refund_id']) }}
{{ Form::hidden('refund_point', $refund_point) }}
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('refund_amount','Refund Amount') }}
{{ Form::number('refund_amount','',['class' => 'form-control compulsory', 'required', 'id' => 'refund_amount']) }}
</div>
<div class="form-group">
{{ Form::label('refund_reason','Refund Reason') }}
{{ Form::textarea('refund_reason','',['class' => 'form-control compulsory', 'required']) }}
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('refund_date','Refund Date') }}
<div class="input-group">
{{ Form::text('refund_date','',['class' => 'form-control datepicker-autoclose compulsory', 'readonly', 'required', 'id'=>'refund_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
<div class="form-group">
{{ Form::label('reverse_doctor_fees','Reverse staff fees') }}
<br>
{{ Form::radio('reverse_doctor_fees', 1, false, ["required"]) }} Yes &nbsp;&nbsp;
{{ Form::radio('reverse_doctor_fees', 0, false, ["required"]) }} No
<div class="help-block with-errors"></div>
</div>
</div>
</div>
<div class="text-center">
{{ Form::button('Refund Patient',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'onclick' => 'return checkAmount();']) }}
</div>
{{ Form::close() }}
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script>
let is_refund_item_selected = false;
$(document).ready(function () {
$("#refund_date").datepicker("setDate", new Date());
});
function update_refund_status(id,amount) {
let previous_id = $('#refund_id').val();
$("#row_" + previous_id).removeClass('color-tr');
$('#row_' + id).addClass('color-tr');
$('#refund_id').val(id);
$('#maximum_refund_amount').val(amount);
is_refund_item_selected = true;
}
// confirm that amount to be paid back is less than amount the patient paid
function checkAmount() {
if (confirm("Are you sure you want to refund this patient")){
if (is_refund_item_selected) {
let maximum_refund_amount = parseInt($('#maximum_refund_amount').val());
let refund_amount = parseInt($('#refund_amount').val());
if (refund_amount > maximum_refund_amount){
alert("The refund amount is more than the amount paid by the patient. Please enter an appropriate figure");
return false;
} else {
return true;
}
} else {
alert("Please select item to refund");
return false;
}
} else {
return false;
}
}
</script>
@endpush