@extends('layouts/layoutMaster') @section('title', 'Salary Slip') @section('vendor-style') @vite('resources/assets/vendor/libs/flatpickr/flatpickr.scss') @endsection @section('page-style') @vite('resources/assets/vendor/scss/pages/app-invoice.scss') @endsection @section('vendor-script') @vite([ 'resources/assets/vendor/libs/moment/moment.js', 'resources/assets/vendor/libs/flatpickr/flatpickr.js', 'resources/assets/vendor/libs/cleavejs/cleave.js', 'resources/assets/vendor/libs/cleavejs/cleave-phone.js' ]) @endsection {{-- @section('page-script') @vite([ 'resources/assets/js/offcanvas-add-payment.js', 'resources/assets/js/offcanvas-send-invoice.js' ]) @endsection --}} @section('content')
@if(isset($company->user->profile_photo_url)) User Profile Photo @else
@endif {{-- --}} {{ $company->company_name }}

{{ $company->billing_address }}

{{--
Salary Slip
--}}
@php $months = [ 1 => 'Jan', 2 => 'Feb', 3 => 'Mar', 4 => 'Apr', 5 => 'May', 6 => 'Jun', 7 => 'Jul', 8 => 'Aug', 9 => 'Sep', 10 => 'Oct', 11 => 'Nov', 12 => 'Dec' ]; $monthName = $months[$dataSalary->month] ?? 'Invalid Month'; @endphp Payslip for the month
{{ $dataSalary->year }} {{ $monthName }}
{{-- {{dd($employee);}} --}}
Employee Summary

Employee name: {{ $employee->name }}

Employee no.: {{ $employee->phone_no }}

Employee email: {{ $employee->email }}

Pay Period: {{ $dataSalary->year }} {{ $monthName }}

Rs.{{ number_format($totalGrossEarnings,0) }}
Total Net Pay
@php $year = $dataSalary->year; // The specific year $month = $dataSalary->month; // The specific month (e.g., 1 for January, 2 for February) $daysInMonth = \Carbon\Carbon::createFromDate($year, $month)->daysInMonth; // dd($daysInMonth, $dataSalary->paid_days); $leaves = $daysInMonth - $dataSalary->paid_days; @endphp {{-- --}}
Paid Days : {{ $dataSalary->paid_days }}
LWP Days : {{ $leaves }}
LOP Days : 3
{{-- --}} @php $totalGrossEarnings = 0; @endphp @foreach ($allounces as $allounce) @php $totalGrossEarnings += $allounce->calculated_amount; @endphp @endforeach @php $totalGrossEarnings += $otherAllowance; // <-- ADD this line to include 'Other' in total @endphp @if(count($allounces) < count($deducations)) @for($i = 0; $i < (count($deducations) - count($allounces)); $i++) @endfor @endif
EARNINGS AMOUNT
Basic {{ number_format($dataSalary->basic_salary,2) }}
{{ $allounce->component_name }}{{ number_format($allounce->calculated_amount, 2) }}
Other{{ number_format($otherAllowance, 2) }}
 
@php $totalDeducations = 0; @endphp @foreach ($deducations as $deduct) @php $totalDeducations += $deduct->calculated_amount; @endphp @endforeach @if(count($deducations) < count($allounces)) @for($i = 0; $i < (count($allounces) - count($deducations)); $i++) @endfor @endif
DEDUCTIONS AMOUNT
{{ $deduct->component_name }}{{ number_format($deduct->calculated_amount,2) }}
 
Gross Earnings {{ number_format($totalGrossEarnings, 2) }}
Total Deductions {{ number_format($totalDeducations, 2) }}

Total Net Payable
Gross Earnings - Total Deductions
Rs.{{ number_format($dataSalary->net_salary + $otherAllowance + $dataSalary->leave_deduction,0) }}

{{-- Note: It was a pleasure working with you and your team. We hope you will keep us in mind for future freelance projects. Thank You! --}}
{{-- --}}
{{-- {{ route('app-salarySlip-print', ['id' => $dataSalary->id]) }} --}} Print
{{-- --}}
@include('_partials/_offcanvas/offcanvas-send-invoice') @include('_partials/_offcanvas/offcanvas-add-payment') @endsection