diff --git a/docs/Admin manuals/Настройка архива/index.md b/docs/Admin manuals/Настройка архива/index.md
index b7ad520..d0ee5a6 100644
--- a/docs/Admin manuals/Настройка архива/index.md
+++ b/docs/Admin manuals/Настройка архива/index.md
@@ -28,6 +28,8 @@ CUser | Создатель документа |
Curator | Куратор |
StageUser | Участник маршрута |
EmpowermentSubject | Полномочия |
+Filial | Организация |
+Subtype | Подтип |
Существует строго определённый набор значений поля "Id", приведённый в [таблице ниже](#таблица). Соответствующее им поле "Name" заполняется произвольно. В справочнике «Итоговые выборки поисковой системы» этим значениям будут поставлены в соответствие поля в таблицах, по которым будет осуществляться поиск и фильтрация документов с вложениями.
@@ -96,177 +98,122 @@ WHERE 1 = 1
+В табличную часть "Фильтры" указывается следующее:
-
-
-
-
-
- SQL Syntax Highlighting
-
-
-
+**CUser - Создатель документа**
+```sql
+and exists(
+select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'CUser' and an."value" = cast(t."CUser" as character varying)
+)
+```
-Примеры настраиваемых выборок
-Настраиваемая выборка для кадрового электронного документооборота
+**Initiator - Инициатор**
+```sql
+and(
+ exists(
+ select 1
+ from "tmp_anFilters_for_documentSearch" as an
+ join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
+ where an."id" = 'Initiator'
+ and r."Initiator" = an."value"
+ )
+)
+```
-
-
-
- Код |
- Наименование |
- SQLScript |
-
-
-
-
- CUser |
- Создатель документа |
- and exists( select 1 from "tmp_anFilters_for_documentSearch" as an where an."id" = 'CUser' and an."value" = cast(t."CUser" as character varying) ) |
-
-
- Initiator |
- Инициатор |
-
- and(
- exists(
- select 1
- from "tmp_anFilters_for_documentSearch" as an
- join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
- where an."id" = 'Initiator'
- and r."Initiator" = an."value"
- )
- |
-
-
- StageUser |
- Участник маршрута |
-
- and
- exists(
- select 1
- from "tmp_anFilters_for_documentSearch" as an
- join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
- join comdoc."RouteStage" as s on s."PCode" = r."VCode"
- join comdoc."StageItem" as i on i."PCode" = s."VCode"
- where an."id" = 'StageUser'
- and r."RouteStatus" NOT IN (4)
- and i."StageUser" = an."value"
- )
- |
-
-
- SignatoryUser |
- Работник |
-
- and(
- exists(
- select 1
- from "tmp_anFilters_for_documentSearch" as an
- join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
- where an."id" = 'SignatoryUser'
- and r."DocType" = 'EmployeeStatement'
- and r."Initiator" = an."value"
- ) or exists(
- select 1
- from "tmp_anFilters_for_documentSearch" as an
- join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
- join comdoc."RouteStage" as s on s."PCode" = r."VCode"
- join comdoc."StageItem" as i on i."PCode" = s."VCode"
- where an."id" = 'SignatoryUser'
- and r."DocType" = 'LND'
- AND r."RouteStatus" NOT IN(4)
- AND s."IsMarked" IS NOT true
- AND COALESCE(i."DocumentAction", 0) IN (20, 30)
- and i."StageUser" = an."value"
- ) or exists(
- select 1
- from "tmp_anFilters_for_documentSearch" as an
- join comdoc."ReadListItem" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
- where an."id" = 'SignatoryUser'
- and r."DocType" = 'LND'
- and r."DocflowUser" = an."value"
- ) or exists(
- select 1
- from "tmp_anFilters_for_documentSearch" as an
- join dfd."EmpowermentWorkerDetail" as ewd on ewd."PCode" = t."VCode"
- JOIN rp."RP_Person" AS p ON ewd."PersonId" = p."VCode"
- JOIN rp."RP_PersonContact" AS pc on p."VCode" = pc."Pcode"
- where an."id" = 'SignatoryUser'
- and t."TypeName" = 'EmpowermentConstructor'
- and pc."IdTypeContact" = 6
- and pc."Code" = an."value"
- )
- )
-
- |
-
-
- EmpowermentSubject |
- Полномочия |
-
- and
- exists(
- select 1
- from "tmp_anFilters_for_documentSearch" as an
- join dfd."EmpowermentSubjectDetail" as esd on esd."PCode" = t."VCode"
- JOIN dfd."EmpowermentSubject" AS s ON esd."Subject" = s."VCode"
- where an."id" = 'EmpowermentSubject'
- and t."TypeName" = 'EmpowermentConstructor'
- and s."VCode" = an."value"::bigint
- )
-
- |
-
-
- Filial |
- Организация |
-
- and exists(
- select 1
- from "tmp_anFilters_for_documentSearch" as an
- where an."id" = 'Filial'
- and t."COrg"::text = an."value"
- )
-
- |
-
-
-
+**StageUser - Участник маршрута**
+```sql
+and
+ exists(
+ select 1
+ from "tmp_anFilters_for_documentSearch" as an
+ join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
+ join comdoc."RouteStage" as s on s."PCode" = r."VCode"
+ join comdoc."StageItem" as i on i."PCode" = s."VCode"
+ where an."id" = 'StageUser'
+ and r."RouteStatus" NOT IN (4)
+ and i."StageUser" = an."value"
+ )
-
- |
+```
+
+**EmpowermentSubject - Полномочия**
+```sql
+and
+ exists(
+ select 1
+ from "tmp_anFilters_for_documentSearch" as an
+ join dfd."EmpowermentSubjectDetail" as esd on esd."PCode" = t."VCode"
+ JOIN dfd."EmpowermentSubject" AS s ON esd."Subject" = s."VCode"
+ where an."id" = 'EmpowermentSubject'
+ and t."TypeName" = 'EmpowermentConstructor'
+ and s."VCode" = an."value"::bigint
+ )
+```
+
+**SignatoryUser - Работник**
+```sql
+and(
+ exists(
+ select 1
+ from "tmp_anFilters_for_documentSearch" as an
+ join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
+ where an."id" = 'SignatoryUser'
+ and r."DocType" = 'EmployeeStatement'
+ and r."Initiator" = an."value"
+ ) or exists(
+ select 1
+ from "tmp_anFilters_for_documentSearch" as an
+ join comdoc."Route" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
+ join comdoc."RouteStage" as s on s."PCode" = r."VCode"
+ join comdoc."StageItem" as i on i."PCode" = s."VCode"
+ where an."id" = 'SignatoryUser'
+ and r."DocType" = 'LND'
+ AND r."RouteStatus" NOT IN(4)
+ AND s."IsMarked" IS NOT true
+ AND COALESCE(i."DocumentAction", 0) IN (20, 30)
+ and i."StageUser" = an."value"
+ ) or exists(
+ select 1
+ from "tmp_anFilters_for_documentSearch" as an
+ join comdoc."ReadListItem" as r on r."DocCode" = t."VCode" and r."DocType" = t."TypeName"
+ where an."id" = 'SignatoryUser'
+ and r."DocType" = 'LND'
+ and r."DocflowUser" = an."value"
+ ) or exists(
+ select 1
+ from "tmp_anFilters_for_documentSearch" as an
+ join dfd."EmpowermentWorkerDetail" as ewd on ewd."PCode" = t."VCode"
+ JOIN rp."RP_Person" AS p ON ewd."PersonId" = p."VCode"
+ JOIN rp."RP_PersonContact" AS pc on p."VCode" = pc."Pcode"
+ where an."id" = 'SignatoryUser'
+ and t."TypeName" = 'EmpowermentConstructor'
+ and pc."IdTypeContact" = 6
+ and pc."Code" = an."value"
+ )
+)
+```
+
+**Filial - Организация**
+```sql
+and
+ exists(
+ select 1
+ from "tmp_anFilters_for_documentSearch" as an
+ where an."id" = 'Filial'
+ and t."COrg"::text = an."value"
+ )
+```
+
+**Subtype - Подтип**
+```sql
+and
+ exists(
+ select 1
+ from "tmp_anFilters_for_documentSearch" as an
+ where an."id" = 'Subtype'
+ and t."DocumentSubtype"::text = an."value"::text
+ )
+```
## Настройка документов