chore: update document approval workflow and bug fixes

This commit is contained in:
2026-05-25 13:05:20 +08:00
parent d573c02893
commit 39a8e1d4cd
910 changed files with 49994 additions and 1010 deletions

13
test_po2.php Normal file
View File

@@ -0,0 +1,13 @@
<?php
$c = \Modules\ApprovalWorkflow\Models\ApprovalChain::where('approvable_type', \Modules\MaterialLogistics\Models\PurchaseOrder::class)->first();
if ($c) {
if ($c->approvable && method_exists($c->approvable, 'items')) {
$c->approvable->load('items');
$c->approvable->append('total_cost');
}
// Simulate what Inertia sends
echo json_encode(['chain' => $c->toArray()], JSON_PRETTY_PRINT);
} else {
echo "No PO found.";
}