<?php
require_once __DIR__ . '/../app/bootstrap.php';
use App\Core\PosService; use App\Core\Response;
PosService::requireAccess('public/login.php');
$id = (int)($_GET['id'] ?? 0);
$vendorId = PosService::resolveVendorId((int)($_GET['vendor_id'] ?? 0));
$data = ($id > 0 && $vendorId) ? PosService::receipt($id, $vendorId) : null;
Response::json($data ? ['ok'=>true,'receipt'=>$data] : ['ok'=>false,'message'=>'Receipt not found.'], $data ? 200 : 404);
