<?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\JournalEntry;

$entries = JournalEntry::whereIn('entry_number', ['JE-202603-0001', 'JE-202603-0002'])->with('items.account')->get();
foreach ($entries as $e) {
    echo "Entry: {$e->entry_number} | {$e->description} | {$e->date}\n";
    foreach ($e->items as $i) {
        $a = $i->account;
        echo " - Account: {$a->code} | {$a->name} | Section: {$a->report_section} | Category: {$a->category} | Dr: {$i->debit} | Cr: {$i->credit}\n";
    }
}
