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
+8 -13
View File
@@ -1,19 +1,14 @@
<?php
session_start();
require '../../../assets/utils/db_auth.php';
require '../../../assets/utils/classes/QuotationManager.php';
$sql = "SELECT
COUNT(*) AS total,
SUM(status = 0) AS draft,
SUM(status = 1) AS sent,
SUM(status = 2) AS accepted,
SUM(status = 3) AS rejected
FROM ac_quotation
WHERE company_id = :cid";
$sth = $pdo2->prepare($sql);
$sth->execute([':cid' => $company_id]);
$row = $sth->fetch(PDO::FETCH_ASSOC);
try {
$quotation = new QuotationManager($pdo2, $company_id);
$answer['output'] = $quotation->getStats();
$answer['success'] = 1;
} catch (Exception $e) {
$answer['message'] = $e->getMessage();
}
$answer['success'] = 1;
$answer['output'] = $row;
exit(json_encode($answer));