commit14
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user