@extends('layouts.master') @section('title', $title) @php $settings = \App\Models\Setting::pluck('value','name')->toArray(); /* ================= TOTAL CALCULATIONS ================= */ $totalBasic = $salary_details->sum('basic_salary'); $totalAllowance = $salary_details->sum('allowance'); $totalDeduction = $salary_details->sum('deductions'); $totalNet = $salary_details->sum(function ($d) { return $d->basic_salary + $d->allowance - $d->deductions; }); @endphp @section('content')
Salary Statement
Print

Payroll – Salary Statement

{{ month_format($salary_head->month) }}
Total Basic {{ number_format($totalBasic,2) }} Total Allowance {{ number_format($totalAllowance,2) }}
Total Deductions {{ number_format($totalDeduction,2) }} Total Net {{ number_format($totalNet,2) }}
@php($i=1) @foreach($salary_details as $d) @php($net = $d->basic_salary + $d->allowance - $d->deductions) @endforeach
# Staff Phone Grade Branch Basic Allowance Deductions Net
{{ $i++ }} {{ $d->staff?->name }} {{ $d->staff?->phone_number }} {{ $d->staff?->gd?->name }} {{ $d->staff?->branch?->name }} {{ number_format($d->basic_salary,2) }} {{ number_format($d->allowance,2) }} {{ number_format($d->deductions,2) }} {{ number_format($net,2) }}
@endsection