7638: TXBT.txn_billing_type_id, TXBT.transaction_type_id,
7639: G_ESTIMATE_SOURCE_CODE_WIP ESTIMATE_SOURCE_CODE,
7640: l_wip_entity_id ESTIMATE_SOURCE_ID,
7641: mmt.operation_seq_num OPERATION_SEQ_NUM
7642: FROM MTL_MATERIAL_TRANSACTIONS MMT, MTL_SYSTEM_ITEMS_KFV MSI,
7643: CSD_REPAIR_TYPES_SAR RTYP, CS_TXN_BILLING_TYPES TXBT
7644: WHERE MMT.transaction_source_id = l_wip_entity_id
7645: AND MMT.transaction_source_type_id = G_MTL_TXN_SOURCE_TYPE_WIP
7646: AND MMT.transaction_type_id IN( G_MTL_TXN_TYPE_COMP_ISSUE,
7660: l_wip_entity_id, mmt.operation_seq_num
7661: ORDER BY MMT.inventory_item_id;
7662:
7663: -- this query gets only the positive issued qty
7664: -- Note: positive issue qty are negative values in mtl_material_transactions table
7665: -- We will not count G_MTL_TXN_TYPE_COMP_RETURN transactions
7666: -- or negatively issued G_MTL_TXN_TYPE_COMP_ISSUE transactions
7667: CURSOR c_est_lines_from_materials1( l_wip_entity_id NUMBER,
7668: l_inventory_item_id NUMBER) IS
7674: TXBT.txn_billing_type_id, TXBT.transaction_type_id,
7675: G_ESTIMATE_SOURCE_CODE_WIP ESTIMATE_SOURCE_CODE,
7676: l_wip_entity_id ESTIMATE_SOURCE_ID,
7677: mmt.operation_seq_num OPERATION_SEQ_NUM
7678: FROM MTL_MATERIAL_TRANSACTIONS MMT, MTL_SYSTEM_ITEMS_KFV MSI,
7679: CSD_REPAIR_TYPES_SAR RTYP, CS_TXN_BILLING_TYPES TXBT
7680: WHERE MMT.transaction_source_id = l_wip_entity_id
7681: AND MMT.transaction_source_type_id = G_MTL_TXN_SOURCE_TYPE_WIP
7682: AND MMT.inventory_item_id <> l_inventory_item_id