@php if($type == 'allowance') { $name_col = 'payrolls['.$employee.'][allowance_names]'; $val_col = 'payrolls['.$employee.'][allowance_amounts]'; $val_class = 'allowance'; $type_col = 'payrolls['.$employee.'][allowance_types]'; $percent_col = 'payrolls['.$employee.'][allowance_percent]'; } elseif($type == 'deduction') { $name_col = 'payrolls['.$employee.'][deduction_names]'; $val_col = 'payrolls['.$employee.'][deduction_amounts]'; $val_class = 'deduction'; $type_col = 'payrolls['.$employee.'][deduction_types]'; $percent_col = 'payrolls['.$employee.'][deduction_percent]'; } $amount_type = !empty($amount_type) ? $amount_type : 'fixed'; $percent = $amount_type == 'percent' && !empty($percent) ? $percent : 0; @endphp