diff --git a/docs/Admin manuals/Настройка правил поиска для ЖСД/index.md b/docs/Admin manuals/Настройка правил поиска для ЖСД/index.md index caf08f3..7e44bd1 100644 --- a/docs/Admin manuals/Настройка правил поиска для ЖСД/index.md +++ b/docs/Admin manuals/Настройка правил поиска для ЖСД/index.md @@ -1166,4 +1166,33 @@ AND ( t."DocumentDate" IS NULL OR t."DocumentDate" BETWEEN _bdate AND _edate ) and t."DocType" in ('UniversalDocument') ; + ``` + +#### Выборка из учетной политики + +??? note "Запрос" + + Основной запрос: + + ```sql + do $newQ$ + declare _str text; + begin + end; + $newQ$; + ``` + + Итоговая выборка: + + ```sql + insert into "tmp_finresult"( "DocCode" , "DocType" , "DocForm" , "AnyColumnA" , "AnyColumnB" , "AnyColumnC", "AnyColumnD", "AnyColumnE", "AnyColumnF", "orgId", "AnyColumnG", "AnyColumnH" + ) + + select p."VCode", 'Base.AccountingPolitics', 'RulesForDocumentStatusJournalForm' , f."Name", m."Determination", m."ValueText", m."ValueConst", to_char(p."WDate",'DD.MM.YYYY'), p."WUser", p."COrg", + to_char(p."BeginDate",'DD.MM.YYYY'), to_char(p."EndDate",'DD.MM.YYYY') + from acc."AccountingPolitics" p + join comdoc."SettingOfConstants" m on p."VCode" = m."PCode" + join comdoc."VFilials" f on p."COrg" = f."VCode" + where now()::date between coalesce(p."BeginDate",'19700101') and coalesce(p."EndDate",'20700101') + ; ``` \ No newline at end of file