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

{{ __('sundries.edit_sundry') }}

@include('clinical_data::sundries.menu')
@include('flash::message')
{{ Form::model($sundry, ['method' => 'PUT', 'route' => ['sundries.update',$sundry] , 'data-toggle' => 'validator']) }}
{{ Form::label('name', __('sundries.sundry_name')) }} {{ Form::text('name', $sundry->name, ['class' => 'form-control compulsory', 'required']) }}
{{ Form::label('price', __('sundries.buying_price')) }} {{ Form::number('price', $sundry->cost_price, ['class' => 'form-control compulsory', 'required', 'step' => '.01']) }}
{{ Form::label('non_insured_price', __('sundries.non_insured_price')) }} {{ Form::number('non_insured_price', $sundry->non_insured_price, ['class' => 'form-control', 'step' => '.01']) }}
{{ Form::label('available', __('sundries.is_sundry_available')) }}  {{ Form::radio('available', 1, $sundry->available == 1, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }} {{ __('sundries.yes') }}    {{ Form::radio('available', 0, $sundry->available == 0, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }} {{ __('sundries.no') }}
@if($sundry->price_list_category && $sundry->price_list_category != '') @php $price_list_categories = explode(",", $sundry->price_list_category); $price_list_prices = explode(",", $sundry->price_list_price); @endphp @for($i = 0; $i < count($price_list_categories); $i++)
{{ Form::label('non_insured_price', get_name($price_list_categories[$i], 'id', 'name', 'patient_categories').' Price') }} {{ Form::hidden('price_list_category_id[]', $price_list_categories[$i]) }} {{ Form::number('price_list_price[]', $price_list_prices[$i], ['class'=>'form-control price_list_price']) }}
@endfor @endif
{{ Form::label('account_id', __('sundries.income_account')) }} {{ Form::select('account_id', $income_accounts, null, ['class' => 'form-control']) }}
{{ Form::label('form_id', __('sundries.form')) }} {{ Form::select('form_id', $forms, $sundry->form_id, ['class' => 'form-control']) }}
{{ Form::label('cog_account', __('sundries.cost_of_goods')) }} {{ Form::select('cog_account', $cost_of_goods_accounts, $sundry->cost_of_goods_account, ['class' => 'form-control']) }}
{{ Form::label('inventory_account', __('sundries.inventory_asset_account')) }} {{ Form::select('inventory_account', $inventory_asset_accounts, $sundry->inventory_account, ['class' => 'form-control']) }}
{{ Form::button(__('sundries.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }} {{ Form::button(__('sundries.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }} {{ Form::close() }}
@endsection @push('scripts') @endpush