@extends('layouts.main') @push('styles') @endpush @section('content')

{{ __('discounts.patient_category_discounts') }}

{{ Form::model($discount, ['method' => 'PUT', 'route' => ['discounts.update',$discount], 'data-toggle' => 'validator']) }} {{ Form::hidden('id', $id) }}
{{ Form::text('patient_category_text', $categories[$discount->patient_category] ?? 'Category Deleted', ['class' => 'form-control col-sm-12', 'readonly']) }}

{{ 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
pay_later == 0) style="display: none;" @endif>
{{ 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
co_payment == 0) style="display: none;" @endif id="co_payment_share"> {{ Form::number('co_payment_share',$discount->co_payment_share ?? 0,['class' => 'form-control', 'max' => '100']) }}
pay_later == 0) style="display: none;" @endif> {{ Form::label('is_pay_later_threshold_discount','Does a patient have threshold amount') }}
{{ 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
threshold_type == 0) style="display: none;" @endif>
{{ 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']) }}
{{ Form::label('threshold_amount','Threshold amount') }} {{ Form::number('threshold_amount', $discount->threshold_amount, ['class' => 'form-control compulsory', 'id' => 'threshold_amount']) }}
{{ Form::number('discount',$discount->discount,['class' => 'form-control compulsory', 'max' => '100', 'min' => '0','onchange' => 'setDiscountPercentageOptions(this.value)']) }}
discount == 0) style="display: none;" @endif>
{{ 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
tracking_expense_account))style="display: none;" @endif id="tracking_expense_account_div"> {{ Form::select('tracking_expense_account', $expense_accounts, $discount->tracking_expense_account,['class' => 'form-control', 'id' => 'tracking_expense_account']) }}
{{ Form::submit('Save',['class'=>'btn btn-success'])}} {{ Form::reset('Cancel',['type'=>'reset','class'=>'btn btn-default'])}} {{ Form::close() }}
@endsection @push('scripts') @endpush