chore: update document approval workflow and bug fixes
This commit is contained in:
13
test_po2.php
Normal file
13
test_po2.php
Normal 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.";
|
||||
}
|
||||
Reference in New Issue
Block a user