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,224 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/icheck/skins/all.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">{{ __('sundries.add_sundry') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('sundries.dashboard') }}</a></li>
<li><a href="/sundries/">{{ __('sundries.sundries') }}</a></li>
<li class="active">{{ __('sundries.create') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('clinical_data::sundries.menu')
</div>
</div>
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
@if (session()->has('streamline_setup'))
<h3><font color="blue">{{ __('sundries.streamline_setup') }}</font></h3>
{{ Form::open(['route' => 'sundries.store' ,]) }}
<div class="row">
<div class="col-sm-6">
<div class="form-group">
{{ Form::label('name', __('sundries.sundry_name')) }}
{{ Form::text('name', '', ['class' => 'form-control']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('price', __('sundries.buying_price')) }}
{{ Form::number('price', '', ['class' => 'form-control']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group non_insured_price_div">
{{ Form::label('non_insured_price', __('sundries.non_insured_price')) }}
{{ Form::number('non_insured_price', '', ['class' => 'form-control']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('available', __('sundries.is_sundry_available')) }}&ensp;
{{ Form::radio('available', 1, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }} {{ __('sundries.yes') }} &nbsp;&nbsp;
{{ Form::radio('available', 0, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }} {{ __('sundries.no') }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('account_id', __('sundries.income_account')) }}
{{ Form::select('account_id', $income_accounts, null, ['class' => 'form-control']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('cog_account', __('sundries.cost_of_goods')) }}
{{ Form::select('cog_account', $cost_of_goods_accounts, null, ['class' => 'form-control']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('inventory_account', __('sundries.inventory_asset_account')) }}
{{ Form::select('inventory_account', $inventory_asset_accounts, null, ['class' => 'form-control']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-sm-2"></div>
<div class="col-sm-4" style="background: #eceeef;">
<h4>{{ __('sundries.select_from_list') }}</h4>
<input id="select_all" type="checkbox"> <b>Select All</b><br><br>
@foreach ($sundries as $defaultSundry)
<div class="form-group">
{{ Form::checkbox('selected_sundries[]', $defaultSundry['Item_Name'], false, ['class' => 'item_checkbox']) }} {{ $defaultSundry['Item_Name'] }} &nbsp;&nbsp;
</div>
@endforeach
</div>
</div>
{{ Form::button(__('sundries.next'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10 next']) }}
{{ Form::button(__('sundries.skip'),['type'=>'submit','name' => 'skip','value'=>'skip','class'=>'btn btn-default waves-effect waves-light m-r-10']) }}
@else
{{ Form::open(['route' => 'sundries.store' , 'data-toggle' => 'validator']) }}
<div class="form-group">
{{ Form::label('name', __('sundries.sundry_name')) }}
{{ Form::text('name', '', ['class' => 'form-control compulsory']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('price', __('sundries.buying_price')) }}
{{ Form::number('price', '', ['class' => 'form-control compulsory']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group non_insured_price_div">
{{ Form::label('non_insured_price', __('sundries.non_insured_price')) }}
{{ Form::number('non_insured_price', '', ['class' => 'form-control compulsory', 'id' => 'non_insured_price']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('available', __('sundries.is_sundry_available')) }}&ensp;
{{ Form::radio('available', 1, false, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }} {{ __('sundries.yes') }} &nbsp;&nbsp;
{{ Form::radio('available', 0, false, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }} {{ __('sundries.no') }}
<div class="help-block with-errors"></div>
</div>
@php
$price_list_categories = \Streamline\Models\PriceListCategories::select('patient_category_id', 'id')->get();
@endphp
@foreach($price_list_categories as $record)
<div class="form-group">
{{ Form::label('non_insured_price', get_name($record->patient_category_id, 'id', 'name', 'patient_categories').' Price') }}
{{ Form::hidden('price_list_category_id[]', $record->id) }}
{{ Form::number('price_list_price[]', '', ['class'=>'form-control price_list_price']) }}
</div>
@endforeach
<div class="form-group">
{{ Form::label('account_id', __('sundries.income_account')) }}
{{ Form::select('account_id', $income_accounts, null, ['class' => 'form-control']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('form_id', __('sundries.form')) }}
{{ Form::select('form_id', $forms, null, ['class' => 'form-control']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('cog_account', __('sundries.cost_of_goods')) }}
{{ Form::select('cog_account', $cost_of_goods_accounts, null, ['class' => 'form-control']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('inventory_account', __('sundries.inventory_asset_account')) }}
{{ Form::select('inventory_account', $inventory_asset_accounts, null, ['class' => 'form-control']) }}
<div class="help-block with-errors"></div>
</div>
{{ Form::button(__('sundries.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10 submit-btn']) }}
{{ Form::button(__('sundries.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
@endif
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script type="text/javascript">
function setOptions() {
if (document.getElementById("insured_checkbox").checked) {
document.querySelector(".insured_price_div").style.display = "block";
//document.querySelector(".non_insured_price_div").style.display = "none";
}
if (document.getElementById("non_insured_checkbox").checked) {
document.querySelector(".insured_price_div").style.display = "none";
}
}
</script>
<!-- icheck -->
<script src="{{ asset('elite/bower_components/icheck/icheck.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/icheck/icheck.init.js') }}"></script>
<script type="text/javascript">
$(".next,.submit-btn").click(function (e) { // make sure that all compulsory fields have been filled out
var empty_compulsory_fields = [];
$(".compulsory").each(function () {
if ($(this).val() == "") {
var textname = $(this).attr('name');
$(this).focus();
empty_compulsory_fields.push(textname);
$(this).css('border','1px solid #F08080');
}
});
/* check if the array containing empty compulsory fields is not empty then return false */
if (empty_compulsory_fields.length != 0) {
alert("Please fill in all compulsory fields");
console.log(empty_compulsory_fields);
e.preventDefault();
return false;
}
});
$('#select_all').change(function() {
if (this.checked === true) {
$(".item_checkbox").each(function() {
this.checked = true;
});
} else {
$(".item_checkbox").each(function() {
this.checked = false;
});
}
});
$('#non_insured_price').change(function(e) {
var non_insured_price = $(this).val();
if (non_insured_price > 0) {
$(".price_list_price").each(function () {
$(this).val(non_insured_price);
});
}
});
</script>
@endpush