35 lines
1.1 KiB
PHP
35 lines
1.1 KiB
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\User;
|
|
use App\Models\EmployeeSalary;
|
|
use App\Models\PayrollEntry;
|
|
use App\Models\AttendanceRecord;
|
|
|
|
$user = User::where("name", "like", "%Donna%")->first();
|
|
if (!$user) {
|
|
echo "User not found\n";
|
|
exit;
|
|
}
|
|
|
|
echo "User: {$user->name} (ID: {$user->id})\n";
|
|
|
|
$salary = EmployeeSalary::where("employee_id", $user->id)->first();
|
|
echo "Salary configuration:\n";
|
|
print_r($salary ? $salary->toArray() : null);
|
|
|
|
$entry = PayrollEntry::where("employee_id", $user->id)->first();
|
|
echo "\nPayroll Entry in DB:\n";
|
|
print_r($entry ? $entry->toArray() : null);
|
|
|
|
$attendances = AttendanceRecord::where('employee_id', $user->id)
|
|
->whereBetween('date', ['2026-04-11', '2026-04-25'])
|
|
->get();
|
|
echo "\nAttendances count: " . $attendances->count() . "\n";
|
|
foreach ($attendances as $att) {
|
|
echo "Date: {$att->date}, hours: {$att->total_hours}, status: {$att->status}, is_absent: {$att->is_absent}, is_rest_day: {$att->is_rest_day}\n";
|
|
}
|