accounting workflows

This commit is contained in:
Thanakorn S
2026-05-20 10:17:02 +07:00
parent 04a683bd02
commit 7396db6ffc
199 changed files with 23539 additions and 5345 deletions
@@ -0,0 +1,20 @@
<?php
session_start();
require '../../../assets/utils/db_auth.php';
require '../../../assets/utils/classes_ac/TaxReportManager.php';
$from_date = trim((string)($data['from_date'] ?? ($data['from_period'] ?? date('Y-m-d'))));
$to_date = trim((string)($data['to_date'] ?? ($data['to_period'] ?? $from_date)));
$dept_id = (int)($data['department_id'] ?? 0);
$categories = $data['categories'] ?? [];
if (is_string($categories)) {
$decoded = json_decode($categories, true);
$categories = is_array($decoded) ? $decoded : [$categories];
}
if (!is_array($categories)) $categories = [];
$tax = new TaxReportManager($pdo2, $company_id);
$answer['success'] = 1;
$answer['output'] = $tax->getVATReport($from_date, $to_date, $categories, $dept_id);
exit(json_encode($answer));