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,127 @@
@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" />
@endpush
@section('content')
<br/>
<div class="row">
<div id="invoice">
<div class="col-md-10 offset-1">
<div class="white-box">
<h3><b>{{ __('invoices.invoice') }}</b> <span class="pull-right">#{{ $request->invoice_number }}</span></h3>
<hr>
<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>
<h3>To,</h3>
<h4 class="font-bold">{{ get_name($request->donor, 'id', 'name', 'donors') }}</h4>
<p class="text-muted m-l-30">{{ streamline_date($request->start_date) }} to {{ streamline_date($request->end_date) }},
<p class="m-t-30"><b>{{ __('invoices.invoice_date') }} : </b> <i class="fa fa-calendar"></i> {{ streamline_date_time(\Carbon\Carbon::now()->toDateTimeString()) }}</p>
<p><b>{{ __('invoices.due_date') }} : </b> <i class="fa fa-calendar"></i> {{ streamline_date_time(\Carbon\Carbon::now()->toDateTimeString()) }}</p>
</address>
</div>
</div>
<div class="col-md-12">
<div class="table-responsive m-t-40">
<table class="table table-hover color-bordered-table success-bordered-table">
<thead>
<tr>
<th class="text-center">{{ __('invoices.date') }}</th>
<th class="text-right">{{ __('invoices.invoice_number') }}</th>
<th class="text-right">{{ __('invoices.patient_name') }}</th>
<th class="text-right">{{ __('invoices.amount') }}</th>
<th class="text-right">{{ __('invoices.reason') }}</th>
</tr>
@php
$sum_total = 0;
@endphp
</thead>
<tbody>
@foreach($invoices as $item)
<tr>
<td class="text-center">{{ streamline_date($item->created_at) }}</td>
<td class="text-right">{{ $item->receipt_number }}</td>
<td class="text-right">{{ get_full_name($item->patient_id, 'id', 'first_name', 'last_name', 'patients') }}</td>
<td class="text-right">
@php
$amount = $item->donor_to_pay;
$sum_total += $amount;
echo ugandan_shillings($amount);
@endphp
</td>
<td class="text-right">
{{ get_name($item->tag_id, 'id', "name", 'finance_point_tags') }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<div class="col-md-12">
<div class="pull-right m-t-30 text-right">
<p>{{ __('invoices.sub_total_amount') }}: {{ ugandan_shillings($sum_total) }}</p>
<p>vat (0%) : </p>
<hr>
<h3><b>{{ __('invoices.total') }} :</b>{{ ugandan_shillings($sum_total) }}</h3> </div><br/>
<p><strong>{{ __('invoices.served_by') }} : </strong></p><h3>{{ $users_name }}</h3>
<p>{{ __('invoices.sign') }}..................................................................................................................</p>
<div class="clearfix"></div>
<hr>
</div>
</div>
</div>
</div>
</div>
<div class="text-right">
{{--<button class="btn btn-danger" type="submit"> Proceed to payment </button>--}}
<button onclick="showPopup();" class="btn btn-default btn-outline" type="button"> <span><i class="fa fa-print"></i> {{ __('invoices.print') }}</span> </button>
</div>
</div>
@endsection
@push('scripts')
<!-- Date Picker Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
function showPopup() {
var myDiv = document.getElementById('invoice');
var 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>
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script>
$('#table').DataTable();
</script>
@endpush
@@ -0,0 +1,237 @@
@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" />
<style>
@media print {tr.vendorListHeading {
background-color: #1a4567 !important;
-webkit-print-color-adjust: exact;
}}
@media print {.vendorListHeading th {
color: white !important;
}}
</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">{{ __('invoices.patient_category_invoices') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('finance.home') }}</a></li>
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('finance.finance_home') }}</a></li>
<li><a href="{{ route('invoices') }}"><i class="fa fa-file"></i> {{ __('finance.invoices_home') }}</a></li>
<li class="active"><i class="fa fa-file"></i> {{ __('invoices.patient_category_invoices') }}</li>
</ol>
</div>
</div>
<br/>
<div class="row">
<div class="col-md-10 text-right">
<a class="btn btn-primary" href="{{ route('invoices.print_invoice', $request->invoice_number) }}" target="_blank"> <span><i class="fa fa-print"></i> {{ __('invoices.print') }}</span> </a>
</div>
</div>
<br>
<div class="row">
<div id="printableContent">
<div class="col-md-12">
<div class="white-box">
<h3><b>{{ __('invoices.invoice') }}</b> <span class="pull-right">#{{ $request->invoice_number }}</span></h3>
<hr>
<div class="row">
<div class="col-md-12">
<div class="pull-left">
<a href="javascript:void(0)" class="text-center db">
@php $hospital_information = \Streamline\Models\HospitalInformation::first(); @endphp
<img src="{{ asset($hospital_information->logo) }}" style="max-height: 160px; margin: auto; max-width: 260px;" alt="Home" /><br/>
</a>
<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>
<h3>To,</h3>
<h4 class="font-bold">{{ get_name($request->patient_category, 'id', 'name', 'patient_categories') }} <br> {{ individual_of_invoice($request->invoice_number) ?? "" }}</h4>
<p class="text-muted m-l-30">{{ streamline_date($request->start_date) }} {{ __('invoices.to') }} {{ streamline_date($request->end_date) }},
<p class="m-t-30"><b>{{ __('invoices.invoice_date') }} : </b> <i class="fa fa-calendar"></i> {{ streamline_date_time(\Carbon\Carbon::now()->toDateTimeString()) }}</p>
</address>
</div>
</div>
<div class="col-md-12">
<div class="row">
<div class="col-md-12">
<br/>
<br/>
</div>
</div>
<div class="table-responsive m-t-40">
<table class="table table-hover color-bordered-table success-bordered-table">
<thead>
@if ((count($invoices)==1) && ($invoices[0]->patient_id==0) && ($invoices[0]->episode_id==0))
<tr>
<th>{{ __('invoices.date') }}</th>
<th colspan="4">{{ __('invoices.description') }}</th>
<th>{{ __('invoices.amount') }}</th>
</tr>
@else
<tr>
<th class="text-center">{{ __('invoices.date') }}</th>
<th class="text-center">{{ __('invoices.claim_number') }}</th>
<th class="text-center">{{ __('invoices.patient_number') }}</th>
<th class="text-center">{{ __('invoices.patient_name') }}</th>
<th class="text-center">{{ __('invoices.amount') }}</th>
<th class="text-center">{{ __('invoices.reason') }}</th>
</tr>
@endif
@php
$sum_total = 0;
@endphp
</thead>
<tbody>
@if ((count($invoices)==1) && ($invoices[0]->patient_id==0) && ($invoices[0]->episode_id==0))
{{-- this is more likely a journal so fetch journal details --}}
@php
$journal_number = substr($invoices[0]->items_ids, 10); //now remove the substring "Journal - "
$patient_category_id = $invoices[0]->patient_category;
$journal_details = \Streamline\Models\Journal::where('journal_number', $journal_number)->first();
@endphp
@if ($journal_details)
@php
$journal_name_ids_array = explode(",",$journal_details->name_ids);
$index_of_patient_category = array_search($patient_category_id, $journal_name_ids_array);
$journal_descriptions_array = explode(",",$journal_details->descriptions);
$sum_total += $invoices[0]->patient_amount;
@endphp
<tr>
<td>{{ streamline_date($journal_details->journal_date) }}</td>
<td colspan="4">{{ $journal_descriptions_array[$index_of_patient_category] }}</td>
<td>{{ ugandan_shillings($invoices[0]->patient_amount) }}</td>
</tr>
@endif
@else
@foreach($invoices as $item)
<tr>
<td class="text-center">{{ streamline_date($item->transaction_date) }}</td>
<td class="text-center">{{ ($item->episode_id != 0) ? ((get_claim_number($item->episode_id)) ? get_claim_number($item->episode_id) : $item->receipt_number) : "" }}</td>
<td class="text-center">{{ ($item->patient_id != 0) ? get_name($item->patient_id, 'id', 'number', 'patients') : "" }}</td>
<td class="text-center">{{ ($item->patient_id != 0) ? get_full_name($item->patient_id, 'id', 'first_name', 'last_name', 'patients') : "" }}</td>
<td class="text-center">
@php
$sum_total += intval($item->sum);
echo ugandan_shillings(intval($item->sum));
@endphp
</td>
<td class="text-center">
{{ get_clinic_name($item->episode_id) }}
</td>
</tr>
@endforeach
@endif
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td class="text-center"><b>{{ __('invoices.total') }}</b></td>
<td class="text-center">{{ ugandan_shillings($sum_total) }}</td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
@if ($invoice_with_payment_amount_paid > 0)
<div class="col-md-12">
<table class="table">
<tbody>
<tr>
<th style="float: right;">
<strong>Amount paid:</strong>
</th>
<td>
{{ ugandan_shillings_with_decimals($invoice_with_payment_amount_paid) }}
</td>
</tr>
<tr>
<th style="float: right;">
<strong>Balance:</strong>
</th>
<td>
{{ ugandan_shillings_with_decimals($invoice_with_payment_balance) }}
</td>
</tr>
</tbody>
</table>
</div>
@endif
<div class="col-md-12">
<p><strong>{{ __('invoices.served_by') }} : </strong></p><h3>{{ $users_name }}</h3>
<p>{{ __('invoices.sign') }}..................................................................................................................</p>
<div class="clearfix"></div>
<hr>
</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 type="text/javascript">
function printElementContent(elem){
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;
}
$("#printPatientDocButton").click(function(e){
printElementContent('printableContent');
});
</script>
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script>
$('#table').DataTable();
</script>
@endpush