1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
StoreDocumentAllowNegationProductQuantityRule.php
См. документацию.
1<?php
2
3namespace Bitrix\Catalog\Access\Rule;
4
5use Bitrix\Catalog\Access\Model\StoreDocument;
6use Bitrix\Catalog\Access\Permission\PermissionDictionary;
7
12{
16 public function check($params): bool
17 {
18 $item = $params['item'];
19
20 if ($item instanceof StoreDocument)
21 {
22 $typesWithCheck = [
23 StoreDocument::TYPE_DEDUCT,
24 StoreDocument::TYPE_MOVING,
25 StoreDocument::TYPE_SALES_ORDERS,
26 ];
27 if (in_array($item->getType(), $typesWithCheck, true))
28 {
29 $permission = PermissionDictionary::getStoreDocumentPermissionId(
30 PermissionDictionary::CATALOG_STORE_DOCUMENT_ALLOW_NEGATION_PRODUCT_QUANTITY,
31 $item->getType()
32 );
33
34 return $this->checkPermission($permission);
35 }
36
37 // for other types, allows to go into the negative.
38 return true;
39 }
40
41 return false;
42 }
43
51 private function checkPermission(string $permission): bool
52 {
53 return $this->user->getPermission($permission) === 1;
54 }
55}
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799