38808-vm/api/get_journal_entry.php
2026-03-12 07:11:31 +00:00

15 lines
439 B
PHP

<?php
require_once __DIR__ . '/../db/config.php';
require_once __DIR__ . '/../includes/accounting_functions.php';
header('Content-Type: application/json');
$id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
if ($id > 0) {
$data = get_journal_entry_details($id);
if ($data) {
echo json_encode(['success' => true, 'data' => $data]);
exit;
}
}
echo json_encode(['success' => false, 'error' => 'Entry not found.']);