274: where legal_entity = p_legal_entity
275: )
276: and exists
277: (select 1 278: from cst_pac_periods cpp 279: where legal_entity = p_legal_entity
280: and cost_type_id = p_from_cost_type_id
281: and cpp.pac_period_id in
282: (select cppp.pac_period_id