$groupId = (int) $session->get('group_id');
$adminId = (int) $session->get('admin_id');
- if (!Yii::$app->user->can("write-offs-docslist-view")) {
- $errorText = 'Доступ закрыт <br>';
- $errorText .= 'Для изменения уровня доступа обратитесь в отдел кадров <br> ';
-
- return $this->render('/cabinet/error', [
- 'errorTitle' => 'Информация',
- 'errorText' => $errorText,
- 'hideButton' => true,
-
- ]);
- }
$storeIds = TimetableService::getAllowedStoreId($adminId, $groupId);
$searchModel = new WriteOffsErpSearch();
$dataProvider = $searchModel->search($this->request->queryParams, $storeIds);
- $isShowSum = false;
- if (Yii::$app->user->can("write-offs-docs-price-and-sum-hidden")) {
+
$isShowSum = true;
- }
- $isCanCreateWriteOff = false;
- if (Yii::$app->user->can("write-offs-docs-create-button")) {
+
$isCanCreateWriteOff = true;
- }
+
return $this->render('/write_offs_erp/index', [
'isShowSum' => $isShowSum,
$allowShowReSendButton = true;
}
- $isShowSum = false;
- if (Yii::$app->user->can("write-offs-docs-price-and-sum-hidden")) {
+
$isShowSum = true;
- }
- $isCanConfirmWriteOffs = false;
- if (Yii::$app->user->can("write-offs-1c-confirmation-button")) {
+
+
$isCanConfirmWriteOffs = true;
- }
+
$model->isShowSum = $isShowSum;
$documentGroupId = DataHelper::getDocumentGroupId('write_offs_erp');
- $isCanCreateWriteOff = false;
- if (Yii::$app->user->can("write-offs-docs-create-button")) {
- $isCanCreateWriteOff = true;
- }
+
+ $isCanCreateWriteOff = true;
+
if (!$isCanCreateWriteOff) {
$documentGroupId = DataHelper::getDocumentGroupId('write_offs_erp');
- $isCanCreateWriteOff = false;
- if (Yii::$app->user->can("write-offs-docs-create-button")) {
- $isCanCreateWriteOff = true;
- }
+
+ $isCanCreateWriteOff = true;
+
if (!$isCanCreateWriteOff) {