<?php
require dirname(__DIR__) . '/vendor/autoload.php';
$app = require_once dirname(__DIR__) . '/bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$kernel->bootstrap();

use App\Models\Reservation;
use App\Models\Order;
use App\Models\Payment;
use App\Models\ServiceRequest;

echo "Rooms (Checked-out) Pending Sync: " . Reservation::where('status', 'checked_out')->where('accounting_synced', false)->count() . "\n";
echo "POS (Completed) Pending Sync: " . Order::where('status', 'completed')->where('accounting_synced', false)->count() . "\n";
echo "Payments (Completed) Pending Sync: " . Payment::where('status', 'completed')->where('accounting_synced', false)->count() . "\n";
echo "Services (Completed) Pending Sync: " . ServiceRequest::where('status', 'completed')->where('accounting_synced', false)->count() . "\n";

echo "\nSummary of data:\n";
echo "Total Payments: " . Payment::where('status', 'completed')->sum('amount') . "\n";
echo "Total Room Revenue (Checked out): " . Reservation::where('status', 'checked_out')->sum('total_amount') . "\n";
echo "Total POS Revenue: " . Order::where('status', 'completed')->sum('total_amount') . "\n";
