@php use Carbon\Carbon; $isEmployeeView = request()->routeIs('employee.payslip.view'); $monthLabel = Carbon::create(null, $payslip->salary_month, null)->format('F'); $fmt = static fn ($amount) => number_format((float) $amount, 2); $showAmt = static fn ($amount) => (float) $amount > 0; $payrollAdjustments = $payslip->payrollAdjustments ?? collect(); $variableAllowances = is_array($payslip->variable_allowances) ? $payslip->variable_allowances : []; $customAllowances = $salary->normalizedCustomAllowances(); $payrollIncomeTax = (float) ($payslip->income_tax ?? 0); $customDeductionsForDisplay = collect($salary->normalizedCustomDeductions())->filter(function (array $row) use ($payrollIncomeTax) { if ((float) ($row['amount'] ?? 0) <= 0) { return false; } if (\App\Models\SalarySetup::labelIsIncomeTax((string) ($row['label'] ?? ''))) { return $payrollIncomeTax <= 0; } return true; }); @endphp {{ __('Payslip') }} — {{ $monthLabel }} {{ $payslip->salary_year }} @include('admin.payslip.partials.payslip_styles')
← {{ __('Back') }}
@if(get_setting('system_logo_white')) {{ get_setting('site_name') }} @else {{ get_setting('site_name') }} @endif
{{ $staff->warehouse?->address ?? '' }}

{{ __('Payslip for :month :year', ['month' => $monthLabel, 'year' => $payslip->salary_year]) }}

@if(!empty($payslip->period_start_date) && !empty($payslip->period_end_date))

{{ __('Attendance period') }}: {{ Carbon::parse($payslip->period_start_date)->format('d M Y') }} – {{ Carbon::parse($payslip->period_end_date)->format('d M Y') }}

@endif

{{ __('Employee information') }}

{{ __('Employee name') }}
{{ $staff->user?->name ?? '—' }}
{{ __('Employee code') }}
{{ $staff->displaySid() }}
{{ __('Designation') }}
{{ $staff->designation?->name ?? '—' }}
{{ __('Join date') }}
{{ $staff->joing_date ? date('d M Y', strtotime($staff->joing_date)) : '—' }}
{{ __('Branch / warehouse') }}
{{ $staff->warehouse?->name ?? '—' }}
{{ __('Department') }}
{{ $staff->department?->name ?? '—' }}
@if(\App\Services\PayrollIncomeTaxService::enabled() && (int) get_setting('payroll_tax_show_tin') === 1 && !empty($salary->tin_number))
{{ __('TIN') }}
{{ $salary->tin_number }}
@endif

{{ __('Earnings & deductions') }}

@if($showAmt($salary->basic_salary)) @endif @if($showAmt($salary->house_rent)) @endif @if($showAmt($salary->medical)) @endif @if($showAmt($salary->food)) @endif @if($showAmt($salary->conveyance)) @endif @if($showAmt($salary->utility)) @endif @if($showAmt($salary->Others)) @endif @foreach($customAllowances as $customAllow) @if((float) ($customAllow['amount'] ?? 0) > 0) @endif @endforeach @if((float) ($payslip->bonus_amount ?? 0) > 0) @endif @if((float) ($payslip->arrear_amount ?? 0) > 0) @endif @if($payrollAdjustments->isNotEmpty()) @foreach($payrollAdjustments as $adjRow) @if($showAmt($adjRow->amount)) @if($adjRow->adjustment_type === 'deduction') @else @endif @endif @endforeach @elseif((float) ($payslip->adjustment_amount ?? 0) != 0) @endif @foreach($variableAllowances as $varKey => $varAmt) @if((float) $varAmt > 0) @endif @endforeach @if($payslip->total_leave_without_pay > 0) @endif @if($payslip->late_attendance > 0) @endif @foreach($customDeductionsForDisplay as $customDed) @endforeach @if($payslip->provident_fund > 0) @endif @if($payslip->total_absent > 0) @endif @if($payslip->advance_salary_received_id != null) @foreach(json_decode($payslip->advance_salary_received_id, true) as $advance_salary_recevied_id) @php $advance_salary_payment = \App\Models\advance_salary_received::where('id', $advance_salary_recevied_id)->first(); @endphp @if($advance_salary_payment && $showAmt($advance_salary_payment->amount)) @endif @endforeach @endif @if(!empty($payslip->pf_loan_deduction) && $payslip->pf_loan_deduction > 0) @endif @if(!empty($payslip->swf_employee_contribution) && $payslip->swf_employee_contribution > 0) @endif @if(!empty($payslip->swf_loan_deduction) && $payslip->swf_loan_deduction > 0) @endif @if(\App\Services\PayrollIncomeTaxService::enabled() && (float) ($payslip->taxable_income ?? 0) > 0) @endif @if($payrollIncomeTax > 0) @endif
{{ __('Particulars') }} {{ __('Amount (+)') }} {{ __('Amount (−)') }}
{{ __('Basic') }}{{ $fmt($salary->basic_salary) }}
{{ __('House allowance') }}{{ $fmt($salary->house_rent) }}
{{ __('Medical allowance') }}{{ $fmt($salary->medical) }}
{{ __('Food allowance') }}{{ $fmt($salary->food) }}
{{ __('Conveyance allowance') }}{{ $fmt($salary->conveyance) }}
{{ __('Utility allowance') }}{{ $fmt($salary->utility) }}
{{ __('Others allowance') }}{{ $fmt($salary->Others) }}
{{ $customAllow['label'] ?: __('Other allowance') }} {{ $fmt($customAllow['amount']) }}
{{ __('Bonus') }}{{ $fmt($payslip->bonus_amount) }}
{{ __('Arrear') }}{{ $fmt($payslip->arrear_amount) }}
{{ __('Payroll adjustments') }}
{{ $adjRow->adjustment_type === 'deduction' ? __('Deduction') : __('Addition') }} @if($adjRow->remarks)
{{ $adjRow->remarks }}
@endif
{{ $fmt($adjRow->amount) }}{{ $fmt($adjRow->amount) }}
{{ __('Payroll adjustment (net)') }} {{ (float) $payslip->adjustment_amount > 0 ? $fmt($payslip->adjustment_amount) : '—' }} {{ (float) $payslip->adjustment_amount < 0 ? $fmt(abs((float) $payslip->adjustment_amount)) : '—' }}
{{ \App\Services\SalaryStructureService::labelForBreakdownKey($varKey) }} {{ $fmt($varAmt) }}
{{ __('Deductions') }}
{{ __('Unpaid leave') }} [{{ $payslip->total_leave_without_pay }} {{ __('Days') }}] {{ $fmt($payslip->total_leave_without_pay * $payslip->perday_salary) }}
{{ __('Extra delay') }} [{{ $payslip->late_attendance }} {{ __('Days') }}] {{ $fmt($payslip->late_attendance * $payslip->perday_salary) }}
{{ $customDed['label'] ?: __('Other deduction') }} {{ $fmt($customDed['amount']) }}
{{ __('Provident fund') }}{{ $fmt($payslip->provident_fund) }}
{{ __('Absent') }} ({{ $payslip->total_absent }} × {{ $fmt($payslip->perday_salary) }}) {{ $fmt($payslip->total_absent * $payslip->perday_salary) }}
{{ __('Advance salary') }} ({{ $advance_salary_payment->month }}-{{ $advance_salary_payment->year }} {{ __('Payment') }}) {{ $fmt($advance_salary_payment->amount) }}
{{ __('PF loan deduction') }}{{ $fmt($payslip->pf_loan_deduction) }}
{{ __('Staff welfare fund (employee)') }}{{ $fmt($payslip->swf_employee_contribution) }}
{{ __('SWF loan deduction') }}{{ $fmt($payslip->swf_loan_deduction) }}
{{ __('Taxable income') }}{{ $fmt($payslip->taxable_income) }}
{{ \App\Services\PayrollIncomeTaxService::enabled() ? \App\Services\PayrollIncomeTaxService::label() : __('Income tax') }}{{ $fmt($payrollIncomeTax) }}
{{ __('Sub total') }} {{ $fmt($payslip->gross_salary) }} {{ $fmt($payslip->total_deductions) }}

{{ __('Salary summary') }}

{{ __('Earnings') }}
{{ $fmt($payslip->gross_salary) }}
{{ __('Deductions') }}
{{ $fmt($payslip->total_deductions) }}
{{ __('Net salary') }}
{{ $fmt($payslip->net_salary) }}
@if((int) get_setting('payslip_seal') === 1)

{{ __('HR name') }}

{{ __('HR designation') }}

@if(get_setting('company_seal')) {{ __('Company seal') }} @endif
@endif