Build modified streamline images

The official image from streamline does not currently work for the arm64
platform. As a temporary measure, the source code and docker build scripts
have been lifted from the official images and are used to build locally.

Some additional modifications are made to reduce overall image size, these
are documented in docker/README.md
This commit is contained in:
2024-03-10 16:17:50 -07:00
parent 2ffc3c408a
commit a424394109
13506 changed files with 1860172 additions and 6 deletions
@@ -0,0 +1,947 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
<style></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">{{ __('point_of_sale.point_of_sale') }}</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> {{ __('point_of_sale.home') }}</a></li>
<li class="active"><i class="fa fa-shopping-cart"></i> {{ __('point_of_sale.point_of_sale') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
{{ Form::open(['route'=>'point_of_sale.confirm_pricing']) }}
<div class="tap_div_to_calculate_bill_total">
<div class="row">
<div class="col-12">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th class="text-center">#</th>
<th class="text-center">{{ __('point_of_sale.first_name') }}</th>
<th class="text-center">{{ __('point_of_sale.last_name') }}</th>
<th class="text-center">{{ __('point_of_sale.patient_category') }}</th>
<th class="text-center">{{ __('point_of_sale.phone_number') }}</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="5"><h5><b>{{ __('point_of_sale.patient_information') }}</b></h5></td>
</tr>
<tr>
<td class="text-center">{{ $patient->number }}</td>
<td class="text-center">{{ $patient->first_name }}</td>
<td class="text-center">{{ $patient->last_name }}</td>
<td class="text-center">{{ get_name($patient->category_id, 'id', 'name', 'patient_categories') }}</td>
<td class="text-center">{{ $patient->phone }}</td>
</tr>
</tbody>
</table>
</div>
</div>
<br/>
@if($pre_ordered_eye_glasses)
<div class="row">
<div class="col-10">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th class="text-center">{{ __('point_of_sale.select') }}</th>
<th class="text-center">{{ __('point_of_sale.eye_glasses') }}</th>
<th class="text-center">{{ __('point_of_sale.quantity') }}</th>
<th class="text-center">{{ __('point_of_sale.unit_cost') }}</th>
<th class="text-center">{{ __('point_of_sale.cost') }}</th>
</tr>
</thead>
<tbody>
@php $pre_order_amount_sum = 0; @endphp
<tr><td colspan='5' style='background-color: #FFE6E6; font-weight: bolder; text-decoration: underline;'>{{ __('point_of_sale.selected') }}</td></tr>
@foreach($pre_ordered_eye_glasses as $pre_order)
<tr id="eye_glass_row{{ $pre_order->id }}" class="eye_glass_remove">
<td>
<input type="checkbox" id="chk" name="eye_glass_item[]" class="eye_glass_check" value="{{ $pre_order->id }}">
</td>
<td>
@if($pre_order->insurance == 1)
<span style='color: green'> {{ $pre_order->name }} </span>
@else
<span style='color: orange'> {{ $pre_order->name }} </span>
@endif
</td>
<td>
<input type='number' name='eye_glass_quantity[]' style="margin-bottom: 0px;" id="pre_order_quantity_{{$pre_order->id}}" class="form-control compulsory"/>
</td>
<td>
@if($pre_order->insurance == 1 && patient_insurance_status($patient_id) == 1)
{{-- {{ ugandan_shillings($pre_order->insured_price) }}--}}
<input type='number' disabled name='pre_order_cost[]' id="pre_order_cost_{{ $pre_order->id }}" class="form-control" value="{{ $pre_order->insured_price }}"/>
@else
{{-- {{ ugandan_shillings($pre_order->non_insured_price) }}--}}
<input type='number' disabled name='pre_order_cost[]' id="pre_order_cost_{{ $pre_order->id }}" class="form-control" value="{{ $pre_order->non_insured_price }}"/>
@endif
</td>
@php
// get insurance status for drug
$eye_glass_insurance_status = get_name($pre_order->id, "id", "insurance", "eye_glasses");
$eye_glass_amount = get_name($pre_order->id, "id", "non_insured_price", "eye_glasses");
// insurance flag
$is_insured = 0;
// check if drug and patient is eligible for insurance
if($eye_glass_insurance_status == 1 && patient_insurance_status($patient_id) == 1){
$insurance_amount = get_name($pre_order->id, "id", "non_insured_price", "eye_glasses") - $eye_glass_amount;
$is_insured = 1;
} else {
$insurance_amount = 0;
}
@endphp
<input type="hidden" name="eye_glass_amount[]" id="eye_glass_amount_{{ $pre_order->id }}">
<input type="hidden" name="eye_glass_insurance_amount[]" value="0">
<input type="hidden" name="eye_glass_insurance_status[]" value="{{ $eye_glass_insurance_status }}">
<input type="hidden" name="eye_glass_order_ids[]" value="{{ $pre_order->id }}">
<td>
<input id="pre_order_cost_sum_{{ $pre_order->id }}" class="" type="number" name="eye_glass_subtotal[]"> .UGx
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="col-2">
<div>
<label for="pre_eye_glasses_grand_total"><b>{{ __('point_of_sale.eye_glass_total') }} :</b></label>
<input id="pre_eye_glasses_grand_total" readonly name="eye_glass_total" class="form-control" type="number"> {{ __('point_of_sale.ugx') }}
</div>
</div>
</div>
@endif
<br/>
@if($pre_ordered_services)
<div class="row">
<div class="col-md-10">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table">
<thead>
<tr>
<th class="text-center">{{ __('service_items.select') }}</th>
<th class="text-center">{{ __('service_items.service') }}</th>
<th class="text-center">{{ __('service_items.quantity') }}</th>
<th class="text-center">{{ __('service_items.unit_cost') }}</th>
<th class="text-center">{{ __('service_items.total_cost') }}</th>
</tr>
</thead>
<tbody>
@php
$service_order_amount_sum = 0;
@endphp
<tr>
<td colspan='5' style='background-color: #FFE6E6; font-weight: bolder; text-decoration: underline;'>{{ __('service_items.selected_service_orders') }}</td>
</tr>
@foreach($pre_ordered_services as $service_order)
<tr>
<td>
<input type="checkbox" name="service_id[]" value="{{ $service_order->id }}" checked>
</td>
<td>
@if($service_order->insurance_coverage == 1)
<span style='color: green'> {{ $service_order->name }} </span>
@else
<span style='color: orange'> {{ $service_order->name }} </span>
@endif
</td>
<td>
<input type='number' name='quantity[]' style="margin-bottom: 0px;" id="service_order_quantity_{{$service_order->id}}" class="form-control compulsory" required />
</td>
<td>
@php
$price_list_id = is_patient_category_attached_to_price_list($patient_id);
@endphp
@if($price_list_id)
{{ ugandan_shillings(get_price_list_category_price($price_list_id, 6, $service_order->id)) }}
<input type='hidden' name='service_order_cost[]' id="service_order_cost_{{ $service_order->id }}" class="form-control" value="{{ get_price_list_category_price($price_list_id, 6, $service_order->id) }}"/>
@else
@php
$service_insurance = $service_order->insurance_coverage;
@endphp
@if($service_insurance == 1 && patient_insurance_status($patient_id) == 1)
{{ ugandan_shillings($service_order->insured_price) }}
<input type='hidden' name='service_order_cost[]' id="service_order_cost_{{ $service_order->id }}" class="form-control" value="{{ $service_order->insured_price }}"/>
@else
{{ ugandan_shillings($service_order->non_insured_price) }}
<input type='hidden' name='service_order_cost[]' id="service_order_cost_{{ $service_order->id }}" class="form-control" value="{{ $service_order->non_insured_price }}"/>
@endif
@endif
</td>
<td>
<div class="input-group">
<input id="service_order_cost_sum_{{ $service_order->id }}" class="form-control" readonly type="number" name="service_item_subtotal[]">
<span class="input-group-addon">{{ __('point_of_sale.ugx') }}</span>
</div>
</td>
</tr>
@endforeach
<!-- display row showing total amount -->
@if(!$pre_ordered_services)
<tr>
<td colspan="5" class='text-center' style='color: maroon; font-weight: bold;'>{{ __('service_items.select_services_above') }}</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
<div class="col-md-2">
<label for="service_grand_total"><b>SERVICES TOTAL :</b></label>
<div class="input-group">
<input id="service_grand_total" class="form-control" readonly type="number" name="service_grand_total">
<span class="input-group-addon">{{ __('point_of_sale.ugx') }}</span>
</div>
</div>
</div>
@endif
@php
$allergy_check = "";
$fre_drop = "";
$results = \DB::select("select * from dosage_frequencies order by name");
foreach ($results as $result){
$fre_drop .= "<option value='" . $result->id . "'>" . $result->name . "</option>";
}
@endphp
@if($manual_patient_prescriptions)
<div class="row">
<div class="col-10">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table" id="manual_prescription_table">
<thead>
<tr>
<th>#</th>
<th>{{ __('point_of_sale.drug') }}</th>
<th style="display: none">{{ __('point_of_sale.dosage') }}</th>
<th style="display: none">{{ __('point_of_sale.frequency') }}</th>
<!-- <th style="width: 20%;">Prompt</th> -->
<th style="display:none;">{{ __('point_of_sale.duration') }}</th>
<th>{{ __('point_of_sale.quantity_to_dispense') }}</th>
<th>{{ __('point_of_sale.price') }}</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2" style="background-color: #FFE6E6; font-weight: bolder; text-decoration: underline;border: 1px solid #ddd;">{{ __('point_of_sale.selected') }}</td>
<td colspan="2" style="border: 1px solid #ddd;"></td>
</tr>
@if($manual_patient_prescriptions)
@if(count($manual_patient_prescriptions) > 0)
@foreach($manual_patient_prescriptions as $prescription)
@php
if(isset($allergies['names'])){
$allergies_explode = explode(",", $allergies['names']);
$allergy_check = \Streamline\Http\Controllers\PrescriptionsController::checkPatientAllergies($allergies_explode, $prescription->drug_category);
}
@endphp
<tr id="my_row{{ $prescription->id }}" class="to_remove">
@php
$is_insured = 0;
@endphp
<!-- # -->
<td style="border: 1px solid #ddd;">
@php
$total_stock = $prescription->pharmacy_stock;
@endphp
@if ($total_stock > 0 && $allergy_check != 'Allergic')
<input type="checkbox" name="drug_id[]" id="chk" class="prescription-check" value="{{ $prescription->id }}" />
@endif
</td>
<!-- drug -->
<td style="border: 1px solid #ddd;">
@php
$insurance_color = ($prescription->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1) ? "green" : "orange";
@endphp
@if ($allergy_check == 'Allergic')
<span class='allergic'>{{ __('point_of_sale.patient_is_allergic') }}</span>&nbsp;&nbsp;
@endif
@if ($total_stock <= 0)
<span class="badge badge-danger">{{ __('point_of_sale.out_of_stock') }}</span>
@endif
<span style="color:{{ $insurance_color }}"> {{ $prescription->name }}</span>
<?php
$pharm_comment = trim($prescription->pharmacy_comment);
if(isset($prescription->reference_areas)){ $reference_array = explode(",", $prescription->reference_areas); } else { $reference_array = []; }
if(isset($prescription->reference_name)){ $reference_name = explode(",", $prescription->reference_name); } else { $reference_name = []; }
for ($x = 0; $x < count($reference_array); $x++) {
?>
<a style="font-weight:normal;" href="{{ $reference_array[$x] }}" target="blank">{{ $reference_name[$x] }}</a>
<br>
<?php
}
if (!empty($pharm_comment)):
echo "<div style='padding: 1px; margin: 6px 1px 0px 1px; font-size: smaller' class='alert alert-info span12 margin-none well'>" . $pharm_comment . "</div>";
endif;
?>
@for ($x = 0; $x < count($reference_array); $x++)
@if(isset($reference_array[$x]) && isset($reference_name[$x]))
<a style="font-weight:normal;" href="{{ $reference_array[$x] }}" target="blank">{{ $reference_name[$x] }}</a><br>
@endif
@endfor
@if (!empty($pharm_comment))
<div style='padding: 1px; margin: 6px 1px 0px 1px; font-size: smaller' class='alert alert-info span12 margin-none well'>{{ $pharm_comment }}</div>
@endif
</td>
<td style="border: 1px solid #ddd;">
<input type='number' style="margin-bottom: 0px;" name='treatment_quantity[]' id="manual_quantity_dispensed{{$prescription->id}}" class="form-control" required />
<span style="margin-bottom: 4px; font-size: x-small; float: right;" id="price_per_unit_drug{{ $prescription->id }}"></span>
<input type="hidden" name="treatment_id"/>
<input type="hidden" name="treatment_item[]" value="{{ $prescription->id }}" />
<!-- <input type="hidden" name="drug_id[]" id="chk" value="{{ $prescription->id }}" />-->
<input type="hidden" name="treatment_amount[]" value="{{ $prescription->non_insured_price }}">
<input type="hidden" name="treatment_insurance_status[]" value="{{ $prescription->insurance_coverage }}">
<input type="hidden" name="treatment_insurance_amount[]" value="{{ $prescription->insured_price }}">
<?php $drug_form = getTableInfo('unit_of_measure','name','id='.$prescription->form_id); ?>
<input type="hidden" id="drug_form{{$prescription->id}}" value="{{$drug_form}}">
@if($prescription->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1)
<input type="hidden" id="selling_price{{$prescription->id}}" value="{{$prescription->insured_price}}">
@else
<input type="hidden" id="selling_price{{$prescription->id}}" value="{{$prescription->non_insured_price}}">
@endif
<input type="hidden" name="pack[]" id="pack{{$prescription->id}}" value="{{$prescription->pack}}">
<input type="hidden" name="strength[]" id="strength{{$prescription->id}}" value="{{$prescription->strength}}">
</td>
<!-- price -->
<td>
<div class="input-group">
<input class="center form-control" id="auto_prescription_price{{$prescription->id}}" style="padding: 2px;border: 1px solid #ddd;" name="treatment_subtotal[]">
<span class="input-group-addon">{{ __('point_of_sale.ugx') }}</span>
</div>
</td>
</tr>
@endforeach
@endif
@else
<tr class="warning"><td class="center" colspan="8" style="border: 1px solid #ddd;">{{ __('point_of_sale.no_drugs_have_been_searched_yet') }}</td></tr>
@endif
</tbody>
</table>
</div>
</div>
<div class="col-2">
<label for="grand_total_column"><b>{{ __('point_of_sale.drugs_total') }} :</b></label>
<div class="input-group">
<input id="grand_total_column" name="treatment_total" class="form-control" readonly type="number">
<span class="input-group-addon">{{ __('point_of_sale.ugx') }}</span>
</div>
</div>
</div>
@endif
@if($automatic_patient_prescriptions)
<div class="row">
<div class="col-10">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table" id="prescription_table">
<thead>
<tr>
<th style="width: 5%;">#</th>
<th style="width: 15%;">{{ __('point_of_sale.drug') }}</th>
<th style="width: 20%;">{{ __('point_of_sale.dosage') }}</th>
<!-- <th style="width: 20%;">Prompt</th> -->
<th style="width: 20%;">{{ __('point_of_sale.duration') }}</th>
<th style="width: 20%;">{{ __('point_of_sale.dispense') }}</th>
<th style="width: 20%;">{{ __('point_of_sale.price') }}</th>
<!-- <th style="width: 10%;">Instruction</th> -->
</tr>
</thead>
<tbody>
<tr>
<td colspan="2" style="background-color: #FFE6E6; font-weight: bolder; text-decoration: underline;border: 1px solid #ddd;">{{ __('point_of_sale.selected') }}</td>
<td colspan="4" style="border: 1px solid #ddd;"></td>
</tr>
@if($automatic_patient_prescriptions)
@if(count($automatic_patient_prescriptions) > 0)
@foreach($automatic_patient_prescriptions as $prescription)
@php
if(isset($allergies['names'])){
$allergies_explode = explode(",", $allergies['names']);
$allergy_check = \Streamline\Http\Controllers\PrescriptionsController::checkPatientAllergies($allergies_explode, $prescription->drug_category);
}
@endphp
<tr id="my_row{{ $prescription->id }}" class="to_remove">
@php
$is_insured = 0;
@endphp
<td style="border: 1px solid #ddd;">
@php
$total_stock = $prescription->pharmacy_stock;
@endphp
@if ($total_stock > 0 && $allergy_check != 'Allergic')
<input type="checkbox" name="drug_id[]" id="chk" class="prescription-check" value="{{ $prescription->id }}" />
@endif
</td>
<td style="border: 1px solid #ddd;">
@php
$insurance_color = ($prescription->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1) ? "green" : "orange";
@endphp
@if ($allergy_check == 'Allergic')
<span class='allergic'>{{ __('point_of_sale.patient_is_allergic') }}</span>&nbsp;&nbsp;
@endif
@if ($total_stock <= 0)
<span class="badge badge-danger">{{ __('point_of_sale.out_of_stock') }}</span>
@endif
<span style="color:{{ $insurance_color }}"> {{ $prescription->name }}</span>
<?php
$pharm_comment = trim($prescription->pharmacy_comment);
if(isset($prescription->reference_areas)){ $reference_array = explode(",", $prescription->reference_areas); } else { $reference_array = []; }
if(isset($prescription->reference_name)){ $reference_name = explode(",", $prescription->reference_name); } else { $reference_name = []; }
for ($x = 0; $x < count($reference_array); $x++) {
?>
<a style="font-weight:normal;" href="{{ $reference_array[$x] }}" target="blank">{{ $reference_name[$x] }}</a>
<br>
<?php
}
if (!empty($pharm_comment)):
echo "<div style='padding: 1px; margin: 6px 1px 0px 1px; font-size: smaller' class='alert alert-info span12 margin-none well'>" . $pharm_comment . "</div>";
endif;
?>
@for ($x = 0; $x < count($reference_array); $x++)
@if(isset($reference_array[$x]) && isset($reference_name[$x]))
<a style="font-weight:normal;" href="{{ $reference_array[$x] }}" target="blank">{{ $reference_name[$x] }}</a><br>
@endif
@endfor
@if (!empty($pharm_comment))
<div style='padding: 1px; margin: 6px 1px 0px 1px; font-size: smaller' class='alert alert-info span12 margin-none well'>{{ $pharm_comment }}</div>
@endif
</td>
<td style="border: 1px solid #ddd;">
<div class="row">
<div class="col-sm-4">
<input type='number' step="0.001" style="margin-bottom: 0px;" name='dose[]' id="dose{{$prescription->id}}" class="form-control" required />
<span style="margin-bottom: 4px; font-size: smaller;">
<?php $drugunit = getTableInfo('drug_units','name','id='.$prescription->unit_id); ?>
{{ $drugunit }}
</span>
</div>
<div class="col-sm-8">
<select class="form-control" name='frequency[]' style="margin-bottom: 0px;" id="frequency{{$prescription->id}}" required>
<option value=''>{{ __('point_of_sale._select') }}</option>
<?php echo $fre_drop; ?>
</select>
<span style="margin-bottom: 4px; font-size: smaller;" id="equiv1{{$prescription->id}}"></span>
</div>
</div>
</td>
<td style="border: 1px solid #ddd;">
<input type='number' style="margin-bottom: 0px;" name='duration[]' id="duration{{$prescription->id}}" class="form-control" placeholder="days" required />
<input type="hidden" name="time[]" value="Days" class="span4" readonly required >
<span style="margin-bottom: 4px; font-size: xx-small; float: right;">{{ __('point_of_sale.duration_in_days') }}</span>
</td>
<td style="border: 1px solid #ddd;">
<input type='number' style="margin-bottom: 0px;" name='treatment_quantity[]' id="quantity_dispensed{{$prescription->id}}" class="form-control" required readonly />
<input type="hidden" name="treatment_item[]" value="{{ $prescription->id }}" />
<!-- <input type="hidden" name="drug_id[]" id="chk" value="{{ $prescription->id }}" />-->
<input type="hidden" name="treatment_amount[]" value="{{ $prescription->non_insured_price }}">
<input type="hidden" name="treatment_insurance_status[]" value="{{ $prescription->insurance_coverage }}">
<input type="hidden" name="treatment_insurance_amount[]" value="{{ $prescription->insured_price }}">
<?php $drug_form = getTableInfo('unit_of_measure','name','id='.$prescription->form_id); ?>
<input type="hidden" id="drug_form{{$prescription->id}}" value="{{$drug_form}}">
@if($prescription->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1)
<input type="hidden" id="selling_price{{$prescription->id}}" value="{{$prescription->insured_price}}">
@else
<input type="hidden" id="selling_price{{$prescription->id}}" value="{{$prescription->non_insured_price}}">
@endif
<input type="hidden" name="pack[]" id="pack{{$prescription->id}}" value="{{$prescription->pack}}">
<input type="hidden" name="strength[]" id="strength{{$prescription->id}}" value="{{$prescription->strength}}">
</td>
<td>
<div class="input-group">
<input class="center" id="auto_prescription_price{{$prescription->id}}" style="padding: 2px;border: 1px solid #ddd;" name="treatment_subtotal[]">
<span class="input-group-addon">{{ __('point_of_sale.ugx') }}</span>
</div>
</td>
<!-- <td style="padding: 2px;border: 1px solid #ddd;">
<textarea name="instructions[]" id="instructions{{$prescription->id}}" class="form-control" rows="3" placeholder="Instructions to the patient .."></textarea>
</td> -->
</tr>
@endforeach
@endif
@else
<tr class="warning"><td class="center" colspan="8" style="border: 1px solid #ddd;">{{ __('point_of_sale.no_drugs_have_searched_yet') }}</td></tr>
@endif
</tbody>
</table>
</div>
</div>
<div class="col-2">
<label for="grand_total_column"><b>{{ __('point_of_sale.drugs_total') }} :</b></label>
<div class="input-group">
<input id="grand_total_column" name="treatment_total" class="form-control" readonly type="number">
<span class="input-group-addon">{{ __('point_of_sale.ugx') }}</span>
</div>
</div>
</div>
@endif
@if($pre_ordered_sundries)
<div class="row">
<div class="col-10">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th class="text-center">{{ __('point_of_sale.select') }}</th>
<th class="text-center">{{ __('point_of_sale.sundry') }}</th>
<th class="text-center">{{ __('point_of_sale.quantity') }}</th>
<th class="text-center">{{ __('point_of_sale.unit_cost') }}</th>
<th class="text-center">{{ __('point_of_sale.total_cost') }}</th>
</tr>
</thead>
<tbody>
@php $pre_order_amount_sum = 0; @endphp
<tr><td colspan='5' style='background-color: #FFE6E6; font-weight: bolder; text-decoration: underline;'>{{ __('point_of_sale.selected_sundries_orders') }}</td></tr>
@foreach($pre_ordered_sundries as $pre_order)
<tr>
<td>
<input type="checkbox" name="pos_sundry_ids[]" value="{{ $pre_order->id }}" checked>
</td>
<td>
@if($pre_order->insurance == 1)
<span style='color: green'> {{ $pre_order->name }} </span>
@else
<span style='color: orange'> {{ $pre_order->name }} </span>
@endif
</td>
@php
$insurance_amount = 0;
// get insurance status for sundry
$sundry_insurance_status = get_name($pre_order->id, "id", "insurance", "sundries");
// insurance flag
$is_insured = 0;
if($sundry_insurance_status == 1 && patient_insurance_status($patient_id) == 1){
$sundry_amount = get_name($pre_order->id, "id", "insured_price", "sundries");
$insurance_amount = get_name($pre_order->id, "id", "non_insured_price", "sundries") - $sundry_amount;
$is_insured = 1;
} else {
$sundry_amount = get_name($pre_order->id, "id", "non_insured_price", "sundries");
}
// }
@endphp
<td>
<input type='number' name='sundry_quantity[]' style="margin-bottom: 0px;" id="pre_order_sundry_quantity_{{$pre_order->id}}" class="form-control compulsory" required />
</td>
<td>
@php $price_list_id = is_patient_category_attached_to_price_list($patient_id); @endphp
@if($price_list_id)
{{ ugandan_shillings(get_price_list_category_price($price_list_id, 5, $pre_order->id)) }}
<input type='hidden' name='pre_order_sundry_cost[]' id="pre_order_sundry_cost_{{ $pre_order->id }}" class="form-control" value="{{ get_price_list_category_price($price_list_id, 5, $pre_order->id) }}"/>
@else
@php $sundry_insurance = $pre_order->insurance; @endphp
@if($sundry_insurance == 1 && patient_insurance_status($patient_id) == 1)
{{ ugandan_shillings($pre_order->insured_price) }}
<input type='hidden' name='pre_order_sundry_cost[]' id="pre_order_sundry_cost_{{ $pre_order->id }}" class="form-control" value="{{ $pre_order->insured_price }}"/>
@else
{{ ugandan_shillings($pre_order->non_insured_price) }}
<input type='hidden' name='pre_order_sundry_cost[]' id="pre_order_sundry_cost_{{ $pre_order->id }}" class="form-control" value="{{ $pre_order->non_insured_price }}"/>
@endif
@endif
</td>
<td>
<div class="input-group">
<input id="pre_order_sundry_cost_sum_{{ $pre_order->id }}" class="form-control" name="sundry_subtotal[]" readonly>
<span class="input-group-addon">{{ __('point_of_sale.ugx') }}</span>
</div>
</td>
{{ Form::hidden('sundry_insurance_status[]', $is_insured) }}
{{ Form::hidden('sundry_insurance_amount[]', $insurance_amount, ['class' => 'insurance_amount']) }}
</tr>
@endforeach
<!-- display row showing total amount -->
</tbody>
</table>
</div>
<div class="col-2">
<label for="pre_grand_sundry_total"><b>{{ __('point_of_sale.sundries_total') }} :</b></label>
<div class="input-group">
<input id="pre_grand_sundry_total" name="sundry_grand_total" class="form-control" readonly type="number">
<span class="input-group-addon">{{ __('point_of_sale.ugx') }}</span>
</div>
</div>
</div>
@endif
<br/>
<div class="row">
<div class="col-md-2 offset-10">
<label for=""><b>BILL TOTAL :</b></label>
<div class="input-group">
<input id="bill_total" class="form-control" name="sundry_subtotal[]" type="number"readonly>
<span class="input-group-addon">{{ __('point_of_sale.ugx') }}</span>
</div>
</div>
</div>
<div class="row mt-5">
<div class="col-md-12">
<input type="button" id="delete_row_button" class="btn btn-success btn-rounded pull-right" value="Confirm Selection" />
<button class="btn btn-success btn-rounded pull-right" style="display: none;" id="approve_sale">{{ __('point_of_sale.approve_and_print_order') }}</button>
</div>
</div>
<input type="hidden" name="patient_id" value="{{ $patient_id }}" />
<input type="hidden" name="episode_id" value="{{ $episode_id }}" />
</div>
{{ Form::close() }}
</div>
@endsection
@push('scripts')
<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 type="text/javascript">
$('.tap_div_to_calculate_bill_total').click(function() {
//e.preventDefault();
let sundry_grand_total = $('#pre_grand_sundry_total').val();
let eye_glass_grand_total = $('#pre_eye_glasses_grand_total').val();
let treatment_grand_total = $('#grand_total_column').val();
let service_grand_total = $('#service_grand_total').val();
let grand_total = parseInt((isNaN(sundry_grand_total) || sundry_grand_total == "") ? 0 :sundry_grand_total) +
parseInt((isNaN(eye_glass_grand_total) || eye_glass_grand_total == "") ? 0 :eye_glass_grand_total) +
parseInt((isNaN(treatment_grand_total) || treatment_grand_total == "") ? 0 :treatment_grand_total) +
parseInt((isNaN(service_grand_total) || service_grand_total == "") ? 0 :service_grand_total);
$('#bill_total').val(grand_total);
});
$("#delete_row_button").click(function (e) {
var atleast_one_drug_selected = $('input:checkbox').is(':checked'); // Atleast one checkbox selected
if (atleast_one_drug_selected) {
// begin checking to ensure there is enough quantity dispensed
let drug_id = $("input[name='drug_id[]']" ).map(function(){
return this.value;
}).get();
let quantity_dispensed = $("input[name='treatment_quantity[]']" ).map(function(){
return this.value;
}).get();
if(drug_id.length > 0){
$.ajax({
url: '/check_dispensed_drugs_quantity',
data: {'drug_id_array[]':drug_id, 'quantity_dispensed_array[]':quantity_dispensed},
success: function(response){
if (response[0] === "1") {
alert(response[1]);
return false;
} else {
$(".to_remove").remove();
$(".prescription-check").attr("disabled", "disabled");
$('#approve_sale').show();
$('#delete_row_button').hide();
/*loop thru the prescription_check row and is checked and get the auto_price*/
/********************************************/
var auto_price_grand_total = 0;
$("[id^=auto_prescription_price]").each(function(){
var unit_price = $(this).val();
var auto_price = isNaN(unit_price) ? 0 : unit_price;
var auto_price_integer = parseInt(auto_price);
auto_price_grand_total += auto_price_integer;
});
$("#grand_total_column").val(auto_price_grand_total);
}
}
});
}else{
$('#approve_sale').show();
$('#delete_row_button').hide();
}
} else {
e.preventDefault();
alert("Please Be Sure To Select Atleast One Item.");
return false;
}
});
$("[id^='manual_dose'],[id^='manual_frequency'],[id^='duration'], [id^='manual_quantity_dispensed']").on("change keyup", function () {
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
var pack = parseFloat($("#pack" + id).val());
var strength = parseFloat($("#strength" + id).val()) || 0;
var dose1 = parseFloat($("#manual_dose" + id).val()) || 0;
var equiv1 = dose1 / strength;
var manual_qty_dispensed = $("#manual_quantity_dispensed" + id).val();
// Adding a prompt dynamically eg 500mg = 2tabs
$("#equiv1" + id).text("( " + equiv1 + " " + $("#drug_form" + id).val() + " )");
var frequency_id = $("#manual_frequency" + id).val() || 0;
$.ajax({
url: '/prescriptions/get_factor/'+frequency_id,
data: {},
success: function(data){
var selling_price = parseInt($("#selling_price" + id).val());
$('#price_per_unit_drug' + id).text(selling_price +'.ugx ' +' per '+ $("#drug_form" + id).val())
var cost = selling_price * manual_qty_dispensed;
if(isNaN(cost)){ cost = 0 }
$("#auto_prescription_price" + id).val(cost);
},
error: function(response){
//
}
});
});
/* on table losing focus */
$("#manual_prescription_table").focusout(function(e) {
var manual_auto_price_grand_total = 0;
$("[id^=auto_prescription_price]").each(function(){
var unit_price = $(this).val();
var auto_price = isNaN(unit_price) ? 0 : unit_price;
var auto_price_integer = parseInt(auto_price);
manual_auto_price_grand_total += auto_price_integer;
});
$("#grand_total_column").val(manual_auto_price_grand_total);
});
$("#instruction_button").click(function () {
$(".instruction_td").show();
$(this).hide();
$("#hide_instruction_button").show();
});
$("#hide_instruction_button").click(function () {
$(".instruction_td").hide();
$(this).hide();
$("#instruction_button").show();
});
/* highlight the checked treatment table row */
$('.prescription-check').click(function(e) {
if($(this).is(':checked')){
$(this).parent().parent().css({'background-color': '#FFFF99'});
$('#my_row' + $(this).val()).addClass('color-tr').removeClass('to_remove');
} else{
$(this).parent().parent().css({'background-color': '#fff'});
$('#my_row' + $(this).val()).removeClass('color-tr').addClass('to_remove');
}
});
$('.eye_glass_check').click(function(e) {
if($(this).is(':checked')){
$(this).parent().parent().css({'background-color': '#FFFF99'});
$('#eye_glass_row' + $(this).val()).addClass('color-tr').removeClass('eye_glass_remove');
} else{
$(this).parent().parent().css({'background-color': '#fff'});
$('#eye_glass_row' + $(this).val()).removeClass('color-tr').addClass('eye_glass_remove');
}
});
$("[id^='dose'],[id^='frequency'],[id^='duration'], [id^='quantity_dispensed']").on("change keyup", function () {
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
var pack = parseFloat($("#pack" + id).val());
var strength = parseFloat($("#strength" + id).val()) || 0;
var dose = parseFloat($("#dose" + id).val()) || 0;
var equiv1 = dose / strength;
// Adding a prompt dynamically eg 500mg = 2tabs
$("#equiv1" + id).text("( " + equiv1 + " " + $("#drug_form" + id).val() + " )");
var equiv_total = dose / strength;
var frequency_id = $("#frequency" + id).val() || 0;
var duration_days = parseInt($("#duration" + id).val()) || 0;
$.ajax({
url: '/prescriptions/get_factor/'+frequency_id,
data: {},
success: function(data){
var factor = parseFloat(data);
var quantity = parseFloat(equiv_total * factor * duration_days) || 0;
var required = quantity / pack;
var dispense = Math.ceil(required); // @TODO Roundup this to the nearest whole number
$("#quantity_dispensed" + id).val(dispense);
var selling_price = parseInt($("#selling_price" + id).val());
var cost = dispense * selling_price;
if(isNaN(cost)){ cost = 0 }
$("#auto_prescription_price" + id).val(cost);
},
error: function(response){
//
}
});
});
/* on table losing focus */
$("#prescription_table").focusout(function(e) {
var auto_price_grand_total = 0;
$("[id^=auto_prescription_price]").each(function(){
var auto_price = $(this).val();
var auto_price_integer = parseInt(auto_price);
auto_price_grand_total += auto_price_integer;
});
$("#grand_total_column").val(auto_price_grand_total);
});
$("[id^='pre_order_sundry_quantity_']").on("change", function () {
let pre_auto_price_grand_total = 0;
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
var quantity = parseFloat($("#pre_order_sundry_quantity_" + id).val());
var cost = parseFloat($("#pre_order_sundry_cost_" + id).val()) || 0;
var total_cost = quantity * cost;
$("#pre_order_sundry_cost_sum_" + id).val(total_cost);
$("[id^=pre_order_sundry_cost_sum_]").each(function(){
var auto_price = $(this).val();
// if (auto_price.slice(-3) == 'UGx') {
var without_ugx = auto_price;
var auto_price_integer = parseInt(without_ugx);
pre_auto_price_grand_total += auto_price_integer;
// }
});
$("#pre_grand_sundry_total").val(pre_auto_price_grand_total);
});
//eye glasses
$("[id^='order_quantity_']").on("change", function () {
let auto_price_grand_total = 0;
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
var quantity = parseFloat($("#order_quantity_" + id).val());
var cost = parseFloat($("#order_cost_" + id).val()) || 0;
var total_cost = quantity * cost;
$("#order_cost_sum_" + id).text(total_cost + " UGx");
$("[id^=order_cost_sum_]").each(function(){
var auto_price = $(this).text();
if (auto_price.slice(-3) == 'UGx') { //if the auto_price column is a UGx
var without_ugx = auto_price.slice(0,-3); /*remove 'UGx' e.g turn 2300UGx to 2300*/
var auto_price_integer = parseInt(without_ugx);
auto_price_grand_total += auto_price_integer;
}
});
$("#order_grand_total").text(auto_price_grand_total + " UGx");
});
$("[id^='pre_order_quantity_']").on("change", function () {
let pre_auto_price_grand_total = 0;
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
var quantity = parseFloat($("#pre_order_quantity_" + id).val());
var cost = parseFloat($("#pre_order_cost_" + id).val()) || 0;
var total_cost = quantity * cost;
$("#pre_order_cost_sum_" + id).val(total_cost);
$("[id^=pre_order_cost_sum_]").each(function(){
var auto_price = $(this).val();
var auto_price_integer = parseInt(auto_price);
pre_auto_price_grand_total += auto_price_integer;
});
$("#pre_eye_glasses_grand_total").val(pre_auto_price_grand_total);
});
$("[id^='pre_order_cost_sum_']").on("change", function () {
let pre_auto_price_grand_total = 0;
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
var quantity = parseFloat($("#pre_order_quantity_" + id).val());
var cost = this.value;
var total_cost = quantity * cost;
$("#pre_order_cost_sum_" + id).val(total_cost);
$("#eye_glass_amount_"+ id).val(cost);
$("[id^=pre_order_cost_sum_]").each(function(){
var auto_price = $(this).val();
var auto_price_integer = parseInt(auto_price);
pre_auto_price_grand_total += auto_price_integer;
});
$("#pre_eye_glasses_grand_total").val(pre_auto_price_grand_total);
});
$("[id^='service_order_quantity_']").on("change", function () {
let service_auto_price_grand_total = 0;
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
var quantity = parseFloat($("#service_order_quantity_" + id).val());
var cost = parseFloat($("#service_order_cost_" + id).val()) || 0;
var total_cost = quantity * cost;
$("#service_order_cost_sum_" + id).val(total_cost);
$("[id^=service_order_cost_sum_]").each(function(){
var auto_price = $(this).val();
var without_ugx = isNaN(auto_price) ? 0 : auto_price;
var auto_price_integer = parseInt(without_ugx);
service_auto_price_grand_total += isNaN(auto_price_integer) ? 0 : auto_price_integer;
});
$("#service_grand_total").val(service_auto_price_grand_total);
});
</script>
@endpush
@@ -0,0 +1,173 @@
@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">{{ __('point_of_sale.point_of_sale') }}</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> {{ __('point_of_sale.home') }}</a></li>
<li class="active"><i class="fa fa-shopping-cart"></i> {{ __('point_of_sale.point_of_sale') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['method'=>'post','route' => 'point_of_sale.index']) }}
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label>{{ __('pharmacy.select_date') }}:</label>
<select class="form-control compulsory required" name="search_date_by" id="search_date_by" required>
<option value="today">{{ __('pharmacy.today') }}</option>
<option value="yesterday">{{ __('pharmacy.yesterday') }}</option>
<option value="custom_date">{{ __('pharmacy.custom_date') }}</option>
<option value="custom_date_range">{{ __('pharmacy.date_range') }}</option>
</select>
</div>
</div>
<div class="col-md-2" id="start_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('pharmacy.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-2" id="end_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('pharmacy.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 25px;">
{{ Form::submit(__('investigations.search'), ['class'=>'btn btn-success pull-right']) }}
</div>
</div>
</div>
{{ Form::close() }}
</div>
<div class="white-box">
@if(session()->get("print_pos_pdf") == 1)
{{ Form::hidden('print_pos_pdf', 1, ['id' => 'print_pos_pdf']) }}
@endif
@include('flash::message')
<h4><label class="label label-info">{{ $search_text }}</label></h4>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table table-striped" style="width:100%">
<thead>
<tr>
<th>{{ __('point_of_sale.patient_names') }}</th>
<th>{{ __('point_of_sale.items') }}</th>
<th>{{ __('point_of_sale.record_created_by') }}</th>
<th>{{ __('point_of_sale.record_created_on') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($records as $record)
<tr>
<td>{{ $record->first_name . ' ' . $record->last_name }} ({{ $record->number }})</td>
<td>
<ul>
@if(!is_null($record->treatments))
<li>{{ __('point_of_sale.treatments') }}</li>
@endif
@if(!is_null($record->eye_glasses))
<li>{{ __('point_of_sale.eye_glasses') }}</li>
@endif
@if(!is_null($record->sundries))
<li>{{ __('point_of_sale.sundries') }}</li>
@endif
@if(!is_null($record->services))
<li>{{ __('point_of_sale.services') }}</li>
@endif
</ul>
</td>
<td>{{ get_full_name($record->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
<td>{{ streamline_date_time($record->created_at) }}</td>
<td><a href="/point_of_sale/print/{{ $record->id }}" class="btn btn-success btn-sm">{{ __('point_of_sale.print') }}</a></td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
@push('scripts')
<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>
// check if the patient has paid and a pdf print is required
if ($('#print_pos_pdf').val() == 1) {
var win = window.open('/point_of_sale/print_pos_pdf', '_blank');
if (win) {
win.focus();
} else {
alert('Please allow popups for Stre@mline');
}
}
$('#search_date_by').change(function() {
if($(this).val() === "custom_date"){
$("#end_date_div").hide();
$("#start_date_div").show();
} else if($(this).val() === "custom_date_range") {
$("#start_date_div").show();
$("#end_date_div").show();
} else {
$("#end_date_div").hide();
$("#start_date_div").hide();
}
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 100,
buttons: ['copy', 'csv', 'excel', 'pdf', 'print']
});
</script>
@endpush
@@ -0,0 +1,632 @@
@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" />
<style>
.modal {
text-align: center;
}
@media screen and (min-width: 768px) {
.modal:before {
display: inline-block;
vertical-align: middle;
content: " ";
height: 100%;
}
}
.modal-dialog {
display: inline-block;
text-align: center;
vertical-align: middle;
width: 500px;
}
</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">{{ __('point_of_sale.point_of_sale') }}</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> {{ __('point_of_sale.home') }}</a></li>
<li class="active"><i class="fa fa-shopping-cart"></i> {{ __('point_of_sale.point_of_sale') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-md-12">
@include('flash::message')
<div class="panel">
<div class="panel-body">
{{ Form::open(['route'=>'point_of_sale.confirm_items']) }}
{{ Form::hidden('patient_id', '', ['class' => 'patient_id', 'id' => 'patient_id']) }}
<div class="row">
<div class="col-md-12">
<h4>Patient / Client</h4>
<div class="row">
<div class="col-md-6">
<div class="input-group">
<span class="input-group-addon bg-info">
<input id="new_patient" type="checkbox">
</span>
<label for="new_patient" type="text" class="form-control" aria-label="Text input with checkbox">{{ __('point_of_sale.new_patient') }}</label>
</div>
</div>
<div class="col-md-6">
<div class="input-group">
<span class="input-group-addon bg-info">
<input id="existing_patient" type="checkbox">
</span>
<label for="existing_patient" type="text" class="form-control" aria-label="Text input with checkbox">{{ __('point_of_sale.existing_patient') }}</label>
</div>
</div>
<div class="col-md-12">
<div id="new_patient_div" class="mt-5" style="display: none;">
<h4>Patient / Client Information.</h4>
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label for="">First Name</label>
<input class="form-control compulsory" id="first_name" name="first_name" placeholder="First Name">
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label for="">Last Name</label>
<input class="form-control compulsory" id="last_name" name="last_name" placeholder="Last Name">
</div>
</div>
<div class="col-md-2">
<div class="form-group">
{{ Form::label('gender',__('patients.gender')) }}
<br>
{{ Form::radio('gender', 1, false) }} {{ __('patients.male') }} &nbsp;&nbsp;
{{ Form::radio('gender', 2, false) }} {{ __('patients.female') }}
</div>
</div>
<div class="col-md-2">
<div class="form-group">
{{ Form::label('date_of_birth',__('patients.date_of_birth')) }}
<div class="input-group">
{{ Form::text('date_of_birth','',['class' => 'form-control compulsory','readonly','id'=>'date_of_birth']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
<div class="help-block with-errors"></div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
{{ Form::label('age',__('patients.years')) }}
{{ Form::number('age_in_years','',['class' => 'form-control compulsory','id'=>'age_in_years','min'=>'0']) }}
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
{{ Form::label('age',__('patients.months')) }}
{{ Form::number('age_in_months','',['class' => 'form-control','id'=>'age_in_months','readonly','min'=>'0']) }}
</div>
</div>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label for="">Phone Number</label>
<input class="form-control compulsory" id="phone_number" data-mask="0799 999 999" name="phone_number" placeholder="Phone Number">
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label for="">Referral Hospital</label>
<select class="form-control" id="referral_hospital" name="referral_hospital">
<option value="">{{ __('point_of_sale._select') }}</option>
@foreach($referral_hospitals as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
</select>
<a class="pull-right label label-success" style="font-size: x-small; margin-top: 10px; color: white;"
data-toggle="modal" data-target="#referralsmodal" >Add New</a>
<div class="modal fade" id="referralsmodal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="exampleModalLabel1">Add New Referral</h4>
</div>
<div class="modal-body">
{{ Form::text('referral_name', '', ['class' => 'form-control', 'id' => 'referral_name', 'placeholder' => 'Referral Name']) }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('point_of_sale.cancel') }}</button>
<a class="btn btn-primary" onclick="submitReferral()">Save Referral</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="existing_patient_div" class="mt-5" style="display: none;">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<select class="patient_full_name form-control" style="width:100%;" name="patient_full_name" id="patient_full_name"></select>
</div>
</div>
<div class="col-md-6 text-left" id="patient_info" style="display: none;"></div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12 mt-5">
<h4>{{ __('point_of_sale.select_items') }}</h4>
<div class="row">
<div class="col-md-2">
<div class="input-group">
<span class="input-group-addon bg-success">
<input id="manual_drugs" type="checkbox">
</span>
<label for="manual_drugs" type="text" class="label label-success form-control" aria-label="Text input with checkbox">{{ __('point_of_sale.drugs_with_quantity') }}</label>
</div>
</div>
<div class="col-md-2">
<div class="input-group">
<span class="input-group-addon bg-warning">
<input id="automatic_drugs" type="checkbox">
</span>
<label for="automatic_drugs" type="text" class="label label-success form-control" aria-label="Text input with checkbox">{{ __('point_of_sale.drugs_with_prescription') }}</label>
</div>
</div>
<div class="col-md-2">
<div class="input-group">
<span class="input-group-addon bg-primary">
<input id="eye_glasses" type="checkbox">
</span>
<label for="eye_glasses" type="text" class="label label-success form-control" aria-label="Text input with checkbox">{{ __('point_of_sale.eye_glasses') }}</label>
</div>
</div>
<div class="col-md-2">
<div class="input-group">
<span class="input-group-addon bg-danger">
<input id="sundries" type="checkbox">
</span>
<label for="sundries" type="text" class="label label-success form-control" aria-label="Text input with checkbox">{{ __('point_of_sale.sundries') }}</label>
</div>
</div>
<div class="col-md-2">
<div class="input-group">
<span class="input-group-addon bg-info">
<input id="services" type="checkbox">
</span>
<label for="services" type="text" class="label label-success form-control" aria-label="Text input with checkbox">Services</label>
</div>
</div>
<div class="col-md-2">
<div class="input-group">
<span class="input-group-addon bg-danger">
<input id="all" type="checkbox">
</span>
<label for="all" type="text" class="label label-success form-control" aria-label="Text input with checkbox">{{ __('point_of_sale.all') }}</label>
</div>
</div>
</div>
<br/>
<div class="row" >
<div class="col-md-12" id="items" style="display: none">
<h4> {{ __('point_of_sale.items') }}</h4>
<div id="manual_drugs_div" style="display: none;">
<h4>{{ __('point_of_sale.drugs') }}</h4>
<div class="row">
<div class="col-md-12">
<input type="hidden" name="manual_drug_select" id="manual_drug_select">
<select class="form-control select" id="man_select_drugs" name="selected_drugs[]" multiple="multiple" style="width: 100%;">
<option value="">{{ __('point_of_sale._select') }}</option>
@foreach($drugs as $drug)
<option value="{{ $drug->id }}">{{ $drug->name }}</option>
@endforeach
</select>
</div>
</div>
</div>
<div id="automatic_drugs_div" style="display: none;">
<h4>Drugs</h4>
<div class="row">
<div class="col-md-12">
<input type="hidden" name="automatic_drug_select" id="automatic_drug_select">
<select class="form-control select" id="auto_select_drugs" name="selected_drugs[]" multiple="multiple" style="width: 100%;">
<option value="">{{ __('point_of_sale._select') }}</option>
@foreach($drugs as $drug)
<option value="{{ $drug->id }}">{{ $drug->name }}</option>
@endforeach
</select>
</div>
</div>
</div>
<div id="eye_glasses_div" style="display: none;">
<h4>{{ __('point_of_sale.eye_glasses') }}</h4>
<div class="row">
<div class="col-md-12">
<select class="form-control select" id="select_eye_glasses" name="selected_eye_glasses[]" multiple="multiple" style="width: 100%;">
<option value="">{{ __('point_of_sale._select') }}</option>
@foreach($eye_glasses as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
</select>
</div>
</div>
</div>
<div id="sundries_div" style="display: none;">
<h4>{{ __('point_of_sale.sundries') }}</h4>
<div class="row">
<div class="col-md-12">
<select class="form-control select" id="select_sundries" name="selected_sundries[]" multiple="multiple" style="width: 100%;">
<option value="">{{ __('point_of_sale.select') }}</option>
@foreach($sundries as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
</select>
</div>
</div>
</div>
<div id="services_div" style="display: none;">
<h4>Services</h4>
<div class="row">
<div class="col-md-12">
<select class="form-control select" id="select_services" name="selected_services[]" multiple="multiple" style="width: 100%;">
<option value="">{{ __('point_of_sale.select') }}</option>
@foreach($services as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
</select>
</div>
</div>
</div>
</div>
</div>
<br/>
<div id="proceed-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<i style="color: red" class="fa fa-3x fa-question-circle"></i> <h4 class="modal-title">Do you wish proceed ?</h4>
</div>
<div class="modal-footer" style="background-color: lightgrey">
<button type="button" class="btn btn-default btn-rounded waves-effect" data-dismiss="modal">{{ __('point_of_sale.close') }}</button>
<button class="btn btn-success waves-effect btn-rounded waves-light" >{{ __('point_of_sale.proceed') }}</button>
</div>
</div>
</div>
</div>
</div>
</div>
{{ Form::close() }}
<div class="row" id="confirm_info">
<br/>
<div class="col-md-12">
<button class="btn btn-success btn-rounded pull-right" onclick="confirm_info()">{{ __('point_of_sale.confirm_selection') }}</button>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<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/js/mask.js') }}"></script>
<script type="text/javascript">
$('#date_of_birth').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy',
endDate: new Date()
});
$('#age_in_years').on('change', function () {
let years = parseInt($(this).val());
let possibleBirthday = new Date();
if (!isNaN(years)) {
possibleBirthday.setMonth(possibleBirthday.getMonth() - (years * 12));
$('#date_of_birth').val(format_date(possibleBirthday));
} else {
alert("<?php echo __('patients.valid_number_years')?>")
}
});
$("#date_of_birth").on('change', function () {
var today = new Date();
var birthDate = $(this).val();
var temp_date = birthDate.split("/");
birthDate = new Date(temp_date[2], (temp_date[1] - 1), temp_date[0]);
//calculate years
var age = today.getFullYear() - birthDate.getFullYear();
age = parseInt(age);
var m = today.getMonth() - birthDate.getMonth();
if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
age--;
}
//calculate months
var monthBirth = birthDate.getMonth() + 1;
var monthToday = today.getMonth() + 1;
if (monthToday > monthBirth) {
var months = monthToday - monthBirth;
} else if (monthToday == monthBirth) {
var months = 0;
} else if (monthToday < monthBirth) {
var months = monthToday - monthBirth;
months = months + 12;
}
if (months < 10) {
months = '0' + months
}
//set the values
$('#age_in_years').val(age);
$('#age_in_months').val(months);
});
$('.patient_full_name').change(function() {
let id = $('#patient_full_name').val();
$('#patient_id').val(id);
$.ajax({
method: 'GET',
url: "/patients/update_patient_info/" + id,
success: function(response){
$('#patient_info').html(response).show();
},
error: function (error) {
console.log(error);
}
});
}).select2({
placeholder: "<?php echo "Search by patient name or 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 + ") " + item.phone,
id: item.id
}
})
};
},
cache: true
}
});
function confirm_info() {
var new_patient_checkbox = $('#new_patient:checkbox:checked').length ;
var existing_patient_checkbox = $('#existing_patient:checkbox:checked').length;
var man_drugs = $('#man_select_drugs').val();
var auto_drugs = $('#auto_select_drugs').val();
var sundries = $('#select_sundries').val();
var services = $('#select_services').val();
var eye_glasses = $('#select_eye_glasses').val();
if(new_patient_checkbox != 0 || existing_patient_checkbox != 0){
if(auto_drugs != null || man_drugs != null || sundries != null || eye_glasses != null || services != null){
if ((is_new_patient && $('#first_name').val() != '' && $('#last_name').val() != '') ||
(!is_new_patient && +$('#patient_id').val() != NaN)) {
$('#confirm_info').hide();
$('#proceed-modal').modal('show');
} else {
alert("Please Be Sure to Enter The Patient's Details Or Select A Patient.");
}
}else{
alert('Please Be Sure to Select An Item.');
}
}else{
alert('Please Be Sure to Select A Patient Or Register A New One.');
}
}
$('.sundries').select2({
placeholder: "Select sundry"
});
$('.eye_glasses').select2({
placeholder: "Select eye glasses"
});
function submitReferral(){
var name = $("#referral_name").val();
$.ajax({
method: 'POST',
url: '/triage/add_referral',
data: {'name' : name},
success: function(response){
if(!isNaN(response)){
//response = last inserted id
$('#referral_hospital').append($('<option>', {
value: response,
text: name
}));
$('#referral_hospital').val(response);//preselect the newly added referral
$('#referralsmodal').modal('hide'); //manually hide the modal
} else {
alert("Adding referral failed");
}
},
error: function(jqXHR, textStatus, errorThrown) {
alert(JSON.stringify(jqXHR));
}
});
}
// searchable select on input fields
$('.select').select2();
let is_new_patient = false;
// get existing patient form.
$("#existing_patient").change(function() {
if(this.checked) {
is_new_patient = false;
$('#new_patient_div').hide();
$('#existing_patient_div').show();
$('#new_patient').prop('checked', false);
}
});
// get new patient form.
$("#new_patient").change(function() {
if(this.checked) {
is_new_patient = true;
$('#new_patient_div').show();
$('#existing_patient_div').hide();
$('#existing_patient').prop('checked', false);
}
});
// get manual drugs form.
$("#manual_drugs").change(function() {
if(this.checked) {
$('#items').show();
$('#manual_drugs_div').show();
$('#automatic_drugs_div').hide();
$('#eye_glasses_div').hide();
$('#sundries_div').hide();
$('#services_div').hide();
$('#automatic_drugs').prop('checked', false);
$('#sundries').prop('checked', false);
$('#eye_glasses').prop('checked', false);
$('#all').prop('checked', false);
$('#manual_drug_select').val(1);
$('#automatic_drug_select').val(0);
}
});
// get automatic drugs form.
$("#automatic_drugs").change(function() {
if(this.checked) {
$('#items').show();
$('#automatic_drugs_div').show();
$('#manual_drugs_div').hide();
$('#eye_glasses_div').hide();
$('#sundries_div').hide();
$('#services_div').hide();
$('#manual_drugs').prop('checked', false);
$('#sundries').prop('checked', false);
$('#eye_glasses').prop('checked', false);
$('#all').prop('checked', false);
$('#manual_drug_select').val(0);
$('#automatic_drug_select').val(1);
}
});
// get eyeglasses form.
$("#eye_glasses").change(function() {
if(this.checked) {
$('#items').show();
$('#eye_glasses_div').show();
$('#manual_drugs_div').hide();
$('#automatic_drugs_div').hide();
$('#drugs_div').hide();
$('#sundries_div').hide();
$('#services_div').hide();
$('#manual_drugs').prop('checked', false);
$('#automatic_drugs').prop('checked', false);
$('#sundries').prop('checked', false);
$('#all').prop('checked', false);
$('#drugs').prop('checked', false);
}
});
// get sundries form.
$("#sundries").change(function() {
if(this.checked) {
$('#items').show();
$('#sundries_div').show();
$('#eye_glasses_div').hide();
$('#manual_drugs_div').hide();
$('#automatic_drugs_div').hide();
$('#drugs_div').hide();
$('#services_div').hide();
$('#manual_drugs').prop('checked', false);
$('#automatic_drugs').prop('checked', false);
$('#all').prop('checked', false);
$('#drugs').prop('checked', false);
$('#eye_glasses').prop('checked', false);
}
});
// get services form.
$("#services").change(function() {
if(this.checked) {
$('#items').show();
$('#services_div').show();
$('#sundries_div').hide();
$('#eye_glasses_div').hide();
$('#manual_drugs_div').hide();
$('#automatic_drugs_div').hide();
$('#drugs_div').hide();
$('#manual_drugs').prop('checked', false);
$('#automatic_drugs').prop('checked', false);
$('#all').prop('checked', false);
$('#drugs').prop('checked', false);
$('#eye_glasses').prop('checked', false);
}
});
// get all item forms.
$("#all").change(function() {
if(this.checked) {
$('#items').show();
$('#eye_glasses_div').show();
$('#sundries_div').show();
$('#manual_drugs_div').show();
$('#services_div').show();
$('#automatic_drugs_div').hide();
$('#manual_drugs').prop('checked', false);
$('#automatic_drugs').prop('checked', false);
$('#sundries').prop('checked', false);
$('#eye_glasses').prop('checked', false);
$('#drugs').prop('checked', false);
$('#manual_drug_select').val(1);
$('#automatic_drug_select').val(0);
}
});
</script>
@endpush
@@ -0,0 +1,175 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'Patient Receipt - Stre@mline') }}</title>
<!-- Bootstrap Core CSS -->
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<style>
body{
font-size: 0.8em;
}
/*thead, tfoot { display: table-row-group }*/
thead {
display: table-header-group;
}
tfoot {
display: table-row-group;
}
tr {
page-break-before: always;
page-break-after: always;
page-break-inside: avoid;
}
</style>
</head>
<body>
<div class="container-fluid">
@include('layouts.header_pdf_print')
<table class="table table-bordered">
<tr>
<td><b>{{ __('patient_finance.patient_names') }}</b></td>
<td>{{ $patient->first_name }} {{ $patient->last_name }}</td>
<td><b>{{ __('patient_finance.patient_number') }}</b></td>
<td>{{ $patient->number }}</td>
<td><b>{{ __('patient_finance.patient_category') }}</b></td>
<td>{{ get_name($patient->category_id, "id", "name", "patient_categories") }}</td>
</tr>
<!-- <tr>
<td><b>{{ __('point_of_sale.record_date') }}</b></td>
<td colspan="2">{{ streamline_date_time_short($receipt_date) }}</td>
<td><b>{{ __('point_of_sale.print_date') }}</b></td>
<td colspan="2">{{ streamline_date_time_short($receipt_reprint_date) }}</td>
</tr>-->
</table>
<table class="table table-bordered">
<thead>
<th style="width: 60%"><b>{{ __('point_of_sale.description') }}</b></th>
<th style="width: 20%"><b>{{ __('point_of_sale.quantity') }}</b></th>
<th style="width: 20%"><b>{{ __('point_of_sale.price') }}</b></th>
</thead>
<tbody>
@php $total_to_pay = 0; @endphp
@if(isset($service_ids_array) && count($service_ids_array) > 0)
<tr>
<td colspan="3" class="text-center">Services</td>
</tr>
@for($i = 0; $i < count($service_ids_array); $i++)
<tr>
<td>{{ get_name($service_ids_array[$i], "id", "name", "services") }}</td>
<td>{{ $service_quantity_array[$i] }}</td>
<td>{{ ugandan_shillings($service_prices_array[$i]) }}</td>
</tr>
@php $total_to_pay += $service_prices_array[$i]; @endphp
@endfor
@endif
@if(isset($eye_glasses_ids_array) && count($eye_glasses_ids_array) > 0)
<tr>
<td colspan="3" class="text-center">Eye Glasses</td>
</tr>
@for($i = 0; $i < count($eye_glasses_ids_array); $i++)
<tr>
<td>{{ get_name($eye_glasses_ids_array[$i], "id", "name", "eye_glasses") }}</td>
<td>{{ $eye_glasses_quantity_array[$i] }}</td>
<td>{{ ugandan_shillings($eye_glasses_prices_array[$i] * $eye_glasses_quantity_array[$i]) }}</td>
</tr>
@php $total_to_pay += $eye_glasses_prices_array[$i] * $eye_glasses_quantity_array[$i]; @endphp
@endfor
@endif
@if(isset($procedure_ids_array) && count($procedure_ids_array) > 0)
<tr>
<td colspan="3" class="text-center">Procedures</td>
</tr>
@for($i = 0; $i < count($procedure_ids_array); $i++)
<tr>
<td>{{ get_name($procedure_ids_array[$i], "id", "name", "procedures") }}</td>
<td>N/A</td>
<td>{{ ugandan_shillings($procedure_amounts_array[$i]) }}</td>
</tr>
@php $total_to_pay += $procedure_amounts_array[$i]; @endphp
@endfor
@endif
@if(isset($investigation_ids_array) && count($investigation_ids_array) > 0)
<tr>
<td colspan="3" class="text-center">Investigations</td>
</tr>
@for($i = 0; $i < count($investigation_ids_array); $i++)
<tr>
<td>{{ get_name($investigation_ids_array[$i], "id", "name", "investigations") }}</td>
<td>N/A</td>
<td>{{ ugandan_shillings($investigation_amounts_array[$i]) }}</td>
</tr>
@php $total_to_pay += $investigation_amounts_array[$i]; @endphp
@endfor
@endif
@if(isset($treatment_item) && count($treatment_item) > 0)
<tr>
<td colspan="3" class="text-center">Treatments</td>
</tr>
@for($i = 0; $i < count($treatment_item); $i++)
<tr>
<td>{{ get_name($treatment_item[$i], "id", "name", "drugs") }}</td>
<td>{{ $treatment_quantity[$i] }}</td>
<td>{{ ugandan_shillings($treatment_subtotal[$i]) }}</td>
</tr>
@php $total_to_pay += $treatment_subtotal[$i]; @endphp
@endfor
@endif
@if(isset($sundry_item) && count($sundry_item) > 0)
<tr>
<td colspan="3" class="text-center">Sundries</td>
</tr>
@for($i = 0; $i < count($sundry_item); $i++)
<tr>
<td>{{ get_name($sundry_item[$i], "id", "name", "sundries") }}</td>
<td>{{ $sundry_quantity[$i] }}</td>
<td>{{ ugandan_shillings($sundry_subtotal[$i]) }}</td>
</tr>
@php $total_to_pay += $sundry_subtotal[$i]; @endphp
@endfor
@endif
<tr>
<td colspan="3"></td>
</tr>
<tr>
<td colspan="2"><b>{{ __('point_of_sale.total_to_pay') }}</b></td>
<td><b>{{ ugandan_shillings($total_to_pay) }}</b></td>
</tr>
</tbody>
</table>
<div class="row">
<div class="col">
<i style="font-size: 0.8em; float: left">&copy; {{ date('Y') }} Stre@mline</i>
</div>
<div class="col">
<i style="float: right">{{ __('patient_finance.printed_on') }} {{ date(" d M Y h:ia") }} {{ __('patient_finance.by') }} {{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</i>
</div>
</div>
</div>
</body>
</html>
@@ -0,0 +1,205 @@
@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>{{ __('point_of_sale.patient_order_request') }}</h4>
</div>
<div class="col-md-5">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('point_of_sale.point_of_sale') }}</a></li>
<li class="active">{{ __('point_of_sale.point_of_sale') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="white-box">
<div class="row" style="float:right;"><button class="btn btn-success glyphicon glyphicon-print" onclick="print_receipt()"> {{ __('point_of_sale.print') }}</button></div>
<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>{{ __('point_of_sale.tel') }}:</b> {{ $hospital_information->phone_number }}</span><br>
<span class="receipt-label"><b>{{ __('point_of_sale.email') }}:</b> {{ $hospital_information->email }}</span><br>
<span class="receipt-label"><b>{{ __('point_of_sale.dispensed_by') }}:</b> {{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</span><br>
<span class="receipt-label"><b>{{ __('point_of_sale.record_date') }}:</b> {{ streamline_date_time_short($receipt_date) }}</span><br>
<span class="receipt-label"><b>{{ __('point_of_sale.print_date') }}:</b> {{ streamline_date_time_short($receipt_reprint_date) }}</span><br>
<span class="receipt-label"><b>{{ __('point_of_sale.patient_name') }}</b> : {{ $patient->first_name }} {{ $patient->last_name }}</span><br>
<span class="receipt-label"><b>{{ __('point_of_sale.patient_number') }}</b> : {{ $patient->number }} </span><br>
<span class="receipt-label"><b>{{ __('point_of_sale.patient_category') }} :</b> {{ get_name($patient->category_id, "id", "name", "patient_categories") }}</span><br>
</p>
<div>
<table class="table" id="receipt_table">
<thead>
<th style="width: 60%"><b>{{ __('point_of_sale.description') }}</b></th>
<th style="width: 20%"><b>{{ __('point_of_sale.quantity') }}</b></th>
<th style="width: 20%"><b>{{ __('point_of_sale.price') }}</b></th>
</thead>
<tbody>
@php $total_to_pay = 0; @endphp
@if(isset($service_ids_array) && count($service_ids_array) > 0)
<tr>
<td colspan="3" class="text-center">Services</td>
</tr>
@for($i = 0; $i < count($service_ids_array); $i++)
<tr>
<td>{{ get_name($service_ids_array[$i], "id", "name", "services") }}</td>
<td>{{ $service_quantity_array[$i] }}</td>
<td>{{ ugandan_shillings($service_prices_array[$i]) }}</td>
</tr>
@php $total_to_pay += $service_prices_array[$i]; @endphp
@endfor
@endif
@if(isset($eye_glasses_ids_array) && count($eye_glasses_ids_array) > 0)
<tr>
<td colspan="3" class="text-center">Eye Glasses</td>
</tr>
@for($i = 0; $i < count($eye_glasses_ids_array); $i++)
<tr>
<td>{{ get_name($eye_glasses_ids_array[$i], "id", "name", "eye_glasses") }}</td>
<td>{{ $eye_glasses_quantity_array[$i] }}</td>
<td>{{ ugandan_shillings($eye_glasses_prices_array[$i] * $eye_glasses_quantity_array[$i]) }}</td>
</tr>
@php $total_to_pay += $eye_glasses_prices_array[$i] * $eye_glasses_quantity_array[$i]; @endphp
@endfor
@endif
@if(isset($procedure_ids_array) && count($procedure_ids_array) > 0)
<tr>
<td colspan="3" class="text-center">Procedures</td>
</tr>
@for($i = 0; $i < count($procedure_ids_array); $i++)
<tr>
<td>{{ get_name($procedure_ids_array[$i], "id", "name", "procedures") }}</td>
<td>N/A</td>
<td>{{ ugandan_shillings($procedure_amounts_array[$i]) }}</td>
</tr>
@php $total_to_pay += $procedure_amounts_array[$i]; @endphp
@endfor
@endif
@if(isset($investigation_ids_array) && count($investigation_ids_array) > 0)
<tr>
<td colspan="3" class="text-center">Investigations</td>
</tr>
@for($i = 0; $i < count($investigation_ids_array); $i++)
<tr>
<td>{{ get_name($investigation_ids_array[$i], "id", "name", "investigations") }}</td>
<td>N/A</td>
<td>{{ ugandan_shillings($investigation_amounts_array[$i]) }}</td>
</tr>
@php $total_to_pay += $investigation_amounts_array[$i]; @endphp
@endfor
@endif
@if(isset($treatment_item) && count($treatment_item) > 0)
<tr>
<td colspan="3" class="text-center">Treatments</td>
</tr>
@for($i = 0; $i < count($treatment_item); $i++)
<tr>
<td>{{ get_name($treatment_item[$i], "id", "name", "drugs") }}</td>
<td>{{ $treatment_quantity[$i] }}</td>
<td>{{ ugandan_shillings($treatment_subtotal[$i]) }}</td>
</tr>
@php $total_to_pay += $treatment_subtotal[$i]; @endphp
@endfor
@endif
@if(isset($sundry_item) && count($sundry_item) > 0)
<tr>
<td colspan="3" class="text-center">Sundries</td>
</tr>
@for($i = 0; $i < count($sundry_item); $i++)
<tr>
<td>{{ get_name($sundry_item[$i], "id", "name", "sundries") }}</td>
<td>{{ $sundry_quantity[$i] }}</td>
<td>{{ ugandan_shillings($sundry_subtotal[$i]) }}</td>
</tr>
@php $total_to_pay += $sundry_subtotal[$i]; @endphp
@endfor
@endif
<tr>
<td colspan="3"></td>
</tr>
<tr>
<td colspan="2"><b>{{ __('point_of_sale.total_to_pay') }}</b></td>
<td><b>{{ ugandan_shillings($total_to_pay) }}</b></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-sm-3">
</div>
<i style="font-size: 0.8em; margin-left: 50%;">{{ __('point_of_sale.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