From 5529f3116aa6c4cbb4bb4f055b24dae183407976 Mon Sep 17 00:00:00 2001 From: mirzakaev_tf Date: Tue, 8 Aug 2023 10:53:28 +0500 Subject: [PATCH] =?UTF-8?q?16347=20=D1=83=D0=B2=D0=B4=D0=B5=D0=B4=D0=BE?= =?UTF-8?q?=D0=BC=20=D0=B5=D1=81=D0=BB=D0=B8=20=D0=B7=D0=B0=D0=BA=D1=80?= =?UTF-8?q?=D1=8B=D0=BB=D0=B8=20=D0=B7=D0=B0=D1=8F=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B1=D0=B5=D0=B7=20=D1=84=D0=BE=D1=80=D0=BC?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Настройка внутрисистемных уведомлений.md | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/docs/Admin manuals/Настройка внутрисистемных уведомлений/Настройка внутрисистемных уведомлений.md b/docs/Admin manuals/Настройка внутрисистемных уведомлений/Настройка внутрисистемных уведомлений.md index b6490aa..37b8652 100644 --- a/docs/Admin manuals/Настройка внутрисистемных уведомлений/Настройка внутрисистемных уведомлений.md +++ b/docs/Admin manuals/Настройка внутрисистемных уведомлений/Настройка внутрисистемных уведомлений.md @@ -423,6 +423,34 @@ where coalesce(m."DateBegPer",m."DateBeg")>= dt.bd and coalesce(m."DateBegPer",m , 1) ``` +### Отмена признака Ознакомлен, если заявление удалили или сделали акт об аннулировании + +```sql +with forupd as ( +select uved."VCode" +from dfd."UniversalDocument" uved + join comdoc."DocflowLink" dl on dl."DocType2" in ('Base.RP_DocVacation','Base.RP_DocVacationChanges') and dl."DocType1" = uved."TypeName" and dl."DocCode1" = uved."VCode" + join comdoc."ReadListItem" r on uved."VCode" = r."DocCode" and uved."TypeName" = r."DocType" +where uved."TypeName" = 'NotificationLexema' and + coalesce(r."ReadCount",0) <> 0 and + exists (select 1 + from dfd."UniversalDocument" AS ud + join comdoc."DocflowLink" dle on ud."VCode" = dle."DocCode2" and + dle."DocType2" = ud."TypeName" and + dle."DocType1" = 'NotificationLexema' and dle."DocCode1" = uved."VCode" + where ud."TypeName" = 'EmployeeStatement' and + ( (coalesce(ud."Removed", false) = false and exists (select 1 from dfd."CancellationAct" a where a."DocCode" = ud."VCode" and a."DocType" = ud."TypeName")) + or coalesce(ud."Removed", false) = true + or not exists (select 1 from comdoc."Route" rt where rt."DocCode" = ud."VCode" and rt."DocType" = ud."TypeName") ) +) + ) + +update comdoc."ReadListItem" r +set "ReadCount" = 0 +where r."DocCode" in (select "VCode" from forupd) + and 'NotificationLexema' = r."DocType" +``` + ### Документы не пришедшие на подписание в систему из 1С ```sql @@ -469,8 +497,6 @@ select '
Организация cross join (select "LocationProtocol" || '//' || "LocationHostName" as "link_txt" from comdoc."DocflowSettings") ss left join comdoc."DocflowDocumentSettings" AS dds ON dds."DocType" = l."TypeName" ) AS x) || '
' - - ``` ### Напоминание об обработке документа руководителю на этапе "Согласование"