327: /* bug#12697320 modified the joins to access XAL first and then XDL */
328: SELECT NVL(sum(NVL(xdl.unrounded_ENTERED_dR,0)-NVL(xdl.unrounded_entered_cr,0)),0)
329: INTO ln_inv_amt_ent
330: FROM ap_invoices ai
331: ,ap_invoice_distributions aid
332: ,ap_invoice_distributions aidinv
333: ,ap_invoices aiinv
334: ,xla_ae_headers xah --Perf 7511696 events replaced with headers
335: ,xla_ae_lines xal
328: SELECT NVL(sum(NVL(xdl.unrounded_ENTERED_dR,0)-NVL(xdl.unrounded_entered_cr,0)),0)
329: INTO ln_inv_amt_ent
330: FROM ap_invoices ai
331: ,ap_invoice_distributions aid
332: ,ap_invoice_distributions aidinv
333: ,ap_invoices aiinv
334: ,xla_ae_headers xah --Perf 7511696 events replaced with headers
335: ,xla_ae_lines xal
336: ,xla_distribution_links xdl