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) || ' |
---|