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,129 @@
@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/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">{{ __('invoices.invoices_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') }}"><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">{{ __('invoices.invoices_payments') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['method'=>'post','route'=>'invoices.save_hospital_payments' ]) }}
{{ Form::hidden('is_update', $is_update) }}
<div class="row">
<div class="col-sm-6">
<div class="form-group">
{{ Form::label('supplier',__('invoices.supplier')) }}
{{ Form::text('supplier',get_name($supplier_id, 'id', 'name', 'suppliers'),['class' => 'form-control compulsory','readonly']) }}
</div>
<div class="form-group">
{{ Form::label('payment_for',__('invoices.payment_for')) }}
{{ Form::text('payment_for',get_name($quotation_type, 'id', 'name', 'quotation_types'),['class' => 'form-control compulsory', 'readonly']) }}
</div>
<div class="form-group">
{{ Form::label('generated_on',__('invoices.invoice_generated_on')) }}
{{ Form::text('generated_on',streamline_date($invoice_date),['class' => 'form-control compulsory', 'readonly']) }}
{{ Form::hidden('invoice_date', $invoice_date) }}
</div>
@if($is_update)
{{ Form::hidden('payment_id', $payment_id) }}
<div class="form-group">
{{ Form::label('amount',__('invoices.previous_balance')) }}
{{ Form::number('amount',$total_amount_to_pay,['class' => 'form-control compulsory','id'=>'amount','readonly']) }}
</div>
@else
<div class="form-group">
{{ Form::label('amount',__('invoices.amount')) }}
{{ Form::number('amount',$total_amount_to_pay,['class' => 'form-control compulsory','id'=>'amount','readonly']) }}
</div>
@endif
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('invoice_number',__('invoices.invoice_number')) }}
{{ Form::text('invoice_number',$invoice_number,['class' => 'form-control compulsory', 'readonly']) }}
</div>
<div class="form-group">
{{ Form::label('amount_paid',__('invoices.amount_to_deposit')) }}
{{ Form::number('amount_paid','' ,['class' => 'form-control compulsory', 'required', 'id'=>'amount_paid']) }}
</div>
<div class="form-group">
{{ Form::label('balance',__('invoices.balance')) }}
{{ Form::number('balance', '',['class' => 'form-control compulsory','readonly', 'id'=>'balance']) }}
</div>
<div class="form-group">
{{ Form::label('bank_id', __('invoices.expense_account_details')) }}
{{ Form::select('bank_id', $banks, null, ['class'=>'form-control compulsory', 'required', 'onchange' => 'check_account_balance(this.value)']) }}
</div>
</div>
</div>
<hr>
@if($is_update)
<button class="btn btn-success" id="submit_button" disabled>{{ __('invoices.update_payment') }}</button>
@else
<button class="btn btn-success" id="submit_button" disabled>{{ __('invoices.make_new_payment') }}</button>
@endif
{{ Form::close() }}
</div>
@endsection
@push('scripts')
<!-- Date Picker Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script>
$('#amount_paid').change(function () {
let amount = $('#amount').val();
let bal = amount - this.value;
$('#balance').val(bal);
});
function check_account_balance(account_id) {
$.ajax({
method: 'POST',
url: '/payments/get_account_balance',
data: {'bank_id' : account_id},
success: function(response){
let account_balance = response[0].balance;
let amount_to_pay = parseInt($('#amount_paid').val());
if(isNaN(amount_to_pay) || amount_to_pay > account_balance){
alert('Account balance is not enough to cover payment');
$("#submit_button").attr("disabled", true);
} else {
$("#submit_button").attr("disabled", false);
}
},
error: function (error) {
//
}
});
}
</script>
@endpush
@@ -0,0 +1,134 @@
@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">{{ __('invoices.hospital_received_items') }}</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">{{ __('invoices.hospital_received_items') }}</li>
</ol>
</div>
</div>
@include('flash::message')
<div class="white-box">
{{ Form::open(['method' => 'post', 'route'=>'invoices.generate_hospital_invoices'])}}
<div class="row">
<div class="col-md-3">
{{ Form::label('start_date',__('invoices.start_date')) }}
<div class="input-group">
{{ Form::text('start_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
<div class="col-md-3">
{{ Form::label('end_date',__('invoices.end_date')) }}
<div class="input-group">
{{ Form::text('end_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
<div class="col-md-2">
<br>
{{ Form::button(__('invoices.search'),['type'=>'submit','class'=>'btn btn-primary btn-rounded waves-effect waves-light m-r-10 pull-right']) }}
</div>
</div>
{{ Form::close() }}
</div>
<div class="white-box">
<div class="label label-warning"> {!! isset($display) ? $display : '' !!}</div> <br>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table table-striped table-hover">
<thead>
<tr>
<th>{{ __('invoices.item_type') }}</th>
<th>{{ __('invoices.quantity') }}</th>
<th>{{ __('invoices.cost') }}</th>
<th>{{ __('invoices.supplier') }}</th>
<th>{{ __('invoices.approved_by') }}</th>
<th>{{ __('invoices.received_on') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@if(count($quotations) > 0)
@foreach($quotations as $result)
<tr>
<td>
{{ $quotation_type_options[$result->quotation_type_id] }}
</td>
<td>
@php
$quotation_number = $result->quotation_number;
$results_to_count = DB::select("select drug_id from quotations where quotation_number = {$quotation_number} AND deleted_at IS NULL");
@endphp
{{ count($results_to_count) }} Items
</td>
<td>
@php
$quotation_number = $result->quotation_number;
$total_amount = DB::select("select SUM(total_price) as total from quotations where quotation_number = {$quotation_number} AND deleted_at IS NULL");
@endphp
{{ ugandan_shillings($total_amount[0]->total) }}
</td>
<td>
{{ get_name(get_name($result->quotation_number, "quotation_number", "supplier_id", 'quotations'), "id", "name", "suppliers") }}
</td>
<td>
@php
$user_id = get_name($result->quotation_number, "quotation_number", "approval_user", 'quotations');
@endphp
{{ get_full_name($user_id, "id", "first_name", "last_name", "users") }}
</td>
<td>
{{ streamline_date(get_name($result->quotation_number, "quotation_number", "receive_date", 'quotations')) }}
</td>
<td>
{{ Form::open(['method'=>'post','route'=>'invoices.generate_hospital_invoices_confirm' ]) }}
{{ Form::hidden('quotation_number', $result->quotation_number) }}
<button class="btn btn-info btn-rounded btn-sm btn-success">
<i class="fa fa-info-circle"></i>
<span style="margin-left: 10px;">{{ __('invoices.details') }}</span>
</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
@else
<td colspan="7" class="text-center"><span style="color: red;">{{ __('invoices.no_records_found') }}</span></td>
@endif
</tbody>
</table>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script>
$('#start_date, #end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy',
});
</script>
@endpush
@@ -0,0 +1,92 @@
@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">{{ __('invoices.generate_invoice') }}</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">{{ __('invoices.generate_invoice') }}</li>
</ol>
</div>
</div>
@include('flash::message')
<div class="white-box">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table table-striped table-hover">
<thead>
<tr>
<th>{{ __('invoices.item_name') }}</th>
<th>{{ __('invoices.quantity') }}</th>
<th>{{ __('invoices.bill_per_item') }}</th>
<th>{{ __('invoices.cost') }}</th>
</tr>
</thead>
<tbody>
@php
$total_amount = 0;
@endphp
@foreach($quotations as $result)
<tr>
<td>
@if($result->quotation_type_id == 1)
{{ get_name($result->drug_id, 'id', 'name', 'drugs') }}
@elseif($result->quotation_type_id == 2)
{{ get_name($result->drug_id, 'id', 'name', 'sundries') }}
@elseif($result->quotation_type_id == 3)
{{ get_name($result->drug_id, 'id', 'name', 'dentals') }}
@elseif($result->quotation_type_id == 4)
{{ get_name($result->drug_id, 'id', 'name', 'radiologies') }}
@elseif($result->quotation_type_id == 5)
{{ get_name($result->drug_id, 'id', 'name', 'labs') }}
@endif
</td>
<td>
{{ $result->quantity }}
</td>
<td>
{{ ugandan_shillings($result->bill) }}
</td>
<td>
@php
$total = (int)($result->quantity * $result->bill);
$total_amount += $total;
@endphp
{{ ugandan_shillings($total) }}
</td>
</tr>
@endforeach
<tr>
<td colspan="3">{{ __('invoices.total') }}</td>
<td>{{ ugandan_shillings($total_amount) }}</td>
</tr>
</tbody>
</table>
</div>
<br>
<p><b>{{ __('invoices.approved_by') }}: </b> {{ get_full_name($quotations[0]->approval_user, 'id', 'first_name', 'last_name', 'users') }}</p>
<p><b>{{ __('invoices.received_by') }}: </b> {{ get_full_name($quotations[0]->receive_user, 'id', 'first_name', 'last_name', 'users') }}</p>
<p><b>{{ __('invoices.received_on') }}: </b> {{ streamline_date($quotations[0]->receive_date) }}</p>
<a href="{{ url('/invoices/save_hospital_invoices/' . $quotation_number) }}" class="btn btn-success">{{ __('invoices.generate_invoice') }}</a>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
@endpush
@@ -0,0 +1,121 @@
@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')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('invoices.hospital_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">{{ __('invoices.hospital_invoices') }}</li>
</ol>
</div>
</div>
<br/>
<div class="row">
<div class="panel panel-default col-md-12">
<div id="invoice" class="panel-body panel-primary">
<h2><strong>{{ __('invoices.invoice_payments_trail') }}</strong></h2>
<br/>
<br/>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('invoices.date_paid') }}</th>
<th>{{ __('invoices.staff_in_charge') }}</th>
<th>{{ __('invoices.receipt_number') }}</th>
<th>{{ __('invoices.amount_paid') }}</th>
</tr>
</thead>
@php
$sum_total = 0;
@endphp
<tbody>
@for($i = 0; $i < count($receipt_number_array); $i++)
<tr>
<td>{{ streamline_date($date_paid_array[$i]) }}</td>
<td>{{ get_full_name($staff_incharge_array[$i], 'id', 'first_name', 'last_name', 'users') }}</td>
<td>{{ $receipt_number_array[$i] }}</td>
@php
$sum_total += $amount_paid_array[$i];
@endphp
<td>{{ ugandan_shillings($amount_paid_array[$i]) }}</td>
</tr>
@endfor
</tbody>
<tr>
<td></td>
<td></td>
<td><strong>{{ __('invoices.total') }}</strong></td>
<td>
{{ ugandan_shillings($sum_total) }}
</td>
</tr>
</table>
</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 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 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,125 @@
@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-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('invoices.cashier_receipt') }}</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">{{ __('invoices.receipt') }}</li>
</ol>
</div>
</div>
@include('flash::message')
<div class="row">
<div class="col-md-6 offset-3">
<div class="white-box">
<div class="row" style="float:right;"><button class="btn btn-success glyphicon glyphicon-print" onclick="print_receipt()"> {{ __('invoices.print') }}</button></div>
<div class="row" id="divToPrint">
<div class="col-sm-12" 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>Tel:</b> {{ $hospital_information->phone_number }}</span><br>
<span class="receipt-label"><b>{{ __('invoices.email') }}:</b> {{ $hospital_information->email }}</span><br>
<span class="receipt-label"><b>{{ __('invoices.cashier') }}:</b> {{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</span><br>
<span class="receipt-label"><b>{{ __('invoices.receipt_number') }}:</b> {{ $receipt_number }}</span><br>
</p>
<div>
<table class="table" id="receipt_table">
<thead>
<tr>
<th style="width: 60%; justify-content: center"><b>{{ __('invoices.description') }}</b></th>
<th style="width: 20%"><b>{{ __('invoices.amount') }}</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ __('invoices.total_amount') }}:</td>
<td>{{ ugandan_shillings($total_to_pay) }}</td>
</tr>
<tr>
<td>{{ __('invoices.amount_paid') }}:</td>
<td>{{ ugandan_shillings($amount_paid) }}</td>
</tr>
<tr>
<td>{{ __('invoices.balance') }}:</td>
<td>{{ ugandan_shillings($balance) }}</td>
</tr>
<tr>
<td>{{ __('invoices.reason') }}:</td>
<td>{{ $payment_reason }}</td>
</tr>
<tr>
<td><strong>{{ __('invoices.payment_made_by') }}</strong></td>
<td><strong>{{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</strong></td>
</tr>
</tbody>
</table>
</div>
</div>
<i style="font-size: 0.8em; margin-left: 50%;">&copy; Stre@mline</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,150 @@
@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')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('invoices.View_hospital_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">{{ __('invoices.payments') }}</li>
</ol>
</div>
</div>
@include('flash::message')
<div class="white-box">
<h4><b>{{ __('invoices.new_invoices') }}</b></h4>
<hr>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('invoices.item_type') }}</th>
<th>{{ __('invoices.supplier') }}</th>
<th>{{ __('invoices.date_generated') }}</th>
<th>{{ __('invoices.amount') }}</th>
<th>{{ __('invoices.invoice_number') }}</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@if(count($quotations) > 0)
@foreach($quotations as $item)
<tr>
<td>{{ $quotation_type_options[$item->quotation_type_id] }}</td>
<td>{{ get_name($item->supplier_id, 'id', 'name', 'suppliers') }}</td>
<td>
{{ streamline_date($item->invoice_date) }}
</td>
<td>
@php
$invoice_number = $item->invoice_number;
$total_amount = DB::select("select SUM(total_price) as total from quotations where invoice_number = {$invoice_number} AND deleted_at IS NULL");
@endphp
{{ ugandan_shillings($total_amount[0]->total) }}
</td>
<td>
{{ $item->invoice_number }}
</td>
<td>
<a class="btn btn-success" href="{{ url('/invoices/complete_hospital_payments/' . $item->invoice_number) }}">{{ __('invoices.make_payment') }}</a>
</td>
<td>
<a class="btn btn-success" href="{{ url('/invoices/print_hospital_invoices/' . $item->invoice_number) }}">{{ __('invoices.print_invoice') }}</a>
</td>
<td>
<a class="btn btn-danger" href="{{ url('/invoices/delete_hospital_invoices/' . $item->invoice_number) }}">{{ __('invoices.delete_invoice') }}</a>
</td>
</tr>
@endforeach
@else
<tr>
<td class="text-center text-danger" colspan="8">{{ __('invoices.no_records_found') }}</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
<div class="white-box">
<h4><b>{{ __('invoices.invoices_with_balance') }}</b></h4>
<hr>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('invoices.item_type') }}</th>
<th>{{ __('invoices.supplier') }}</th>
<th>{{ __('invoices.amount_to_pay') }}</th>
<th>{{ __('invoices.amount_paid') }}</th>
<th>{{ __('invoices.balance') }}</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@if(count($quotations_with_balance) > 0)
@foreach($quotations_with_balance as $item)
@php
$item_type = get_name(get_name($item->invoice_number, 'invoice_number', 'quotation_type_id', 'quotations'), 'id', 'name', 'quotation_types');
$supplier = get_name(get_name($item->invoice_number, 'invoice_number', 'supplier_id', 'quotations'), 'id', 'name', 'suppliers');
@endphp
<tr>
<td>{{ $item_type }}</td>
<td>{{ $supplier }}</td>
<td>{{ ugandan_shillings($item->total) }}</td>
<td>{{ ugandan_shillings($item->amount_paid) }}</td>
<td>{{ ugandan_shillings($item->balance) }}</td>
<td>
<a class="btn btn-success" href="{{ url('/invoices/update_hospital_invoice_payment/' . $item->id) }}">Make Payment</a>
</td>
<td>
<a class="btn btn-success" href="{{ url('/invoices/print_hospital_invoices/' . $item->invoice_number) }}">Print Invoice</a>
</td>
<td>
<a class="btn btn-success" href="{{ url('/invoices/hospital_invoices_payment_history/' . $item->id) }}">Payment History</a>
</td>
</tr>
@endforeach
@else
<tr>
<td class="text-center text-danger" colspan="8">{{ __('invoices.no_records_found') }}</td>
</tr>
@endif
</tbody>
</table>
</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/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,182 @@
@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.hospital_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.hospital_invoices') }}</li>
</ol>
</div>
</div>
<br/>
<div class="row">
<div class="col-md-10 offset-1 text-right">
<button class="btn btn-primary" id="printPatientDocButton"> <span><i class="fa fa-print"></i> {{ __('invoices.print') }}</span> </button>
</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">#{{ $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>{{ __('invoices.from') }},</h3>
{!! supplier_address($quotations[0]->supplier_id) !!}
<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">
<br/>
<br/>
<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.item_name') }}</th>
<th class="text-center">{{ __('invoices.quantity') }}</th>
<th class="text-center">{{ __('invoices.bill_per_item') }}</th>
<th class="text-center">{{ __('invoices.cost') }}</th>
</tr>
</thead>
<tbody>
@php
$total_amount = 0;
@endphp
@foreach($quotations as $result)
<tr>
<td class="text-center">
@if($result->quotation_type_id == 1)
{{ get_name($result->drug_id, 'id', 'name', 'drugs') }}
@elseif($result->quotation_type_id == 2)
{{ get_name($result->drug_id, 'id', 'name', 'sundries') }}
@elseif($result->quotation_type_id == 3)
{{ get_name($result->drug_id, 'id', 'name', 'dentals') }}
@elseif($result->quotation_type_id == 4)
{{ get_name($result->drug_id, 'id', 'name', 'radiologies') }}
@elseif($result->quotation_type_id == 5)
{{ get_name($result->drug_id, 'id', 'name', 'labs') }}
@endif
</td>
<td class="text-center">
{{ $result->quantity }}
</td>
<td class="text-center">
{{ ugandan_shillings($result->bill) }}
</td>
<td class="text-center">
@php
$total = (int)($result->quantity * $result->bill);
$total_amount += $total;
@endphp
{{ ugandan_shillings($total) }}
</td>
</tr>
@endforeach
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td class="text-center"><b>{{ __('invoices.total') }}</b></td>
<td class="text-center">{{ ugandan_shillings($total_amount) }}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-md-12">
<p><strong>{{ __('invoices.received_by') }} : </strong></p><h3>{{ $served_by_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
@@ -0,0 +1,113 @@
@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')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('invoices.View_hospital_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">{{ __('invoices.payments') }}</li>
</ol>
</div>
</div>
@include('flash::message')
<div class="white-box">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('invoices.item_type') }}</th>
<th>{{ __('invoices.supplier') }}</th>
<th>{{ __('invoices.amount_to_pay') }}</th>
<th>{{ __('invoices.amount_paid') }}</th>
<th>{{ __('invoices.balance') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@if(count($payments) > 0)
@foreach($payments as $item)
@php
$item_type = get_name(get_name($item->invoice_number, 'invoice_number', 'quotation_type_id', 'quotations'), 'id', 'name', 'quotation_types');
$supplier = get_name(get_name($item->invoice_number, 'invoice_number', 'supplier_id', 'quotations'), 'id', 'name', 'suppliers');
@endphp
<tr>
<td>{{ $item_type }}</td>
<td>{{ $supplier }}</td>
<td>{{ ugandan_shillings($item->total) }}</td>
<td>{{ ugandan_shillings($item->amount_paid) }}</td>
<td>{{ ugandan_shillings($item->balance) }}</td>
<td>
<a class="btn btn-success" href="{{ url('/invoices/print_hospital_invoices/' . $item->invoice_number) }}">Print Invoice</a>
</td>
<td>
<a class="btn btn-success" href="{{ url('/invoices/hospital_invoices_payment_history/' . $item->id) }}">Payment History</a>
</td>
</tr>
@endforeach
@else
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>{{ __('invoices.no_records_found') }}</td>
</tr>
@endif
</tbody>
</table>
</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/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>
$('#uncleared_invoice_table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel',
],
"aoColumnDefs": [{
"aTargets": [2,3],
"defaultContent": "",
}]
});
$('#invoices_with_balance_table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv','excel',
],
"aoColumnDefs": [{
"aTargets": [2,3],
"defaultContent": "",
}]
});
</script>
@endpush