ред скрипт для отпуска
This commit is contained in:
parent
99968f3976
commit
0a69e1f259
|
@ -86,13 +86,13 @@
|
||||||
|
|
||||||
```
|
```
|
||||||
insert into "#forInsNotification" ("DocflowUser", "txt", "Link", "DocType", "DocName", "DocSubject", "IdWorker", "DateBeg", "Days", "TypeVacation", "Vacation", "DateEnd", "CopyTo", "txtSMS", "txtTelegram")
|
insert into "#forInsNotification" ("DocflowUser", "txt", "Link", "DocType", "DocName", "DocSubject", "IdWorker", "DateBeg", "Days", "TypeVacation", "Vacation", "DateEnd", "CopyTo", "txtSMS", "txtTelegram")
|
||||||
select pc_ch."Code" as "User", null as "txt",
|
select pc_ch."Code" as "User", null as "txt",
|
||||||
p."VCode" as "link",p."TypeName", null /*case when "TypeName" = 'Base.RP_DocVacationChanges' then 'Переносы отпусков' else 'График отпусков' end*/,
|
p."VCode" as "link",p."TypeName", null /*case when "TypeName" = 'Base.RP_DocVacationChanges' then 'Переносы отпусков' else 'График отпусков' end*/,
|
||||||
null, /*'Уведомление работника о времени начала отпуска',*/
|
null, /*'Уведомление работника о времени начала отпуска',*/
|
||||||
m."IdWorker", coalesce(m."DateBegPer",m."DateBeg")::date, coalesce(m."DaysPer",m."Days"), m."HolidayTypeGuid", coalesce(tw."Name",ex.name1c), coalesce(m."DateEndPer",m."DateEnd") , null, null as "txtSMS", null as "txtTelegram"
|
m."IdWorker", coalesce(m."DateBegPer",m."DateBeg")::date, coalesce(m."DaysPer",m."Days"), m."HolidayTypeGuid", coalesce(tw."Name",ex.name1c), coalesce(m."DateEndPer",m."DateEnd") , null, null as "txtSMS", null as "txtTelegram"
|
||||||
from aw."RP_DocVacation" p
|
from aw."RP_DocVacation" p
|
||||||
join aw."RP_WorkerVacation" m on p."VCode" = m."Pcode"
|
join aw."RP_WorkerVacation" m on p."VCode" = m."Pcode"
|
||||||
cross join (select (now() + '8 day'::interval)::date as bd, (now() + '8 day'::interval)::date as ed ) dt
|
cross join (select (now() + '1 day'::interval)::date as bd, (now() + '8 day'::interval)::date as ed ) dt
|
||||||
cross join (select "LocationProtocol" || '//' || "LocationHostName" as "link_txt" from comdoc."DocflowSettings") l
|
cross join (select "LocationProtocol" || '//' || "LocationHostName" as "link_txt" from comdoc."DocflowSettings") l
|
||||||
join rp."RP_Worker" w_ch on w_ch."VCode" = m."IdWorker"
|
join rp."RP_Worker" w_ch on w_ch."VCode" = m."IdWorker"
|
||||||
join rp."RP_Person" p_ch on w_ch."IdPerson" = p_ch."VCode"
|
join rp."RP_Person" p_ch on w_ch."IdPerson" = p_ch."VCode"
|
||||||
|
@ -114,6 +114,7 @@ where p."COrg" <> 4 and
|
||||||
) and
|
) and
|
||||||
w_ch."DateEDM" is not null and
|
w_ch."DateEDM" is not null and
|
||||||
w_ch."DateEnd" is null and
|
w_ch."DateEnd" is null and
|
||||||
|
|
||||||
--проверка на созданное заявление с завершенным маршрутом, на отпуск или на перенос
|
--проверка на созданное заявление с завершенным маршрутом, на отпуск или на перенос
|
||||||
not exists (select 1
|
not exists (select 1
|
||||||
from "dfd"."UniversalDocument" AS "ud"
|
from "dfd"."UniversalDocument" AS "ud"
|
||||||
|
|
Loading…
Reference in New Issue