@extends('layouts.sidebar') @section('title', 'Payroll') @section('content') @if (in_array('Payroll Checking', $privileges) || in_array('Payroll Approve', $privileges))

ALL TRADE MANPOWER, INC.

{{ $data->client->business_name }} Summary Payroll report with Batch ID: {{ $batch_id }}

Period Cover: {{ \Carbon\Carbon::parse($data->pay_period_start)->format('F j, Y') }} to {{ \Carbon\Carbon::parse($data->pay_period_end)->format('F j, Y') }}

@if (session('success'))
{{ session('success') }}
@endif {{--
Deduction List >
--}}
ID Employee Name Rate Earnings Deductions netpay Action
Total 0 0 0 0

SUMMARY

{{-- Loop through trxConstantDeductions first --}} @php $totalEarnings = 0; $totalDeductions = 0; @endphp @foreach ($payrolls as $payroll) @foreach ($payroll->othersForPayroll as $earning) @endforeach @endforeach @foreach ($payrolls as $payroll) @foreach ($payroll->trxConstantDeductions as $earning) @endforeach @endforeach {{-- Loop through trxLoanDeductions after --}} @foreach ($payrolls as $payroll) @foreach ($payroll->trxLoanDeductions as $deduction) @endforeach @endforeach
Trx ID Trx Name Earnings Deduction
{{ $earning->id }} {{ $earning->name }} ₱{{ number_format($earning->amount, 2) }} @php $totalEarnings += $earning->amount; @endphp
{{ $earning->trxConstant->group_code_id }} {{-- Use optional() to avoid errors when trx_code is null --}} {{ optional(App\Models\TrxCode::find($earning->trxConstant->group_code_id))->description }} @if ($earning->status == 1) ₱{{ number_format($earning->E_Amount, 2) }} @php $totalEarnings += $earning->E_Amount; @endphp @endif @if ($earning->status == null) ₱{{ number_format($earning->E_Amount, 2) }} @php $totalDeductions += $earning->E_Amount; @endphp @endif
{{ $deduction->trxLoan->group_code_id }} {{-- Use optional() to avoid errors when trx_code is null --}} {{ optional(App\Models\TrxCode::find($deduction->trxLoan->group_code_id))->description }} ₱{{ number_format($deduction->Amount, 2) }} @php $totalDeductions += $deduction->Amount; @endphp
Total ₱{{ number_format($totalEarnings, 2) }} ₱{{ number_format($totalDeductions, 2) }}
@csrf @if ($data->status == '0')
@endif @if (in_array('Payroll Approve', $privileges)) @if ($data->status == '1')
@endif @else @endif
@if ($data->status !== '0')
@if ($prepared && $prepared->user)

Prepared By: {{ $prepared->user->name }}

@endif @if ($approved && $approved->user)

Approved By: {{ $approved->user->name }}

@endif
@endif @include('Admin.Payroll.payrollbatch.modal') @else
You don't have privilege to access this page
@endif @endsection