Files
HRM-System/scratch/check_ana_payslip.php

37 lines
1.0 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\Services\PayrollService;
$user = User::where('name', 'Ana Regina Mariano')->first();
if (!$user) {
die("User not found\n");
}
$startDate = '2026-05-11';
$endDate = '2026-05-25';
$service = new PayrollService();
$result = $service->calculateForPeriod($user->employee, $startDate, $endDate);
echo "Employee: " . $user->name . "\n";
echo "Basic Salary: " . $result['basic_salary'] . "\n";
echo "Total Earnings: " . $result['total_earnings'] . "\n";
echo "Net Pay: " . $result['net_pay'] . "\n";
echo "\nEarnings Breakdown:\n";
foreach($result['earnings'] as $e) {
echo " - " . $e['name'] . ": " . $e['amount'] . "\n";
}
echo "\nDeductions Breakdown:\n";
foreach($result['deductions'] as $d) {
echo " - " . $d['name'] . ": " . $d['amount'] . "\n";
}
echo "\nSummary:\n" . json_encode($result['summary'], JSON_PRETTY_PRINT) . "\n";