@if (isset($quotation)) {!! Form::model($quotation, ['url' => $type . '/' . $quotation->id, 'id' => 'quotation', 'method' => 'put', 'files'=> true]) !!}
@else {!! Form::open(['url' => $type, 'method' => 'post', 'files'=> true, 'id'=>'quotation']) !!} @endif
{!! Form::label('customer_id', trans('quotation.agent_name'), ['class' => 'control-label required']) !!}
{!! Form::select('customer_id', $customers, (isset($quotation->customer_id)?$quotation->customer_id:null), ['id'=>'customer_id','class' => 'form-control']) !!} {{ $errors->first('customer_id', ':message') }}
{!! Form::label('sales_team_id', trans('quotation.sales_team_id'), ['class' => 'control-label required']) !!}
{!! Form::select('sales_team_id', $salesteams, (isset($quotation)?$quotation->sales_team_id:null), ['id'=>'sales_team_id','class' => 'form-control']) !!} {{ $errors->first('sales_team_id', ':message') }}
{!! Form::label('sales_person_id', trans('salesteam.main_staff'), ['class' => 'control-label required']) !!}
{!! Form::select('sales_person_id', (isset($main_staff)?$main_staff:$staffs), (isset($quotation)?$quotation->sales_person_id:null), ['id'=>'sales_person_id','class' => 'form-control']) !!} {{ $errors->first('sales_person_id', ':message') }}
{!! Form::label('qtemplate_id', trans('quotation.quotation_template'), ['class' => 'control-label']) !!}
{!! Form::select('qtemplate_id', $qtemplates, (isset($quotation)?$quotation->qtemplate_id:null), ['id'=>'qtemplate_id','class' => 'form-control']) !!} {{ $errors->first('qtemplate_id', ':message') }}
{!! Form::label('date', trans('quotation.date'), ['class' => 'control-label required']) !!}
{!! Form::text('date', isset($quotation) ? $quotation->start_date : null, ['class' => 'form-control date']) !!} {{ $errors->first('date', ':message') }}
{!! Form::label('exp_date', trans('quotation.exp_date'), ['class' => 'control-label required']) !!}
{!! Form::text('exp_date', isset($quotation) ? $quotation->expire_date : null, ['class' => 'form-control date exp_date']) !!} {{ $errors->first('exp_date', ':message') }}
{!! Form::label('payment_term', trans('quotation.payment_term'), ['class' => 'control-label required']) !!}
{{ $errors->first('payment_term', ':message') }}
{!! Form::label('status', trans('quotation.status'), ['class' => 'control-label required']) !!}
{{ $errors->first('status', ':message') }}
{{ $errors->first('product_id.*', ':message') }}
{{ $errors->first('product_id', ':message') }}
@if(isset($quotation)&& $quotation->quotationProducts->count()>0) @foreach($quotation->quotationProducts as $index => $variants) @endforeach @endif
{{trans('quotation.product')}} {{trans('quotation.description')}} {{trans('quotation.quantity')}} {{trans('quotation.unit_price')}} {{trans('quotation.subtotal')}}
{!! Form::label('total', trans('quotation.total'), ['class' => 'control-label']) !!}
{!! Form::text('total', null, ['class' => 'form-control','readonly']) !!} {{ $errors->first('total', ':message') }}
{!! Form::label('tax_amount', trans('quotation.tax_amount').' ('.floatval(Settings::get('sales_tax')).'%)', ['class' => 'control-label']) !!}
{!! Form::text('tax_amount', null, ['class' => 'form-control','readonly']) !!} {{ $errors->first('tax_amount', ':message') }}
{!! Form::label('grand_total', trans('quotation.grand_total'), ['class' => 'control-label']) !!}
{!! Form::text('grand_total', null, ['class' => 'form-control','readonly']) !!} {{ $errors->first('grand_total', ':message') }}
{!! Form::label('discount', trans('quotation.discount').' (%)', ['class' => 'control-label']) !!}
{{ $errors->first('discount', ':message') }}
{!! Form::label('final_price', trans('quotation.final_price'), ['class' => 'control-label']) !!}
{!! Form::text('final_price', null, ['class' => 'form-control','readonly']) !!} {{ $errors->first('final_price', ':message') }}
{!! Form::label('quotation_duration', trans('qtemplate.terms_and_conditions'), ['class' => 'control-label']) !!}
{!! Form::textarea('terms_and_conditions', null, ['class' => 'form-control resize_vertical']) !!} {{ $errors->first('terms_and_conditions', ':message') }}
{{trans('table.back')}}
{!! Form::close() !!}
@section('scripts') @endsection