@php if($type == 'allowance') { $name_col = 'allowance_names'; $val_col = 'allowance_amounts'; $val_class = 'allowance'; $type_col = 'allowance_types'; $percent_col = 'allowance_percent'; } elseif($type == 'deduction') { $name_col = 'deduction_names'; $val_col = 'deduction_amounts'; $val_class = 'deduction'; $type_col = 'deduction_types'; $percent_col = 'deduction_percent'; } $amount_type = !empty($amount_type) ? $amount_type : 'fixed'; $percent = $amount_type == 'percent' && !empty($percent) ? $percent : 0; @endphp {!! Form::text($name_col . '[]', !empty($name) ? $name : null, ['class' => 'form-control input-sm' ]); !!} {!! Form::select($type_col . '[]', ['fixed' => __('lang_v1.fixed'), 'percent' => __('lang_v1.percentage')], $amount_type, ['class' => 'form-control input-sm amount_type' ]); !!}
{!! Form::text($percent_col . '[]', @num_format($percent), ['class' => 'form-control input-sm input_number percent']); !!}
@php $readonly = $amount_type == 'percent' ? 'readonly' : ''; @endphp {!! Form::text($val_col . '[]', !empty($value) ? @num_format((float) $value) : 0, ['class' => 'form-control input-sm value_field input_number ' . $val_class, $readonly ]); !!} @if(!empty($add_button)) @endif