@extends('layout.padrao')
@section('title', ' Trade Recaps Register')
@section('content')
@if (session('exception'))
{!! Form::label('traders_id', 'Trader', [ 'class' => 'w-100 control-label']) !!}
{!! Form::select('traders_id', $select['traders'],old('traders_id', null),['class'=>'form-control']) !!}
@if($errors->has('traders_id'))
{{$errors->first('traders_id')}}
@endif
{!! Form::label('buyer_id', 'Client / Buyer', [ 'class' => 'w-100 control-label']) !!}
{!! Form::select('buyer_id', $select['buyers'], old('buyer_id',null), ['class' => 'dynamic_description form-control', 'data-dependent'=>'BuyerDescription']) !!}
@if($errors->has('buyer_id'))
{{$errors->first('buyer_id')}}
@endif
{!! Form::label('BuyerDescription', 'Client / Buyer Description', [ 'class' => 'w-100 control-label']) !!}
{!! Form::textarea('BuyerDescription', null, ['id'=>'BuyerDescription','class' => 'form-control', 'rows' => 3,'readonly'=>'readonly']) !!}
{!! Form::label('port_destinations_id', 'Port of Destination', [ 'class' => 'col6 control-label']) !!}
{!! Form::select('port_destinations_id', $select['destinationCountry'], old('port_destinations_id'), ['class' => 'port_destinations form-control','multiple'=>'multiple']) !!}
@if($errors->has('port_destinations_id'))
{{$errors->first('port_destinations_id')}}
@endif
{!! Form::label('platforms_id', 'Produto', [ 'class' => 'w-100 control-label']) !!}
{!! Form::select('platforms_id', $select['platform'], null, ['class' => ' platform_dynamic platforms form-control']) !!}
@if($errors->has('platforms_id'))
{{$errors->first('/')}}
@endif
{!! Form::label('brokers_id', 'Broker', [ 'class' => 'w-100 control-label']) !!}
{!! Form::select('brokers_id', $select['brokers'], old('brokers_id'), ['class' => 'brokers form-control', 'data-dependent'=>'suppliers']) !!}
@if($errors->has('brokers_id'))
{{$errors->first('brokers_id')}}
@endif
{!! Form::label('brands_id', 'Brand', [ 'class' => 'w-100 control-label']) !!}
{!! Form::select('brands_id', $select['brands'], old('brands_id'), ['class' => 'brands form-control', 'data-dependent'=>'brokers']) !!}
@if($errors->has('brands_id'))
{{$errors->first('brands_id')}}
@endif
{{--
--}}
Payment / Shipping Info
{!! Form::label('payment_terms_id', 'Payment Terms', [ 'class' => 'w-100 control-label']) !!}
{!! Form::select('payment_terms_id', $select['paymentTerms'], null, ['class' => 'dynamic_description payment_terms form-control', 'data-dependent'=>'paymentDescription']) !!}
@if($errors->has('payment_terms_id'))
{{$errors->first('payment_terms_id')}}
@endif
{!! Form::label('incoterms_id', 'Incoterm', [ 'class' => 'w-100 control-label']) !!}
{!! Form::select('incoterms_id', $select['incoterm'], null, ['class' => 'incoterms form-control']) !!}
@if($errors->has('incoterms_id'))
{{$errors->first('incoterms_id')}}
@endif
{!! Form::label('paymentDescription', 'Payment Description', [ 'class' => 'w-100 control-label']) !!}
{!! Form::textarea('paymentDescription', null, ['id'=>'paymentDescription','class' => 'paymentDescription form-control', 'rows' => 5,'readonly'=>'readonly']) !!}
{!! Form::label('currencies_id', 'Currency', [ 'class' => 'w-100 control-label']) !!}
{!! Form::select('currencies_id', $select['currency'], null, ['class' => 'currencies form-control']) !!}
@if($errors->has('currencies_id'))
{{$errors->first('currencies_id')}}
@endif
{!! Form::label('priceMtonTotal', 'Price m/Ton', [ 'class' => 'w-100 control-label']) !!}
{!! Form::number('priceMtonTotal', null,['class' => 'form-control','step'=>'any']) !!}
@if($errors->has('priceMtonTotal'))
{{$errors->first('priceMtonTotal')}}
@endif
{!! Form::label('freightRateMton', 'Freight Rate m/ton', [ 'class' => 'w-100 control-label']) !!}
{!! Form::number('freightRateMton', null,['class' => 'form-control','step'=>'any']) !!}
@if($errors->has('freightRateMton'))
{{$errors->first('freightRateMton')}}
@endif
{!! Form::label('insuranceMton', 'Insurance m/ton', [ 'class' => 'w-100 control-label']) !!}
{!! Form::number('insuranceMton', null,['class' => 'form-control','step'=>'any']) !!}
@if($errors->has('insuranceMton'))
{{$errors->first('insuranceMton')}}
@endif
{!! Form::label('inlandCosts', 'Inland Costs m/ton ', [ 'class' => 'w-100 control-label']) !!}
{!! Form::number('inlandCosts', null,['class' => 'form-control','step'=>'any']) !!}
@if($errors->has('inlandCosts'))
{{$errors->first('inlandCosts')}}
@endif
{!! Form::label('priceMtonCheck', 'Price m/ton Total', [ 'class' => 'w-100 control-label']) !!}
{!! Form::number('priceMtonCheck', null,['class' => 'form-control','readonly'=>'readonly','step'=>'any']) !!}
@if($errors->has('priceMtonCheck'))
{{$errors->first('priceMtonCheck')}}
@endif
{!! Form::label('qualitySpec', 'Quality Spec', [ 'class' => 'w-100 control-label']) !!}
{!! Form::textarea('qualitySpec', null, ['class' => 'form-control', 'rows' => 3]) !!}
@if($errors->has('qualitySpec'))
{{$errors->first('qualitySpec')}}
@endif
{!! Form::label('totalQtyT', 'Contract Total Net Weight (tons)', [ 'class' => 'w-100 control-label']) !!}
{!! Form::number('totalQtyT', null,['class' => 'form-control','step'=>'any']) !!}
@if($errors->has('totalQtyT'))
{{$errors->first('totalQtyT')}}
@endif
@if(old('packing_types_id'))
@for($i=0; $i < count(old('packing_types_id')) ; $i++)
@if($i==0)
{!! Form::label('packing_types_id', 'Packing Type', [ 'class' => 'w-100 control-label']) !!}
{!! Form::select('packing_types_id[]', $oldValues['packing_types_id'], old('packing_types_id.'.$i), ['class' => 'packing_types form-control']) !!}
{!! Form::label('packing_net_weights_id', 'Packing Net Weight (kgs)', [ 'class' => 'w-100 control-label']) !!}
{!! Form::select('packing_net_weights_id[]', $oldValues['packing_net_weights_id'], old('packing_net_weights_id.'.$i), ['class' => 'dynamic_tare packing_net_weights form-control', 'data-dependent'=>'packing_type_nets']) !!}
{!! Form::label('packing_tares_id', 'Packing Tare', [ 'class' => 'w-100 control-label']) !!}
{!! Form::number('packing_tares_id[]', old('packing_tares_id.'.$i), ['id'=>'packing_type_nets', 'class' => 'packing_type_nets packing_tares_id form-control','readonly'=>'readonly']) !!}
{!! Form::label('totalPackingUnits', 'Total Of Packing Units', [ 'class' => 'w-100 control-label']) !!}
{!! Form::number('totalPackingUnits[]', old('totalPackingUnits.'.$i),['class' => 'totalPackingUnits_qty form-control']) !!}
@else
{!! Form::label('packing_types_id', 'Packing Type', [ 'class' => 'w-100 control-label']) !!}
{!! Form::select('packing_types_id['.$i.']', $oldValues['packing_types_id'], old('packing_types_id.'.$i), ['class' => 'packing_types form-control']) !!}
{!! Form::label('packing_net_weights_id', 'Packing Net Weight (kgs)', [ 'class' => 'w-100 control-label']) !!}
{!! Form::select('packing_net_weights_id['.$i.']', $oldValues['packing_net_weights_id'], old('packing_net_weights_id.'.$i), ['class' => 'dynamic_tare packing_net_weights form-control', 'data-dependent'=>'packing_type_nets']) !!}
{!! Form::label('packing_tares_id', 'Packing Tare', [ 'class' => 'w-100 control-label']) !!}
{!! Form::number('packing_tares_id['.$i.']', old('packing_tares_id.'.$i), ['id'=>'packing_type_nets', 'class' => 'packing_type_nets packing_tares_id form-control','readonly'=>'readonly']) !!}
{!! Form::label('totalPackingUnits', 'Total Of Packing Units', [ 'class' => 'w-100 control-label']) !!}
{!! Form::number('totalPackingUnits['.$i.']', old('totalPackingUnits.'.$i),['class' => 'totalPackingUnits_qty form-control']) !!}
@endif
@endfor
@else
{!! Form::label('packing_types_id', 'Packing Type', [ 'class' => 'w-100 control-label']) !!}
{!! Form::select('packing_types_id[]', $oldValues['packing_types_id'], old('packing_types_id'), ['class' => 'packing_types form-control']) !!}
{!! Form::label('packing_net_weights_id', 'Packing Net Weight (kgs)', [ 'class' => 'w-100 control-label']) !!}
{!! Form::select('packing_net_weights_id[]', $oldValues['packing_net_weights_id'], old('packing_net_weights_id'), ['class' => 'dynamic_tare packing_net_weights form-control', 'data-dependent'=>'packing_type_nets']) !!}
{!! Form::label('packing_tares_id', 'Packing Tare', [ 'class' => 'w-100 control-label']) !!}
{!! Form::number('packing_tares_id[]', null, ['id'=>'packing_type_nets', 'class' => 'packing_type_nets packing_tares_id form-control','readonly'=>'readonly']) !!}
{!! Form::label('totalPackingUnits', 'Total Of Packing Units', [ 'class' => 'w-100 control-label']) !!}
{!! Form::number('totalPackingUnits[]', null,['class' => 'totalPackingUnits_qty form-control']) !!}
@endif
{!! Form::label('shippingPeriodFrom', 'Shipping Period From', [ 'class' => 'w-100 control-label']) !!}
{!! Form::date('shippingPeriodFrom', null,['class' => 'form-control', 'min' => '2019-01-01', 'max' => '2080-01-01']) !!}
@if($errors->has('shippingPeriodFrom'))
{{$errors->first('shippingPeriodFrom')}}
@endif
{!! Form::label('shippingPeriodTo', 'Shipping Period To', [ 'class' => 'w-100 control-label']) !!}
{!! Form::date('shippingPeriodTo', null,['class' => 'form-control', 'min' => '2019-01-01', 'max' => '2080-01-01']) !!}
@if($errors->has('shippingPeriodTo'))
{{$errors->first('shippingPeriodTo')}}
@endif