[Home] [Help]
1003: gme_material_details gmd,
1004: mtl_transaction_lot_numbers mtln,
1005: mtl_parameters mp,
1006: hr_organization_information hoi,
1007: gme_transaction_pairs gtp
1008: WHERE gbsi.batch_id = p_batch_id
1009: AND gbsi.batchstep_id = p_batchstep_id
1010: AND mp.organization_id = mmt.organization_id
1011: AND hoi.organization_id = mmt.organization_id
1220: FROM mtl_system_items_b iimb,
1221: mtl_material_transactions mmt,
1222: gme_material_details gme,
1223: mtl_transaction_lot_numbers mtln,
1224: gme_transaction_pairs gtp
1225: WHERE mmt.trx_source_line_id = gme.material_detail_id
1226: AND mmt.transaction_source_type_id = 5 /* Rajesh B8290451 */
1227: AND mmt.transaction_source_id=gme.batch_id-- added by Francisco 23 Feb 2009
1228: AND gme.batch_id = p_batch_id
10321: up before the ingrediant transaction.
10322: In the order by clause if the item a phantom item , then we order by phantom_trans_date otherwise we order by trans_date
10323:
10324: dbms_output.put_line(' '); Now once the product transaction gets picked up before the ingrediant transaction for a phantom item, there are still couple more of issues.
10325: In gme_transaction_pairs the transaction_id2 is can be for actual reversal transaction , and also for phantom item there can be a transaction_id2 which
10326: stores the other transaction for item .Eg if for a phantom item LCIMT2 there are two transactions
10327: Transaction 1 having transaction_ID = 887 which is a product transaction
10328: Transaction 2 havign transaction_id = 890 which is an ingrediant transaction.
10329: Now in GTP there will be a transaction_id2 for both the transacions but they have pair_type =2 which will be 1 for pure reversal transactions.
10340: Change 3 : Changed the order by clause from ORDER BY 7,decode(transaction_action_id,27,-1,transaction_source_type_id)... to
10341: ORDER BY decode(phantom_type,1,phantom_trans_date,trans_date),decode(transaction_action_id,27,-1,transaction_source_type_id)...
10342: */
10343:
10344: -- PK Bug 9069363 use in line query for gme_transaction_pairs we do not want to consider pair_type 2 records since such records are created for
10345: -- phantom batches even when there is no reversals causing duplicate selection of data.
10346:
10347: -- Bug 13038249 Grupo viz changes starts
10348:
10423: NVL(gbh.routing_id, 0) as routing_id
10424: FROM mtl_material_transactions mmt,
10425: gme_material_details gme,
10426: mtl_transaction_lot_numbers mtln,
10427: (Select pair_type, transaction_id1, transaction_id2 From gme_transaction_pairs where pair_type = 1) gtp, -- PK Bug 9069363
10428: gmf_process_organizations_gt gpo,
10429: gme_batch_header gbh,
10430: gmf_lot_costed_items_gt lcig
10431: WHERE
10798: NVL(gbh.routing_id, 0) as routing_id
10799: FROM mtl_material_transactions mmt,
10800: gme_material_details gme,
10801: mtl_transaction_lot_numbers mtln,
10802: (Select pair_type, transaction_id1, transaction_id2 From gme_transaction_pairs where pair_type = 1) gtp, -- PK Bug 9069363
10803: gmf_process_organizations_gt gpo,
10804: gme_batch_header gbh,
10805: gmf_lot_costed_items_gt lcig
10806: WHERE