@extends('admin.layout') @section('content')

Salary Management

{{-- FILTER FORM --}}
{{-- SALARY FORM FOR EACH WORKER --}} @foreach($workers as $worker) @php $sal = $worker->monthly_salary; $allowance = app\Models\Allowance::where('worker_id','=',$worker->id)->where('year','=',$year)->where('month','=',$month)->sum('amount'); $deduction = app\Models\Deduction::where('worker_id','=',$worker->id)->where('year','=',$year)->where('month','=',$month)->sum('amount'); @endphp @csrf @endforeach
Worker Gross Salary Allowance Deduction Net Salary Action
{{ $worker->name }} {{ $sal+$allowance }} {{ $allowance }} {{ $deduction }} {{ $sal+$allowance-$deduction }} @if($sal) Print @endif
@endsection