274: and ent.entry_type <> 'E'
275: )
276: )
277: and (not exists (select null
278: from pay_run_results pr1
279: where pr1.source_id = ent.element_entry_id
280: and pr1.source_type = 'E'
281: and pr1.status in ('P', 'PA')
282: and not exists (select ''
279: where pr1.source_id = ent.element_entry_id
280: and pr1.source_type = 'E'
281: and pr1.status in ('P', 'PA')
282: and not exists (select ''
283: from pay_run_results pr2
284: where pr2.source_id = pr1.run_result_id
285: and pr2.source_type = 'R'
286: )
287: )
1042: and ent.entry_type <> 'E'
1043: )
1044: )
1045: and (not exists (select null
1046: from pay_run_results pr1
1047: where pr1.source_id = ent.element_entry_id
1048: and pr1.source_type = 'E'
1049: and pr1.status in ('P', 'PA')
1050: and not exists (select ''
1047: where pr1.source_id = ent.element_entry_id
1048: and pr1.source_type = 'E'
1049: and pr1.status in ('P', 'PA')
1050: and not exists (select ''
1051: from pay_run_results pr2
1052: where pr2.source_id = pr1.run_result_id
1053: and pr2.source_type = 'R'
1054: )
1055: )