16347 увдедом если закрыли заявление без формиров

This commit is contained in:
mirzakaev_tf 2023-08-08 10:53:28 +05:00
parent 582c6e999b
commit 5529f3116a
1 changed files with 28 additions and 2 deletions

View File

@ -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 '<table><tr><th align="left">Организация</th><th align="left">
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) || '</table>'
```
### Напоминание об обработке документа руководителю на этапе "Согласование"