@if (isset($order))
{!! Form::model($order, array('url' => url('orders/'.$order->id. '/edit'), 'method' => 'put', 'files'=> true,'id'=>'fvalidate')) !!}
@else
{!! Form::open(array('url' => route('order-detail.store'), 'method' => 'post', 'files'=> true,'id'=>'fvalidate')) !!}
@endif
@if(isset($customer))
{!! Form::hidden('user_id', $customer->id, array('class' => 'form-control quantity', 'required' => true)) !!}
@endif
{!! Form::hidden('role_type', isset($order)&&$order->role_type?$order->role_type:\App\Constants\StatusCode::PRODUCT, array('id' => 'role_type')) !!}
{!! Form::label('full_name', 'Tên khách hàng', array('class' => ' required')) !!}
{!! Form::text('full_name',$customer ? $customer->full_name: null , array('class' => 'form-control full_name input-custom', 'required' => true)) !!}
{{ $errors->first('full_name', ':message') }}
{!! Form::label('phone', 'Số điện thoại', array('class' => ' required')) !!}
{!! Form::text('phone', $customer ? (auth()->user()->permission('phone.open') ? $customer->phone : str_limit($customer->phone, 7, 'xxx')): null, array('class' => 'form-control phone input-custom', 'required' => true)) !!}
{{ $errors->first('phone', ':message') }}
{!! Form::label('address', 'Địa chỉ', array('class' => ' required')) !!}
{!! Form::text('address', $customer ? $customer->address: null, array('class' => 'form-control address input-custom')) !!}
{{ $errors->first('address', ':message') }}
{!! Form::label('status_id', 'Trạng thái', array('class' => ' required')) !!}
@if(isset($customer))
@else
{!! Form::select('status_id', $status, null, array('class' => 'form-control select2','id'=>'status', 'required' => true, 'placeholder' => 'Trạng thái')) !!}
@endif
{{ $errors->first('address', ':message') }}
Thông tin dịch vụ
{{--
--}}
| Sản phẩm |
Số lượng |
Đơn giá |
{{--VAT(%) | --}}
CK(%) |
CK(đ) |
Thành tiền |
|
@if(!empty($order))
@foreach($order->orderDetails as $orderDetail)
{!! Form::text('order_detail_id[]', $orderDetail->id, array('class' => 'form-control hidden')) !!}
|
{!! Form::text('quantity[]', $orderDetail->quantity, array('class' => 'form-control quantity input-custom', 'required' => true)) !!}
|
{!! Form::text('price[]', number_format($orderDetail->price), array('class' => 'form-control price input-custom', 'required' => true)) !!}
|
{{----}}
{!! Form::hidden('vat[]', 0, array('class' => 'form-control VAT')) !!}
{{-- | --}}
|
{!! Form::text('number_discount[]', number_format($orderDetail->number_discount), array('class' => 'form-control CK2 input-custom')) !!}
|
{!! Form::text('total_price[]', number_format($orderDetail->total_price), array('class' => 'form-control total input-custom','readonly'=>true)) !!}
|
{{----}}
|
@endforeach
@else
|
{!! Form::text('quantity[]', 1, array('class' => 'form-control quantity input-custom', 'required' => true)) !!}
|
{!! Form::text('price[]', null, array('class' => 'form-control price input-custom', 'required' => true)) !!}
|
{{----}}
{{--{!! Form::text('vat[]', 0, array('class' => 'form-control VAT')) !!}--}}
{{-- | --}}
|
{!! Form::text('number_discount[]', 0, array('class' => 'form-control CK2 input-custom')) !!}
|
{!! Form::text('total_price[]', null, array('class' => 'form-control total input-custom','readonly'=>true)) !!}
|
{{----}}
|
@endif
Thông tin khác
{{--
--}}
{{--
--}}
{{----}}
{{--
--}}
{{--Thêm B.Sỹ--}}
{{--
--}}
{{--
--}}
{{--
--}}
{{--
--}}
{{----}}
{{--
--}}
{{--Thêm y tá--}}
{{--
--}}
{{--
--}}
{{----}}
Chọn tư vấn
{{@$order->support->full_name}}
{!! Form::label('created_at', 'Ngày tạo đơn', array('class' => ' required')) !!}
{!! Form::text('created_at', isset($order) ? date("d-m-Y", strtotime($order->created_at)) : date("d-m-Y", strtotime("now")), array('class' => 'form-control fc-datepicker')) !!}
Tổng thanh toán
{{isset($order)?@number_format($order->all_total):0}}