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

{{ Form::open( [ 'method'=> 'POST', 'url' => route('save.generated.bills'), 'onsubmit'=>'return SaveGeneratedBill(this)','id'=> 'bills_save', 'enctype' => 'multipart/form-data']) }} {{Form::hidden('client_id',@$client_id)}} {{Form::hidden('bill_id',@$bills->id)}}
{{Form::text( 'billno', ((@$bills->id) ? @$bills->billno : $billno), [ "class" => "form-control", "placeholder" => "", (@$bills->id) ? 'disabled' : '' ]) }}
{{ Form::select( 'clientid', @$clients_options, ((@$bills->id) ? @$bills->clientid : $client_id), [ "class" => "form-control", 'disabled'=>'disabled'] ) }}
{{Form::text( 'amount', ((@$bills->id) ? @$bills->amount : $amount), [ "class" => "form-control", "placeholder" => "e.g 1234" ]) }}
{{ Form::select( "month", $month, ((@$bills->id) ? @$bills->month : $current_month), [ 'class' => 'form-control', ] ) }}
{{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( 'cgstpercent', ((@$bills->id) ? @$bills->cgstpercent : $cgst), [ "class" => "form-control", "placeholder" => "" ]) }}
{{Form::text( 'sgstpercent', ((@$bills->id) ? @$bills->sgstpercent : $sgst), [ "class" => "form-control", "placeholder" => "" ]) }}
{{Form::text( 'igstpercent', ((@$bills->id) ? @$bills->igstpercent : $igst), [ "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() }}