102 $this->settings = $settings;
103 $this->contractorsProvider = Manager::getActiveProvider(Manager::PROVIDER_STORE_DOCUMENT);
121 'id' =>
'DOC_NUMBER',
123 'default' => $this->mode === \CatalogStoreDocumentListComponent::ARRIVAL_MODE,
124 'sort' =>
'DOC_NUMBER',
129 'default' => $this->mode === \CatalogStoreDocumentListComponent::ARRIVAL_MODE,
130 'sort' =>
'DOC_TYPE',
131 'type' => Column\Type::LABELS,
134 'id' =>
'DATE_DOCUMENT',
137 'sort' =>
'DATE_DOCUMENT',
144 'type' => Column\Type::LABELS,
147 'id' =>
'DATE_CREATE',
150 'sort' =>
'DATE_CREATE',
153 'id' =>
'DATE_MODIFY',
156 'sort' =>
'DATE_MODIFY',
159 'id' =>
'DATE_STATUS',
162 'sort' =>
'DATE_STATUS',
168 'sort' =>
'STATUS_BY',
170 'RESPONSIBLE_ID' => [
171 'id' =>
'RESPONSIBLE_ID',
174 'sort' =>
'RESPONSIBLE_ID',
177 'id' =>
'CREATED_BY',
180 'sort' =>
'CREATED_BY',
183 'id' =>
'MODIFIED_BY',
186 'sort' =>
'MODIFIED_BY',
189 'id' =>
'CONTRACTOR_ID',
192 'sort' =>
'CONTRACTOR_ID',
205 'type' => Column\Type::LABELS,
208 'id' =>
'STORES_FROM',
212 'type' => Column\Type::LABELS,
219 'type' => Column\Type::LABELS,
243 'DATE_DOCUMENT' => $this->
createField(
'DATE_DOCUMENT', [
247 'DATE_CREATE' => $this->
createField(
'DATE_CREATE', [
250 'DATE_MODIFY' => $this->
createField(
'DATE_MODIFY', [
253 'DATE_STATUS' => $this->
createField(
'DATE_STATUS', [
258 'type' =>
'entity_selector',
260 'RESPONSIBLE_ID' => $this->
createField(
'RESPONSIBLE_ID', [
263 'type' =>
'entity_selector',
267 'type' =>
'entity_selector',
269 'MODIFIED_BY' => $this->
createField(
'MODIFIED_BY', [
271 'type' =>
'entity_selector',
275 if (Loader::includeModule(
'crm'))
277 $fields[
'PRODUCTS'] = $this->
createField(
'PRODUCTS', [
279 'type' =>
'entity_selector',
283 if ($this->mode !== \CatalogStoreDocumentListComponent::OTHER_MODE)
285 $fields[
'DOC_NUMBER'] = $this->
createField(
'DOC_NUMBER');
287 if ($this->mode === \CatalogStoreDocumentListComponent::MOVING_MODE)
289 $fields[
'STORES_FROM'] = $this->
createField(
'STORES_FROM', [
292 'type' =>
'entity_selector',
294 $fields[
'STORES_TO'] = $this->
createField(
'STORES_TO', [
297 'type' =>
'entity_selector',
304 'type' =>
'entity_selector',
309 if ($this->mode === \CatalogStoreDocumentListComponent::ARRIVAL_MODE)
311 if ($this->contractorsProvider)
313 $contractorsFields = $this->contractorsProvider::getDocumentsGridFilterFields();
314 foreach ($contractorsFields as $contractorsField)
316 $fields[$contractorsField[
'CODE']] = $this->
createField(
317 $contractorsField[
'CODE'],
318 $contractorsField[
'PARAMS']
324 $fields[
'CONTRACTOR_ID'] = $this->
createField(
'CONTRACTOR_ID', [
326 'type' =>
'entity_selector',
331 $fields[
'DOC_TYPE'] = $this->
createField(
'DOC_TYPE', [
351 if ($fieldID ===
'STATUS')
361 if ($fieldID ===
'DOC_TYPE')
363 if ($this->mode === \CatalogStoreDocumentListComponent::ARRIVAL_MODE)
377 $userFields = [
'RESPONSIBLE_ID',
'STATUS_BY',
'CREATED_BY',
'MODIFIED_BY'];
378 if (in_array($fieldID, $userFields))
383 if (in_array($fieldID, [
'STORES',
'STORES_FROM',
'STORES_TO'],
true))
390 'context' => $this->mode .
'_store_filter',
394 'dynamicLoad' =>
true,
395 'dynamicSearch' =>
true,
398 'dropdownMode' =>
false,
404 if ($fieldID ===
'CONTRACTOR_ID')
411 'context' => $this->mode .
'_contractor_filter',
414 'id' =>
'contractor',
415 'dynamicLoad' =>
true,
416 'dynamicSearch' =>
true,
419 'dropdownMode' =>
false,
426 $this->contractorsProvider
427 && $this->contractorsProvider::isDocumentsGridFilterFieldSupported($fieldID)
430 return $this->contractorsProvider::getDocumentsGridFilterFieldData($fieldID);
433 if ($fieldID ===
'PRODUCTS')
440 'context' => $this->mode .
'_product_filter',
445 'iblockId' => \Bitrix\Crm\Product\Catalog::getDefaultId(),
446 'basePriceId' => Catalog\GroupTable::getBasePriceTypeId(),
450 'dropdownMode' =>
false,
462 $fieldsOrder = self::$fieldsOrder[$this->mode];
463 foreach ($fieldsOrder as $field)
465 $columns[] = self::$fields[$field];
470 case \CatalogStoreDocumentListComponent::ARRIVAL_MODE:
471 $gridUFManager = new \Bitrix\Main\Grid\Uf\Base(StoreDocumentArrivalTable::getUfId());
472 $gridUFManager->addUFHeaders($columns);
473 $gridUFManager = new \Bitrix\Main\Grid\Uf\Base(StoreDocumentStoreAdjustmentTable::getUfId());
474 $gridUFManager->addUFHeaders($columns);
476 case \CatalogStoreDocumentListComponent::MOVING_MODE:
477 $gridUFManager = new \Bitrix\Main\Grid\Uf\Base(StoreDocumentMovingTable::getUfId());
478 $gridUFManager->addUFHeaders($columns);
480 case \CatalogStoreDocumentListComponent::DEDUCT_MODE:
481 $gridUFManager = new \Bitrix\Main\Grid\Uf\Base(StoreDocumentDeductTable::getUfId());
482 $gridUFManager->addUFHeaders($columns);