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

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

{!! Form::open(['url' => action('\Modules\Essentials\Http\Controllers\PayrollController@update', [$payroll->id]), 'method' => 'put', 'id' => 'add_payroll_form' ]) !!}
@component('components.widget')

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


{!! Form::label('essentials_duration', __( 'essentials::lang.total_work_duration' ) . ':*') !!} {!! Form::text('essentials_duration', $payroll->essentials_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', $payroll->essentials_duration_unit, ['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', @num_format($payroll->essentials_amount_per_unit_duration), ['class' => 'form-control input_number', 'placeholder' => __( 'essentials::lang.amount_per_unit_duartion' ), 'required' ]); !!}
{!! Form::label('total', __( 'sale.total' ) . ':') !!} {!! Form::text('total', @num_format($payroll->essentials_duration * $payroll->essentials_amount_per_unit_duration), ['class' => 'form-control input_number', 'placeholder' => __( 'sale.total' ) ]); !!}
@endcomponent
@component('components.widget')

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

@php $total_allowances = 0; @endphp @forelse($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' => !empty($allowances['allowance_types'][$key]) ? $allowances['allowance_types'][$key] : 'fixed', 'percent' => !empty($allowances['allowance_percents'][$key]) ? $allowances['allowance_percents'][$key] : 0]) @php $total_allowances += !empty($allowances['allowance_amounts'][$key]) ? $allowances['allowance_amounts'][$key] : 0; @endphp @empty @include('essentials::payroll.allowance_and_deduction_row', ['add_button' => true, 'type' => 'allowance']) @endforelse
@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 @forelse($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' => !empty($deductions['deduction_types'][$key]) ? $deductions['deduction_types'][$key] : 'fixed', 'percent' => !empty($deductions['deduction_percents'][$key]) ? $deductions['deduction_percents'][$key] : 0 ]) @php $total_deductions += !empty($deductions['deduction_amounts'][$key]) ? $deductions['deduction_amounts'][$key] : 0; @endphp @empty @include('essentials::payroll.allowance_and_deduction_row', ['add_button' => true, 'type' => 'deduction']) @endforelse
@lang('essentials::lang.deduction') @lang('essentials::lang.amount_type') @lang('sale.amount')  
@lang('sale.total') {{$total_deductions}}  
@endcomponent

@lang('essentials::lang.gross_amount'): {{$payroll->final_total}}

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