Files
HRM-System/scratch/verify_backfill.php

24 lines
800 B
PHP

<?php
require __DIR__ . '/../vendor/autoload.php';
$app = require_once __DIR__ . '/../bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$kernel->bootstrap();
use App\Models\PayrollEntry;
use App\Models\User;
$entries = PayrollEntry::where('overtime_hours', '>', 0)
->orWhere('overtime_amount', '>', 0)
->with('employee')
->get();
echo "Verified Backfilled Payroll Entries:\n";
echo "====================================\n";
if ($entries->isEmpty()) {
echo "No payroll entries found with overtime.\n";
} else {
foreach ($entries as $entry) {
echo "- Employee: {$entry->employee->name} | Basic: {$entry->basic_salary} | OT Hours: {$entry->overtime_hours} | OT Amount: {$entry->overtime_amount} | Net Pay: {$entry->net_pay}\n";
}
}