This commit is contained in:
2026-11-02 20:27:11 +02:00
parent b44378b899
commit badaada043
300 changed files with 17458 additions and 1056 deletions
@@ -89,7 +89,7 @@ final class Controller
$record = $port->load($id);
$port->authorize('view', $record);
return ['record' => $this->project($port, $record), 'history' => $port->query('events')->where('request_id', $id)->orderBy('version')->get()];
return ['record' => $this->project($port, $record), 'history' => $port->query('events')->where('request_id', $id)->orderBy('version')->get(), 'canSourcing'=>config('purchasing-sourcing.enabled')===true&&$record['status']==='approved'];
});
return response()->json($result)->header('Cache-Control', 'private, no-store');
@@ -159,7 +159,7 @@ final class Controller
$selection = $request->session()->get('company_context', []);
$scope = $port->scope();
$contract = ['csrf' => csrf_token(), 'token' => $selection['token'] ?? '', 'scope' => $scope, 'context' => 'procurement.internal', 'actor_id' => $port->actorId(),
'company' => DB::table('companies')->where('id', $scope['company_id'])->value('name'), 'unit' => DB::table('units')->where('id', $scope['unit_id'])->value('name')];
'company' => DB::table('companies')->where('id', $scope['company_id'])->value('name'), 'unit' => DB::table('units')->where('id', $scope['unit_id'])->value('name'), 'canBudgetSetup' => app(Permissions::class)->has($port->actorId(), $scope['tenant_id'], $scope['company_id'], 'purchasing_budget.view', $scope['unit_id'])];
ob_start();
require __DIR__.'/screen.php';
$html = ob_get_clean();