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

{{ Form::open( [ 'method'=> 'POST', 'url' => route('wg.save.generated.period.bill'), 'onsubmit'=>'return saveWithoutGSTGeneratedPeriodBill(this)','id'=> 'wg_period_bill_save', 'enctype' => 'multipart/form-data']) }} {{Form::hidden('bill_id',@$bills->id)}}
{{Form::text( 'billno', ((@$bills->id) ? @$bills->billno : $billno), [ "class" => "form-control", "placeholder" => "", (@$bills->id) ? 'readonly' : '' ]) }}
{{ Form::select( 'clientid', @$clients_options, ((@$bills->id) ? @$bills->clientid : ''), [ "class" => "form-control", "onchange"=>"getPeriodBillAmount()"] ) }}
{{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->id) ? @$bills->amount : $amount), [ "class" => "form-control", "placeholder" => "e.g 1234" ]) }}
{{Form::text( 'service_charge_percent', ((@$bills->id) ? @$bills->service_charge_percent : ''), [ "class" => "form-control", "placeholder" => "" ]) }}
{{Form::text( 'fchpercent', ((@$bills->id) ? @$bills->fchpercent : $fch), [ "class" => "form-control", "placeholder" => "" ]) }}
{{Form::text( 'other_charge', ((@$bills->id) ? @$bills->other_charge : ''), [ "class" => "form-control", "placeholder" => "" ]) }}
{{Form::text( 'created_at', ((@$bills->id && @$bills->created_at != NULL) ? date(LaraCore::setting('date_format'),strtotime(@$bills->created_at)) : $today), [ "class" => "form-control date_input", "id" => 'date' ]) }}
@if (count($selected_bill_template_array) == 0 && $set_templated_by_branch) * Please select at least one bill template @endif
@foreach($bill_templates as $key => $bill_template) @if(in_array($bill_template->template_key, $selected_bill_template_array) && $set_templated_by_branch)
{{ Form::radio( "bill_template", $bill_template->template_key, ($selected_bill_template_array[0] == $bill_template->template_key) ? true : false, [ 'id' => "$bill_template->template_key", 'class'=>'minimal', ]) }}
@elseif(!$set_templated_by_branch)
{{ Form::radio( "bill_template", $bill_template->template_key, ($key == $bill_template->template_key) ? true : false, [ 'id' => "$bill_template->template_key", 'class'=>'minimal', ]) }}
@endif @endforeach
{{ Form::close() }}