[Home] [Help]
2648: AND dist3.invoice_distribution_id = dist.parent_reversal_id --Process Historical data reversals as Invoices in Cash based
2649: AND dist3.pa_addition_flag = 'Y')
2650: )
2651: /* Bug 6353803: Added the following for this bug. */
2652: AND (pa_nl_installed.is_nl_installed = 'N'
2653: OR ( pa_nl_installed.is_nl_installed = 'Y'
2654: AND NOT EXISTS (SELECT 'X'
2655: FROM po_distributions_all pod, mtl_system_items si, po_lines_all pol
2656: WHERE pod.po_distribution_id = dist.po_distribution_id
2649: AND dist3.pa_addition_flag = 'Y')
2650: )
2651: /* Bug 6353803: Added the following for this bug. */
2652: AND (pa_nl_installed.is_nl_installed = 'N'
2653: OR ( pa_nl_installed.is_nl_installed = 'Y'
2654: AND NOT EXISTS (SELECT 'X'
2655: FROM po_distributions_all pod, mtl_system_items si, po_lines_all pol
2656: WHERE pod.po_distribution_id = dist.po_distribution_id
2657: AND pod.po_line_id = pol.po_line_id
2740: AND aid.pa_addition_flag = 'Y'
2741: AND aid.invoice_distribution_id = dist.prepay_distribution_id --Prepayment dist id
2742: AND aid.project_id = G_PROJECT_ID)
2743: /* Bug 6353803: Added the following for this bug. */
2744: AND (pa_nl_installed.is_nl_installed = 'N'
2745: OR ( pa_nl_installed.is_nl_installed = 'Y'
2746: AND NOT EXISTS (SELECT 'X'
2747: FROM po_distributions_all pod, mtl_system_items si, po_lines_all pol
2748: WHERE pod.po_distribution_id = dist.po_distribution_id
2741: AND aid.invoice_distribution_id = dist.prepay_distribution_id --Prepayment dist id
2742: AND aid.project_id = G_PROJECT_ID)
2743: /* Bug 6353803: Added the following for this bug. */
2744: AND (pa_nl_installed.is_nl_installed = 'N'
2745: OR ( pa_nl_installed.is_nl_installed = 'Y'
2746: AND NOT EXISTS (SELECT 'X'
2747: FROM po_distributions_all pod, mtl_system_items si, po_lines_all pol
2748: WHERE pod.po_distribution_id = dist.po_distribution_id
2749: AND pod.po_line_id = pol.po_line_id
2823: -- AND aid.historical_flag = 'Y' /*doubt*/
2824: AND aid.pa_addition_flag = 'Y'
2825: AND aid.invoice_distribution_id = dist.prepay_distribution_id
2826: AND aid.project_id = G_PROJECT_ID)
2827: AND (pa_nl_installed.is_nl_installed = 'N'
2828: OR ( pa_nl_installed.is_nl_installed = 'Y'
2829: AND NOT EXISTS (SELECT 'X'
2830: FROM po_distributions_all pod, mtl_system_items si, po_lines_all pol
2831: WHERE pod.po_distribution_id = dist.po_distribution_id
2824: AND aid.pa_addition_flag = 'Y'
2825: AND aid.invoice_distribution_id = dist.prepay_distribution_id
2826: AND aid.project_id = G_PROJECT_ID)
2827: AND (pa_nl_installed.is_nl_installed = 'N'
2828: OR ( pa_nl_installed.is_nl_installed = 'Y'
2829: AND NOT EXISTS (SELECT 'X'
2830: FROM po_distributions_all pod, mtl_system_items si, po_lines_all pol
2831: WHERE pod.po_distribution_id = dist.po_distribution_id
2832: AND pod.po_line_id = pol.po_line_id
2908: dist2.line_type_lookup_code = 'NONREC_TAX'
2909: )
2910: )
2911: /* Bug 6353803: Added the following for this bug. */
2912: AND (pa_nl_installed.is_nl_installed = 'N'
2913: OR ( pa_nl_installed.is_nl_installed = 'Y'
2914: AND NOT EXISTS (SELECT 'X'
2915: FROM po_distributions_all pod, mtl_system_items si, po_lines_all pol
2916: WHERE pod.po_distribution_id = dist.po_distribution_id
2909: )
2910: )
2911: /* Bug 6353803: Added the following for this bug. */
2912: AND (pa_nl_installed.is_nl_installed = 'N'
2913: OR ( pa_nl_installed.is_nl_installed = 'Y'
2914: AND NOT EXISTS (SELECT 'X'
2915: FROM po_distributions_all pod, mtl_system_items si, po_lines_all pol
2916: WHERE pod.po_distribution_id = dist.po_distribution_id
2917: AND pod.po_line_id = pol.po_line_id
2989: or
2990: dist2.line_type_lookup_code = 'NONREC_TAX'
2991: )
2992: )
2993: AND (pa_nl_installed.is_nl_installed = 'N'
2994: OR ( pa_nl_installed.is_nl_installed = 'Y'
2995: AND NOT EXISTS (SELECT 'X'
2996: FROM po_distributions_all pod, mtl_system_items si, po_lines_all pol
2997: WHERE pod.po_distribution_id = dist.po_distribution_id
2990: dist2.line_type_lookup_code = 'NONREC_TAX'
2991: )
2992: )
2993: AND (pa_nl_installed.is_nl_installed = 'N'
2994: OR ( pa_nl_installed.is_nl_installed = 'Y'
2995: AND NOT EXISTS (SELECT 'X'
2996: FROM po_distributions_all pod, mtl_system_items si, po_lines_all pol
2997: WHERE pod.po_distribution_id = dist.po_distribution_id
2998: AND pod.po_line_id = pol.po_line_id
3092: AND dist3.invoice_distribution_id = dist.parent_reversal_id --Process Historical data reversals as Invoices in Cash based
3093: AND dist3.pa_addition_flag = 'Y')
3094: )
3095: /* Bug 6353803: Added the following for this bug. */
3096: AND (pa_nl_installed.is_nl_installed = 'N'
3097: OR ( pa_nl_installed.is_nl_installed = 'Y'
3098: AND NOT EXISTS (SELECT 'X'
3099: FROM po_distributions_all pod, mtl_system_items si, po_lines_all pol
3100: WHERE pod.po_distribution_id = dist.po_distribution_id
3093: AND dist3.pa_addition_flag = 'Y')
3094: )
3095: /* Bug 6353803: Added the following for this bug. */
3096: AND (pa_nl_installed.is_nl_installed = 'N'
3097: OR ( pa_nl_installed.is_nl_installed = 'Y'
3098: AND NOT EXISTS (SELECT 'X'
3099: FROM po_distributions_all pod, mtl_system_items si, po_lines_all pol
3100: WHERE pod.po_distribution_id = dist.po_distribution_id
3101: AND pod.po_line_id = pol.po_line_id
3183: AND aid.pa_addition_flag = 'Y'
3184: AND aid.invoice_distribution_id = dist.prepay_distribution_id --Prepayment dist id
3185: AND aid.project_id > 0 )
3186: /* Bug 6353803: Added the following for this bug. */
3187: AND (pa_nl_installed.is_nl_installed = 'N'
3188: OR ( pa_nl_installed.is_nl_installed = 'Y'
3189: AND NOT EXISTS (SELECT 'X'
3190: FROM po_distributions_all pod, mtl_system_items si, po_lines_all pol
3191: WHERE pod.po_distribution_id = dist.po_distribution_id
3184: AND aid.invoice_distribution_id = dist.prepay_distribution_id --Prepayment dist id
3185: AND aid.project_id > 0 )
3186: /* Bug 6353803: Added the following for this bug. */
3187: AND (pa_nl_installed.is_nl_installed = 'N'
3188: OR ( pa_nl_installed.is_nl_installed = 'Y'
3189: AND NOT EXISTS (SELECT 'X'
3190: FROM po_distributions_all pod, mtl_system_items si, po_lines_all pol
3191: WHERE pod.po_distribution_id = dist.po_distribution_id
3192: AND pod.po_line_id = pol.po_line_id
3264: -- AND aid.historical_flag = 'Y' /*doubt*/
3265: AND aid.pa_addition_flag = 'Y'
3266: AND aid.invoice_distribution_id = dist.prepay_distribution_id
3267: AND aid.project_id > 0 )
3268: AND (pa_nl_installed.is_nl_installed = 'N'
3269: OR ( pa_nl_installed.is_nl_installed = 'Y'
3270: AND NOT EXISTS (SELECT 'X'
3271: FROM po_distributions_all pod, mtl_system_items si, po_lines_all pol
3272: WHERE pod.po_distribution_id = dist.po_distribution_id
3265: AND aid.pa_addition_flag = 'Y'
3266: AND aid.invoice_distribution_id = dist.prepay_distribution_id
3267: AND aid.project_id > 0 )
3268: AND (pa_nl_installed.is_nl_installed = 'N'
3269: OR ( pa_nl_installed.is_nl_installed = 'Y'
3270: AND NOT EXISTS (SELECT 'X'
3271: FROM po_distributions_all pod, mtl_system_items si, po_lines_all pol
3272: WHERE pod.po_distribution_id = dist.po_distribution_id
3273: AND pod.po_line_id = pol.po_line_id
3350: dist2.line_type_lookup_code = 'NONREC_TAX'
3351: )
3352: )
3353: /* Bug 6353803: Added the following for this bug. */
3354: AND (pa_nl_installed.is_nl_installed = 'N'
3355: OR ( pa_nl_installed.is_nl_installed = 'Y'
3356: AND NOT EXISTS (SELECT 'X'
3357: FROM po_distributions_all pod, mtl_system_items si, po_lines_all pol
3358: WHERE pod.po_distribution_id = dist.po_distribution_id
3351: )
3352: )
3353: /* Bug 6353803: Added the following for this bug. */
3354: AND (pa_nl_installed.is_nl_installed = 'N'
3355: OR ( pa_nl_installed.is_nl_installed = 'Y'
3356: AND NOT EXISTS (SELECT 'X'
3357: FROM po_distributions_all pod, mtl_system_items si, po_lines_all pol
3358: WHERE pod.po_distribution_id = dist.po_distribution_id
3359: AND dist.po_distribution_id > 0 /*Added for bug#12922795 */
3432: or
3433: dist2.line_type_lookup_code = 'NONREC_TAX'
3434: )
3435: )
3436: AND (pa_nl_installed.is_nl_installed = 'N'
3437: OR ( pa_nl_installed.is_nl_installed = 'Y'
3438: AND NOT EXISTS (SELECT 'X'
3439: FROM po_distributions_all pod, mtl_system_items si, po_lines_all pol
3440: WHERE pod.po_distribution_id = dist.po_distribution_id
3433: dist2.line_type_lookup_code = 'NONREC_TAX'
3434: )
3435: )
3436: AND (pa_nl_installed.is_nl_installed = 'N'
3437: OR ( pa_nl_installed.is_nl_installed = 'Y'
3438: AND NOT EXISTS (SELECT 'X'
3439: FROM po_distributions_all pod, mtl_system_items si, po_lines_all pol
3440: WHERE pod.po_distribution_id = dist.po_distribution_id
3441: AND pod.po_line_id = pol.po_line_id
8976: SELECT dist.rowid
8977: FROM ap_invoices inv, ap_invoice_distributions_all dist
8978: WHERE inv.invoice_id = dist.invoice_id
8979: AND (dist.line_type_lookup_code in ('ITEM','ACCRUAL','RETROACCRUAL','NONREC_TAX')
8980: OR ( pa_nl_installed.is_nl_installed = 'Y' --EIB trackable items
8981: AND EXISTS (SELECT 'X'
8982: FROM mtl_system_items si,
8983: po_lines_all pol,
8984: po_distributions_all po_dist1
9058: SELECT dist.rowid
9059: FROM ap_invoices inv, ap_self_assessed_tax_dist_all dist
9060: WHERE inv.invoice_id = dist.invoice_id
9061: AND (dist.line_type_lookup_code in ('ITEM','ACCRUAL','RETROACCRUAL','NONREC_TAX')
9062: OR ( pa_nl_installed.is_nl_installed = 'Y' --EIB trackable items
9063: AND EXISTS (SELECT 'X'
9064: FROM mtl_system_items si,
9065: po_lines_all pol,
9066: po_distributions_all po_dist1
9197: SELECT dist.rowid
9198: FROM ap_invoices inv, ap_invoice_distributions_all dist
9199: WHERE inv.invoice_id = dist.invoice_id
9200: AND ( dist.line_type_lookup_code in ('ITEM','ACCRUAL','RETROACCRUAL','NONREC_TAX')
9201: OR ( pa_nl_installed.is_nl_installed = 'Y' --EIB trackable items
9202: AND EXISTS (SELECT 'X'
9203: FROM mtl_system_items si,
9204: po_lines_all pol,
9205: po_distributions_all po_dist1
9280: SELECT dist.rowid
9281: FROM ap_invoices inv, ap_self_assessed_tax_dist_all dist
9282: WHERE inv.invoice_id = dist.invoice_id
9283: AND ( dist.line_type_lookup_code in ('ITEM','ACCRUAL','RETROACCRUAL','NONREC_TAX')
9284: OR ( pa_nl_installed.is_nl_installed = 'Y' --EIB trackable items
9285: AND EXISTS (SELECT 'X'
9286: FROM mtl_system_items si,
9287: po_lines_all pol,
9288: po_distributions_all po_dist1