367: cst_margin_build cr,
368: ra_cust_trx_line_gl_dist_all rctlgd,
369: ra_customer_trx_lines_all rctl,
370: ra_customer_trx_all rct,
371: oe_order_lines_all sl_child,
372: oe_order_lines_all sl_parent,
373: mtl_system_items msi,
374: oe_order_headers_all sh,
375: mtl_parameters mp /* INVCONV umoogala 17-oct-2004 */
368: ra_cust_trx_line_gl_dist_all rctlgd,
369: ra_customer_trx_lines_all rctl,
370: ra_customer_trx_all rct,
371: oe_order_lines_all sl_child,
372: oe_order_lines_all sl_parent,
373: mtl_system_items msi,
374: oe_order_headers_all sh,
375: mtl_parameters mp /* INVCONV umoogala 17-oct-2004 */
376: WHERE
514: cst_margin_build cr,
515: ra_cust_trx_line_gl_dist_all rctlgd,
516: ra_customer_trx_lines_all rctl,
517: oe_order_headers_all sh,
518: oe_order_lines_all sl_parent,
519: oe_order_lines_all sl_child,
520: mtl_system_items msi,
521: ra_customer_trx_all rct,
522: mtl_material_transactions mmt, -- dropship
515: ra_cust_trx_line_gl_dist_all rctlgd,
516: ra_customer_trx_lines_all rctl,
517: oe_order_headers_all sh,
518: oe_order_lines_all sl_parent,
519: oe_order_lines_all sl_child,
520: mtl_system_items msi,
521: ra_customer_trx_all rct,
522: mtl_material_transactions mmt, -- dropship
523: mtl_parameters mp /* INVCONV umoogala 17-oct-2004 */
674: ra_cust_trx_line_gl_dist_all rctlgd,
675: ra_customer_trx_lines_all rctl,
676: ra_customer_trx_all rct,
677: oe_order_headers_all rma,
678: oe_order_lines_all rma_line,
679: mtl_system_items msi,
680: mtl_parameters mp /* INVCONV umoogala 17-oct-2004 */
681: WHERE cr.build_id = l_build_id
682: AND rctl.org_id = l_ou_id
773: rma.invoice_quantity, 0),
774: sl_child.return_context,
775: sl_child.reference_line_id
776: FROM
777: oe_order_lines_all sl_parent,
778: oe_order_lines_all sl_child,
779: oe_order_headers_all sh
780: WHERE
781: sl_parent.org_id = l_ou_id
774: sl_child.return_context,
775: sl_child.reference_line_id
776: FROM
777: oe_order_lines_all sl_parent,
778: oe_order_lines_all sl_child,
779: oe_order_headers_all sh
780: WHERE
781: sl_parent.org_id = l_ou_id
782: and sl_child.org_id = l_ou_id
922: and rctl.previous_customer_trx_id = temp.customer_trx_id
923: and not exists
924: (select 'x'
925: from cst_margin_summary t2,
926: oe_order_lines_all oel
927: where t2.source = 'RMA-INVOICE'
928: and t2.build_id = temp.build_id
929: and t2.org_id = l_ou_id
930: and temp.header_id = oel.reference_header_id
1057: FROM cst_margin_build cr,
1058: cst_acct_info_v ood,
1059: mtl_material_transactions mmt,
1060: mtl_transaction_accounts mta,
1061: oe_order_lines_all sl_child,
1062: oe_order_lines_all sl_parent,
1063: oe_order_headers_all sh,
1064: mtl_parameters mp /* INVCONV umoogala 17-oct-2004 */
1065: WHERE cr.build_id = l_build_id
1058: cst_acct_info_v ood,
1059: mtl_material_transactions mmt,
1060: mtl_transaction_accounts mta,
1061: oe_order_lines_all sl_child,
1062: oe_order_lines_all sl_parent,
1063: oe_order_headers_all sh,
1064: mtl_parameters mp /* INVCONV umoogala 17-oct-2004 */
1065: WHERE cr.build_id = l_build_id
1066: AND (mmt.transaction_source_type_id in (2,8) -- dropship
1234: crcml.COGS_ACCT_ID
1235: FROM cst_margin_build cr,
1236: cst_acct_info_v ood,
1237: mtl_material_transactions mmt,
1238: oe_order_lines_all sl_child,
1239: oe_order_lines_all sl_parent,
1240: oe_order_headers_all sh,
1241: mtl_parameters mp, /* INVCONV umoogala 17-oct-2004 */
1242: cst_revenue_cogs_match_lines crcml
1235: FROM cst_margin_build cr,
1236: cst_acct_info_v ood,
1237: mtl_material_transactions mmt,
1238: oe_order_lines_all sl_child,
1239: oe_order_lines_all sl_parent,
1240: oe_order_headers_all sh,
1241: mtl_parameters mp, /* INVCONV umoogala 17-oct-2004 */
1242: cst_revenue_cogs_match_lines crcml
1243: WHERE cr.build_id = l_build_id
1355: cst_margin_build cr,
1356: ap_invoice_distributions_all aid,
1357: ap_invoices_all ai,
1358: oe_order_headers_all sh,
1359: oe_order_lines_all sl_parent,
1360: oe_order_lines_all sl_child,
1361: ra_customer_trx_lines_all rcl,
1362: mtl_parameters mp /* INVCONV umoogala 17-oct-2004 */
1363: WHERE
1356: ap_invoice_distributions_all aid,
1357: ap_invoices_all ai,
1358: oe_order_headers_all sh,
1359: oe_order_lines_all sl_parent,
1360: oe_order_lines_all sl_child,
1361: ra_customer_trx_lines_all rcl,
1362: mtl_parameters mp /* INVCONV umoogala 17-oct-2004 */
1363: WHERE
1364: ai.invoice_id = aid.invoice_id
1472: mta.reference_account -- added for ER 3007482
1473: FROM
1474: cst_margin_build cr,
1475: oe_order_headers_all rma,
1476: oe_order_lines_all rma_line,
1477: mtl_material_transactions mmt,
1478: cst_organization_definitions cod,
1479: mtl_transaction_accounts mta,
1480: mtl_parameters mp /* INVCONV umoogala 17-oct-2004 */
1573: ),
1574: sl_child.return_context,
1575: sl_child.reference_line_id
1576: FROM
1577: oe_order_lines_all sl_parent,
1578: oe_order_lines_all sl_child,
1579: oe_order_headers_all sh
1580: WHERE
1581: NVL(sl_parent.org_id, -999) =
1574: sl_child.return_context,
1575: sl_child.reference_line_id
1576: FROM
1577: oe_order_lines_all sl_parent,
1578: oe_order_lines_all sl_child,
1579: oe_order_headers_all sh
1580: WHERE
1581: NVL(sl_parent.org_id, -999) =
1582: NVL(l_ou_id, NVL(sl_parent.org_id, -999))