mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-11 18:51:31 +00:00
193 lines
9.6 KiB
PHP
Executable File
193 lines
9.6 KiB
PHP
Executable File
@extends('layouts.main')
|
|
|
|
@push('styles')
|
|
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
|
@endpush
|
|
|
|
@section('content')
|
|
<div class="row bg-title">
|
|
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
|
<h4 class="page-title">{{ __('discounts.patient_category_discounts') }}</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> {{ __('discounts.home') }}</a></li>
|
|
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('discounts.finance_home') }}</a></li>
|
|
<li><a href="{{ route('discounts.index') }}"><i class="fa fa-eye"></i> {{ __('discounts.view_discounts') }}</a></li>
|
|
<li class="active"><i class="fa fa-pencil"></i> {{ __('discounts.edit_discount') }}</li>
|
|
</ol>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="white-box">
|
|
{{ Form::model($discount, ['method' => 'PUT', 'route' => ['discounts.update',$discount], 'data-toggle' => 'validator']) }}
|
|
|
|
{{ Form::hidden('id', $id) }}
|
|
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="form-group">
|
|
<label for="patient_category">{{ __('discounts.patient_category') }}</label>
|
|
{{ Form::text('patient_category_text', $categories[$discount->patient_category] ?? 'Category Deleted', ['class' => 'form-control col-sm-12', 'readonly']) }}
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="pay_late">{{ __('discounts.pay_later') }}</label>
|
|
<br>
|
|
{{ Form::radio('pay_later', 1, $discount->pay_later == 1, ["required", 'id' => 'pay_later_yes','onclick' => 'setOptions()']) }} Yes
|
|
{{ Form::radio('pay_later', 0, $discount->pay_later == 0, ["required", 'id' => 'pay_later_no', 'onclick' => 'setOptions()']) }} No
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
|
|
<div class="form-group discount_div" @if($discount->pay_later == 0) style="display: none;" @endif>
|
|
<label for="co_payment">{{ __('discounts.co_payment') }}</label>
|
|
<br>
|
|
{{ Form::radio('co_payment', 1, $discount->co_payment == 1, ['id' => 'co_payment_yes','onclick' => 'setCoPaymentOptions()']) }} Yes
|
|
{{ Form::radio('co_payment', 0, $discount->co_payment == 0, ['id' => 'co_payment_no','onclick' => 'setCoPaymentOptions()']) }} No
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
|
|
<div class="form-group" @if($discount->co_payment == 0) style="display: none;" @endif id="co_payment_share">
|
|
<label for="co_payment_share">{{ __('discounts.co_payment_share') }}</label>
|
|
{{ Form::number('co_payment_share',$discount->co_payment_share ?? 0,['class' => 'form-control', 'max' => '100']) }}
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
|
|
<div class="form-group threshold_radios_div" @if($discount->pay_later == 0) style="display: none;" @endif>
|
|
{{ Form::label('is_pay_later_threshold_discount','Does a patient have threshold amount') }}
|
|
<br>
|
|
{{ Form::radio('is_pay_later_threshold_discount', 1, !is_null($discount->threshold_type), ['id' => 'is_pay_later_threshold_discount_yes', 'onclick' => 'displayOfDiscountThresholdDivs()']) }} Yes
|
|
{{ Form::radio('is_pay_later_threshold_discount', 0, is_null($discount->threshold_type), ['id' => 'is_pay_later_threshold_discount_no', 'onclick' => 'displayOfDiscountThresholdDivs()']) }} No
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
|
|
<div class="set_threshold_div" @if($discount->threshold_type == 0) style="display: none;" @endif>
|
|
<div class="form-group">
|
|
{{ Form::label('threshold_type','Threshold type') }}
|
|
{{ Form::select('threshold_type', [''=>'--Select discount type','1'=>'Monthly threshold amount','2'=>'Yearly threshold amount'], $discount->threshold_type, ['class' => 'form-control compulsory', 'id' => 'threshold_type']) }}
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
{{ Form::label('threshold_amount','Threshold amount') }}
|
|
{{ Form::number('threshold_amount', $discount->threshold_amount, ['class' => 'form-control compulsory', 'id' => 'threshold_amount']) }}
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
<div class="form-group">
|
|
<label for="discount">{{ __('discounts.discounts_percentage') }}</label>
|
|
{{ Form::number('discount',$discount->discount,['class' => 'form-control compulsory', 'max' => '100', 'min' => '0','onchange' => 'setDiscountPercentageOptions(this.value)']) }}
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
|
|
<div class="form-group" id="track_discount_div" @if($discount->discount == 0) style="display: none;" @endif>
|
|
<label for="track_discounts">Track Discounts</label>
|
|
<br>
|
|
{{ Form::radio('track_discounts', 1, !is_null($discount->tracking_expense_account), ['id' => 'tracking_yes','onclick' => 'setTrackingOption()']) }} Yes
|
|
{{ Form::radio('track_discounts', 0, is_null($discount->tracking_expense_account), ['id' => 'tracking_no','onclick' => 'setTrackingOption()']) }} No
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
|
|
<div class="form-group" @if(is_null($discount->tracking_expense_account))style="display: none;" @endif id="tracking_expense_account_div">
|
|
<label for="tracking_expense_account">Expense Account</label>
|
|
{{ Form::select('tracking_expense_account', $expense_accounts, $discount->tracking_expense_account,['class' => 'form-control', 'id' => 'tracking_expense_account']) }}
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{ Form::submit('Save',['class'=>'btn btn-success'])}}
|
|
{{ Form::reset('Cancel',['type'=>'reset','class'=>'btn btn-default'])}}
|
|
|
|
{{ Form::close() }}
|
|
</div>
|
|
@endsection
|
|
|
|
@push('scripts')
|
|
<script type="text/javascript">
|
|
function setOptions() {
|
|
if (document.getElementById("pay_later_yes").checked) {
|
|
$('.discount_div').show();
|
|
$('.threshold_radios_div').show();
|
|
$('#is_pay_later_threshold_discount_yes').attr('required', true);
|
|
$('#is_pay_later_threshold_discount_no').attr('required', true);
|
|
$('#co_payment_yes').attr('required', true);
|
|
$('#co_payment_no').attr('required', true);
|
|
}
|
|
if (document.getElementById("pay_later_no").checked) {
|
|
$('.discount_div').hide();
|
|
$('.threshold_radios_div').hide();
|
|
$('#is_pay_later_threshold_discount_yes').attr('required', false);
|
|
$('#is_pay_later_threshold_discount_no').attr('required', false);
|
|
$('#co_payment_yes').attr('required', false);
|
|
$('#co_payment_no').attr('required', false);
|
|
}
|
|
}
|
|
|
|
function setCoPaymentOptions() {
|
|
if (document.getElementById("co_payment_yes").checked) {
|
|
$('#co_payment_share').show();
|
|
}
|
|
if (document.getElementById("co_payment_no").checked) {
|
|
$('#co_payment_share').hide();
|
|
}
|
|
}
|
|
|
|
function setTrackingOption() {
|
|
if (document.getElementById("tracking_yes").checked) {
|
|
$('#tracking_expense_account_div').show();
|
|
$('#tracking_expense_account').attr('required', true);
|
|
}
|
|
if (document.getElementById("tracking_no").checked) {
|
|
$('#tracking_expense_account_div').hide();
|
|
$('#tracking_expense_account').attr('required', false);
|
|
}
|
|
}
|
|
|
|
function displayOfDiscountThresholdDivs() {
|
|
if (document.getElementById("is_pay_later_threshold_discount_yes").checked) {
|
|
$('.set_threshold_div').show();
|
|
$('#threshold_type').attr('required', true);
|
|
$('#threshold_amount').attr('required', true);
|
|
}
|
|
if (document.getElementById("is_pay_later_threshold_discount_no").checked) {
|
|
$('.set_threshold_div').hide();
|
|
$('#threshold_type').attr('required', false);
|
|
$('#threshold_amount').attr('required', false);
|
|
}
|
|
}
|
|
|
|
function setDiscountOption() {
|
|
var selector = document.getElementById('threshold_type');
|
|
var discountTypeValue = selector[selector.selectedIndex].value;
|
|
|
|
if (discountTypeValue == 1) {
|
|
$('.discount_amount').hide();
|
|
}
|
|
|
|
if (discountTypeValue == 2) {
|
|
$('.discount_amount').show();
|
|
}
|
|
}
|
|
|
|
function setDiscountPercentageOptions(percentage) {
|
|
if (percentage > 0) {
|
|
$('#track_discount_div').show();
|
|
$('#tracking_yes').attr('required', true);
|
|
$('#tracking_no').attr('required', true);
|
|
} else {
|
|
$('#track_discount_div').hide();
|
|
$('#tracking_yes').attr('required', false);
|
|
$('#tracking_no').attr('required', false);
|
|
}
|
|
}
|
|
</script>
|
|
@endpush
|
|
|
|
|
|
|
|
|