22 lines
539 B
PHP
22 lines
539 B
PHP
<?php
|
|
require_once __DIR__ . '/../../../session.php';
|
|
require_once '../../../assets/utils/db_auth.php';
|
|
require_once '../../../assets/utils/classes_ac/ChartOfAccounts.php';
|
|
|
|
$id = (int)($data['id'] ?? 0);
|
|
if (!$id) {
|
|
$answer['message'] = 'Missing id';
|
|
exit(json_encode($answer));
|
|
}
|
|
|
|
$coa = new ChartOfAccounts($pdo2, $company_id);
|
|
$row = $coa->getById($id);
|
|
if (!$row) {
|
|
$answer['message'] = 'Account not found';
|
|
exit(json_encode($answer));
|
|
}
|
|
|
|
$answer['output'] = $row;
|
|
$answer['success'] = 1;
|
|
exit(json_encode($answer));
|