@if (isset($invoice)) {!! Form::model($invoice, ['url' => $type . '/' . $invoice->id, 'method' => 'put', 'id'=>'invoice','files'=> true]) !!} @else {!! Form::open(['url' => $type, 'method' => 'post', 'files'=> true, 'id'=>'invoice']) !!} @endif
{!! Form::label('customer_id', trans('invoice.agent_name'), ['class' => 'control-label required']) !!}
{!! Form::select('customer_id', $customers, (isset($invoice->customer_id)?$invoice->customer_id:null), ['id'=>'customer_id','class' => 'form-control']) !!} {{ $errors->first('customer_id', ':message') }}
{!! Form::label('sales_team_id', trans('invoice.sales_team_id'), ['class' => 'control-label required']) !!}
{!! Form::select('sales_team_id', $salesteams, (isset($invoice)?$invoice->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', $staffs, null, ['id'=>'sales_person_id','class' => 'form-control']) !!} {{ $errors->first('sales_person_id', ':message') }}
{!! Form::label('qtemplate_id', trans('invoice.quotation_template'), ['class' => 'control-label']) !!}
{!! Form::select('qtemplate_id', $qtemplates, null, ['class' => 'form-control']) !!} {{ $errors->first('qtemplate_id', ':message') }}
{!! Form::label('invoice_date', trans('invoice.invoice_date'), ['class' => 'control-label required']) !!}
{!! Form::text('invoice_date', isset($invoice)? $invoice->invoice_start_date : null, ['class' => 'form-control date']) !!} {{ $errors->first('invoice_date', ':message') }}
{!! Form::label('due_date', trans('invoice.due_date'), ['class' => 'control-label required']) !!}
{!! Form::text('due_date', isset($invoice)? $invoice->invoice_due_date : null, ['class' => 'form-control']) !!} {{ $errors->first('due_date', ':message') }}
{!! Form::label('payment_term', trans('invoice.payment_term'), ['class' => 'control-label required']) !!}
{{ $errors->first('payment_term', ':message') }}
{!! Form::label('status', trans('invoice.status'), ['class' => 'control-label required']) !!}
{{ $errors->first('status', ':message') }}
{{ $errors->first('product_id.*', ':message') }}
{{ $errors->first('product_id', ':message') }}
@if(isset($invoice) && $invoice->invoiceProducts->count()>0) @foreach($invoice->invoiceProducts as $index => $variants) @endforeach @endif
{{trans('invoice.product')}} {{trans('invoice.description')}} {{trans('invoice.quantity')}} {{trans('invoice.unit_price')}} {{trans('invoice.subtotal')}}
 
{!! Form::label('total', trans('invoice.total'), ['class' => 'control-label']) !!}
{!! Form::text('total', null, ['class' => 'form-control','readonly']) !!} {{ $errors->first('total', ':message') }}
{!! Form::label('tax_amount', trans('invoice.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('invoice.grand_total'), ['class' => 'control-label']) !!}
{!! Form::text('grand_total', null, ['class' => 'form-control','readonly']) !!} {{ $errors->first('grand_total', ':message') }}
{!! Form::label('discount', trans('invoice.discount').' (%)', ['class' => 'control-label']) !!}
{{ $errors->first('discount', ':message') }}
{!! Form::label('final_price', trans('invoice.final_price'), ['class' => 'control-label']) !!}
{!! Form::text('final_price', null, ['class' => 'form-control','readonly']) !!} {{ $errors->first('final_price', ':message') }}
{{trans('table.back')}}
{!! Form::close() !!}
@section('scripts') @endsection