@extends('admin.master') @section('content') @section('title','Generate Salary Sheet')
@yield('title')
@if($errors->any()) @endif @if(session()->has('success'))
 {{ session()->get('success') }}
@endif @if(session()->has('error'))
 {{ session()->get('error') }}
@endif {{ Form::open(array('route' => 'generateSalarySheet.calculateEmployeeSalary','method'=>'GET','id'=>'calculateEmployeeSalaryForm')) }}
{{ Form::select('employee_id',$employeeList, (isset($employee_id)) ? $employee_id : '', array('class' => 'form-control employee_id select2 required')) }}
{!! Form::text('month', (isset($month)) ? $month : '', $attributes = array('class'=>'form-control required monthField','id'=>'month','placeholder'=>'Enter month')) !!}
{{ Form::close() }}
@php $netSalary = 0; $totalOvertimeAmount = 0; $totalDeduction = 0; $sumOfTotalDeduction = 0; @endphp @if(isset($employeeDetails) || isset($allowances)) @php $gross_salary = $employeeGrossSalary; $basic_salary = $employeeDetails->payGrade->basic_salary; $total_allowances = 0; if(nCount($allowances['allowanceArray'] ) > 0){ foreach($allowances['allowanceArray'] as $a){ $total_allowances +=$a['amount_of_allowance']; } } $net_salary = $basic_salary + $total_allowances; if($net_salary > $gross_salary){ $basic_salary = $basic_salary - ($net_salary - $gross_salary); }else{ $basic_salary += $gross_salary - ($basic_salary + $total_allowances); } @endphp
Salary sheet/ Final Balance
{{ Form::open(array('route' => 'saveEmployeeSalaryDetails.store')) }}

@if(nCount($allowances['allowanceArray'] ) > 0) @foreach($allowances['allowanceArray'] as $allowance) @php $netSalary += $allowance['amount_of_allowance']; @endphp @endforeach @endif @php $netSalary -= $tax; $sumOfTotalDeduction += $tax; @endphp @php $companyTaxDeduction = 0; $companyTaxDeduction = ($tax * 70) / 100; $employeeTaxDeduction = 0; $employeeTaxDeduction = ($tax * 30) / 100; @endphp @if(nCount($deductions['deductionArray']) > 0) @foreach($deductions['deductionArray'] as $deduction) @php $totalDeduction+= $deduction['amount_of_deduction'];@endphp @php $netSalary -= $deduction['amount_of_deduction']; $sumOfTotalDeduction+=$deduction['amount_of_deduction']; @endphp @endforeach @endif @if($employeeAllInfo['totalLateAmount'] != 0) @php $netSalary -= $employeeAllInfo['totalLateAmount']; $sumOfTotalDeduction +=$employeeAllInfo['totalLateAmount']; @endphp @endif @if($employeeAllInfo['totalAbsenceAmount'] != 0) @php $netSalary -= $employeeAllInfo['totalAbsenceAmount']; $sumOfTotalDeduction +=$employeeAllInfo['totalAbsenceAmount']; @endphp @endif @if($employeeAllInfo['totalOvertimeAmount'] != 0) @php $netSalary += $employeeAllInfo['totalOvertimeAmount']; $totalOvertimeAmount +=$employeeAllInfo['totalOvertimeAmount']; @endphp @endif
Name : {{$employeeDetails->first_name}} {{$employeeDetails->last_name}}
Department : @if(isset($employeeDetails->department->department_name)) {{$employeeDetails->department->department_name}} @endif
Designation : @if(isset($employeeDetails->designation->designation_name)) {{$employeeDetails->designation->designation_name}} @endif
Joining Date : {{date(" d-M-Y", strtotime($employeeDetails->date_of_joining))}}
Basic salary of the month : {{number_format( $basic_salary) }} @php $netSalary += $basic_salary; @endphp
{{$allowance['allowance_name']}}: {{number_format($allowance['amount_of_allowance'])}}
Net salary : {{number_format($netSalary)}}
Taxable salary : {{number_format($taxAbleSalary)}}
Income tax to pay for the month : {{number_format($tax)}}
Company tax deduction : {{number_format(round($companyTaxDeduction))}}
Employee tax payable: {{number_format(round($employeeTaxDeduction))}}
{{$deduction['deduction_name']}} : {{number_format($deduction['amount_of_deduction'])}}
Late Amount : {{number_format($employeeAllInfo['totalLateAmount'])}}
Absence Amount : {{number_format($employeeAllInfo['totalAbsenceAmount'])}}
Over Time : {{number_format($employeeAllInfo['totalOvertimeAmount'])}}
Net salary to be paid : {{number_format($netSalary)}}
Total income tax deducted for the financial year : {{number_format($financialYearTax->totalTax)}}
{{----}} {{----}} {{----}} {{----}} @if($employeeAllInfo['dayOfSalaryDeduction'] !=0) @endif @if($employeeAllInfo['totalOvertimeAmount'] !=0) @endif @if(nCount($leaveRecords) > 0) @foreach($leaveRecords as $leaveRecord) @endforeach @endif
No. : 1
Month : {{convartMonthAndYearToWord($month)}}
Number of working days : {{$employeeAllInfo['totalWorkingDays']}}
Number of day worked in the month : {{$employeeAllInfo['totalPresent']}}
Number of govt. holiday worked in the month : 10
Unjustified absence : {{$employeeAllInfo['totalAbsence']}}
Per day salary : {{number_format($employeeAllInfo['oneDaysSalary'])}}
Salary deduction for late attendance : {{$employeeAllInfo['dayOfSalaryDeduction']}}
Over Time : {{$employeeAllInfo['totalOverTimeHour']}}
Over Rate : {{$employeeAllInfo['overtime_rate']}}
{{$leaveRecord->leave_type_name}} : {{$leaveRecord->number_of_day}}

{{ Form::close() }}
@endif
@endsection @section('page_scripts') @endsection