2.h:

ADD TO WHERE CLAUSE: AND (oc.estado NOT IN ('recusado', 'cancelado', 'concluído'))

Failure to comply applies to open occurrencies only!