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

{{ __('fixed_assets.fixed_assets') }}

@include('flash::message') @include('finance::fixed_assets.menu')
{{ Form::model($fixed_asset, ['method' => 'PUT', 'route' => ['fixed_assets.update',$fixed_asset], 'data-toggle' => 'validator']) }}
{{ Form::label('name', __('fixed_assets.asset_name')) }} {{ Form::text('name', $fixed_asset->name, ['class'=>'form-control compulsory','required']) }}
{{ Form::label('serial_number', __('fixed_assets.serial_number')) }} {{ Form::text('serial_number', $fixed_asset->serial_number , ['class'=>'form-control']) }}
{{ Form::label('cost_price', __('fixed_assets.cost_price')) }} {{ Form::number('cost_price', $fixed_asset->cost_price , ['class'=>'form-control', 'readonly','onkeyup'=>'get_balance()']) }}
@php $acquisition_date = \Carbon\Carbon::parse($fixed_asset->acquisition_date)->format('d-m-Y'); @endphp {{ Form::label('acquisition_date', __('fixed_assets.acquisition_date')) }}
{{ Form::text('acquisition_date', $acquisition_date, ['class' => 'form-control compulsory', 'required','readonly'=>'true','id'=>'datepicker-autoclose']) }}
{{ Form::label('depreciation', __('fixed_assets.depreciation')) }} {{ Form::number('depreciation', $fixed_asset->depreciation , ['class'=>'form-control', 'step' => 'any']) }}
{{ Form::label('item_condition',__('fixed_assets.item_condition')) }}
 {{ Form::radio('item_condition', 1, false, ["required"]) }} New  {{ Form::radio('item_condition', 0, false, ["required"]) }} Used
{{ Form::label('supplier', __('fixed_assets.supplier')) }} {{ Form::select('supplier', $suppliers, $fixed_asset->supplier_id, ['class'=>'form-control compulsory', 'required']) }}
{{ Form::label('fixed_asset_account', __('fixed_assets.fixed_asset_account')) }} {{ Form::select('fixed_asset_account', $fixed_asset_chart_of_accounts, $fixed_asset->fixed_asset_account_id, ['class'=>'form-control compulsory', 'required']) }}
{{ Form::label('warranty_expiration_date',__('fixed_assets.warranty_expiry')) }}
{{ Form::text('warranty_expiration_date',$fixed_asset->warranty_expiration_date,['class' => 'form-control compulsory', 'required','readonly'=>'true','id'=>'datepicker-autoclose2']) }}
{{ Form::label('edit_payment_type', 'Edit payment options') }}
 {{ Form::radio('edit_payment_type', 1, false, ["required", "id" => "edit_payment"]) }} Yes  {{ Form::radio('edit_payment_type', 0, false, ["required", "id" => "do_not_edit_payment"]) }} No
@php $payment_type = array(''=>'-select-','cash'=>'Cash / EFT / CHEQUE', 'bill'=>'Bill', 'asset_exists'=>'Already Existing Asset'); $balance = 0; $payable_account_id = 14; //default payable $bill = \Streamline\Models\HospitalBill::where(['item_ids' => $fixed_asset->id, 'bill_type' => 'ASSETS'])->first(); if ($bill) { $balance = (int)$bill->total_amount; $payable_account_id = $bill->payable_account; } @endphp
{{ Form::button(__('fixed_assets.update'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }} {{ Form::button(__('fixed_assets.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
{{ Form::close() }}
@endsection @push('scripts') @endpush