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
+5 -4
View File
@@ -4,7 +4,8 @@
require_role($user_role, ['owner', 'admin', 'staff']);
require '../../../assets/utils/classes/InvoiceManager.php';
$id = (int)($data['id'] ?? 0);
$id = (int)($data['id'] ?? ($data['invoice_id'] ?? 0));
$due_date = trim((string)($data['due_date'] ?? ''));
if (!$id) {
$answer['message'] = 'Invalid ID.';
@@ -13,9 +14,9 @@
}
try {
dbTransaction($pdo2, function($pdo) use ($id, $company_id, $logging) {
dbTransaction($pdo2, function($pdo) use ($id, $due_date, $company_id, $logging) {
$inv = new InvoiceManager($pdo, $company_id);
$inv->issueInvoice($id, $logging);
$inv->issueInvoice($id, $logging, $due_date ?: null);
});
$answer['success'] = 1;
@@ -31,4 +32,4 @@
}
exit(json_encode($answer));
?>
?>