commit compras4 2711
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-27 19:13:31 +02:00
parent 9cf9764710
commit 7486007fcf
41 changed files with 1270 additions and 66 deletions
+4 -1
View File
@@ -183,10 +183,13 @@ class RequisitionWorkflow
*/
public function audit(User $user, string $action, ?Requisition $requisition, ?array $before, array $after): void
{
if (app(RequisitionExpiryRun::class)->tenantId() !== null) {
$after += ['execution' => app(RequisitionExpiryRun::class)->evidence()];
}
AuditLog::query()->create([
'tenant_id' => $user->tenant_id, 'user_id' => $user->id,
'requisition_id' => $requisition?->id, 'action' => $action,
'ip_address' => app(ReplenishmentRun::class)->tenantId() === null ? request()->ip() : null, 'before' => $before, 'after' => $after + (app(ReplenishmentRun::class)->tenantId() === null ? [] : ['execution' => app(ReplenishmentRun::class)->evidence()]),
'ip_address' => app(ReplenishmentRun::class)->tenantId() === null && app(RequisitionExpiryRun::class)->tenantId() === null ? request()->ip() : null, 'before' => $before, 'after' => $after + (app(ReplenishmentRun::class)->tenantId() === null ? [] : ['execution' => app(ReplenishmentRun::class)->evidence()]),
]);
}
}