155: NVL(A.last_update_login,0) LAST_UPDATE_LOGIN,
156: inv.invoice_num invoice_num
157: from ap_invoice_distributions_all A,
158: pa_projects_all p,
159: gms_project_types gpt,
160: ap_invoices_all inv
161: where a.invoice_id = p_invoice_id
162: and a.project_id = p.project_id
163: and p.project_type = gpt.project_type
177: NVL(A.last_update_login,0) LAST_UPDATE_LOGIN,
178: inv.invoice_num invoice_num
179: FROM ap_self_assessed_tax_dist_all A,
180: PA_PROJECTS_ALL P,
181: gms_project_types gpt,
182: AP_INVOICES_ALL INV
183: WHERE a.invoice_id = p_invoice_id
184: AND a.project_id = p.project_id
185: AND A.line_type_lookup_code='NONREC_TAX'
195: cursor c2 is
196: SELECT 1
197: from ap_invoice_distributions_all A,
198: pa_projects_all p,
199: gms_project_types gpt
200: where a.invoice_id = p_invoice_id
201: and a.project_id = p.project_id
202: and p.project_type = gpt.project_type
203: and gpt.sponsored_flag = 'Y'
211: union /* BUG 14216205 : Added the union for SAT */
212: select 1
213: FROM AP_SELF_ASSESSED_TAX_DIST_ALL b,
214: PA_PROJECTS_ALL P,
215: GMS_PROJECT_TYPES_ALL GPT
216: WHERE b.invoice_id = p_invoice_id
217: AND b.project_id = p.project_id
218: AND P.PROJECT_TYPE = GPT.PROJECT_TYPE
219: AND GPT.SPONSORED_FLAG = 'Y'
329: IS
330: select a.invoice_distribution_id
331: from ap_invoice_distributions_all A,
332: pa_projects_all p,
333: gms_project_types gpt
334: where a.invoice_id = p_invoice_id
335: and a.project_id = p.project_id
336: and a.award_id is not NULL
337: and P.PROJECT_TYPE = GPT.PROJECT_TYPE
339: union
340: select b.INVOICE_DISTRIBUTION_ID
341: from AP_SELF_ASSESSED_TAX_DIST_ALL B,
342: pa_projects_all p,
343: gms_project_types gpt
344: where b.invoice_id = p_invoice_id
345: and b.project_id = p.project_id
346: and b.award_id is not NULL
347: and P.PROJECT_TYPE = GPT.PROJECT_TYPE
538: /*select a.invoice_distribution_id
539: bulk collect into l_dummy_tab
540: from ap_invoice_distributions_all A,
541: pa_projects_all p,
542: gms_project_types gpt
543: where a.invoice_id = p_invoice_id
544: and a.project_id = p.project_id
545: and a.award_id is not NULL
546: and p.project_type = gpt.project_type