Dodjeljivanje statusa
Dodjljuje ststuse na vrste dokumenata na kojima je zaboravljeno dodati statuse
insert into tPA_SetDocTypeStatP (acDocType, acStatus, acVerified, acName)
select g.acDocType, 'N', 'F', 'Nepotvrđen'
from tPA_SetDocType g
left join tPA_SetDocTypeStatP t on g.acDocType = t.acDocType
where t.acDocType is null
union all
select g.acDocType, 'P', 'T', 'Potvrđen'
from tPA_SetDocType g
left join tPA_SetDocTypeStatP t on g.acDocType = t.acDocType
where t.acDocType is null