{{ (@$bills) ? 'Edit Cargo Period Bill' : 'Add Cargo Period Bill' }}

{{ Form::open( [ 'method'=> 'POST', 'url' => route('save.generated.cargo.period.bill'), 'onsubmit'=>'return SaveGeneratedPeriodBill(this)','id'=> 'cargo_period_bill_save', 'enctype' => 'multipart/form-data']) }} {{Form::hidden('bill_id',@$bills->id)}}
{{Form::text( 'bill_no', (@$bills) ? $bills->bill_no : $bill_no, [ "class" => "form-control", "placeholder" => "", (@$bills->id) ? 'disabled' : '' ]) }}
{{ Form::select( 'client_id', @$clients_options, (@$bills) ? $bills->client_id : '', [ "class" => "form-control", "onchange"=>"getPeriodBillAmount()","disabled" => isset($bills) ? true : false] ) }}
@if(isset($bills)) @endif
{{Form::text( 'start_date', (@$bills) ? date("d M Y", strtotime($bills->start_date)) : $start_date, ["class"=>"form-control date_input", "id"=>"start_date", "onchange"=>"getPeriodBillAmount()"]) }}
{{Form::text( 'end_date', (@$bills) ? date("d M Y", strtotime($bills->end_last)) : $end_date, ["class"=>"form-control date_input", "id"=>"end_date", "onchange"=>"getPeriodBillAmount()" ]) }}
{{Form::text( 'amount', (@$bills) ? $bills->amount : $amount, [ "class" => "form-control", "placeholder" => "e.g 1234" ]) }}
{{Form::text( 'fchpercent', ((@$bills->id) ? @$bills->fchpercent : 0), [ "class" => "form-control", "placeholder" => "" ]) }}
{{Form::text( 'cgstpercent', (@$bills) ? $bills->cgstpercent : $cgst, [ "class" => "form-control", "placeholder" => "" ]) }}
{{Form::text( 'sgstpercent', (@$bills) ? $bills->sgstpercent : $sgst, [ "class" => "form-control", "placeholder" => "" ]) }}
{{Form::text( 'igstpercent', (@$bills) ? $bills->igstpercent : $igst, [ "class" => "form-control", "placeholder" => "" ]) }}
{{Form::text( 'created_at', (@$bills) ? date("d M Y", strtotime($bills->created_at)) : $today, [ "class" => "form-control date_input", "id" => 'date' ]) }}
@foreach($bill_templates as $key => $bill_template)
{{ Form::radio( "bill_template", $bill_template->template_key, true, [ 'id' => "$bill_template->template_key", 'class'=>'minimal', ]) }}
@endforeach
{{ Form::close() }}