@extends('layouts.app') @section('title', __( 'essentials::lang.add_payroll' )) @section('content')

@lang( 'essentials::lang.add_payroll' )

{!! Form::open(['url' => action('\Modules\Essentials\Http\Controllers\PayrollController@store'), 'method' => 'post', 'id' => 'add_payroll_form' ]) !!} {!! Form::hidden('expense_for', $employee->id); !!} {!! Form::hidden('transaction_date', $transaction_date); !!}
@component('components.widget')

{!! __('essentials::lang.payroll_of_employee', ['employee' => $employee->user_full_name, 'date' => $month_name . ' ' . $year]) !!}


{!! Form::label('essentials_duration', __( 'essentials::lang.total_work_duration' ) . ':*') !!} {!! Form::text('essentials_duration', $total_work_duration, ['class' => 'form-control input_number', 'placeholder' => __( 'essentials::lang.total_work_duration' ), 'required' ]); !!}
{!! Form::label('essentials_duration_unit', __( 'essentials::lang.duration_unit' ) . ':') !!} {!! Form::text('essentials_duration_unit', 'Hour', ['class' => 'form-control', 'placeholder' => __( 'essentials::lang.duration_unit' ) ]); !!}
{!! Form::label('essentials_amount_per_unit_duration', __( 'essentials::lang.amount_per_unit_duartion' ) . ':*') !!} {!! Form::text('essentials_amount_per_unit_duration', 0, ['class' => 'form-control input_number', 'placeholder' => __( 'essentials::lang.amount_per_unit_duartion' ), 'required' ]); !!}
{!! Form::label('total', __( 'sale.total' ) . ':') !!} {!! Form::text('total', 0, ['class' => 'form-control input_number', 'placeholder' => __( 'sale.total' ) ]); !!}
@endcomponent
@component('components.widget')

@lang('essentials::lang.allowances'):

@php $total_allowances = 0; @endphp @if(!empty($allowances)) @foreach($allowances['allowance_names'] as $key => $value) @include('essentials::payroll.allowance_and_deduction_row', ['add_button' => $loop->index == 0 ? true : false, 'type' => 'allowance', 'name' => $value, 'value' => $allowances['allowance_amounts'][$key], 'amount_type' => $allowances['allowance_types'][$key], 'percent' => $allowances['allowance_percents'][$key] ]) @php $total_allowances += $allowances['allowance_amounts'][$key]; @endphp @endforeach @else @include('essentials::payroll.allowance_and_deduction_row', ['add_button' => true, 'type' => 'allowance']) @include('essentials::payroll.allowance_and_deduction_row', ['type' => 'allowance']) @include('essentials::payroll.allowance_and_deduction_row', ['type' => 'allowance']) @endif
@lang('essentials::lang.allowance') @lang('essentials::lang.amount_type') @lang('sale.amount')  
@lang('sale.total') {{$total_allowances}}  
@endcomponent
@component('components.widget')

@lang('essentials::lang.deductions'):

@php $total_deductions = 0; @endphp @if(!empty($deductions)) @foreach($deductions['deduction_names'] as $key => $value) @include('essentials::payroll.allowance_and_deduction_row', ['add_button' => $loop->index == 0 ? true : false, 'type' => 'deduction', 'name' => $value, 'value' => $deductions['deduction_amounts'][$key], 'amount_type' => $deductions['deduction_types'][$key], 'percent' => $deductions['deduction_percents'][$key]]) @php $total_deductions += $deductions['deduction_amounts'][$key]; @endphp @endforeach @else @include('essentials::payroll.allowance_and_deduction_row', ['add_button' => true, 'type' => 'deduction']) @include('essentials::payroll.allowance_and_deduction_row', ['type' => 'deduction']) @include('essentials::payroll.allowance_and_deduction_row', ['type' => 'deduction']) @endif
@lang('essentials::lang.deduction') @lang('essentials::lang.amount_type') @lang('sale.amount')  
@lang('sale.total') {{$total_deductions}}  
@endcomponent

@lang('essentials::lang.gross_amount'): 0


{!! Form::hidden('final_total', 0, ['id' => 'gross_amount']); !!}
{!! Form::close() !!} @stop @section('javascript') @includeIf('essentials::payroll.form_script') @endsection