From db25739970f99405198c510a47eae204787d5179 Mon Sep 17 00:00:00 2001 From: mirzakaev_tf Date: Tue, 7 May 2024 10:41:27 +0500 Subject: [PATCH] =?UTF-8?q?20055=20=D0=B2=D1=8B=D0=B1=D0=BE=D1=80=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BF=D0=BE=20=D0=BA=D0=BE=D0=BD=D1=81=D1=82=D0=B0?= =?UTF-8?q?=D0=BD=D1=82=D0=B0=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Настройка правил поиска для ЖСД/index.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) 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