DBA Data[Home] [Help]

VIEW: APPS.EAM_CAPT_BILL_BY_REQ_V

Source

View Text - Preformatted

SELECT wro.wip_entity_id WIP_ENTITY_ID , wro.organization_id ORGANIZATION_ID , wro.operation_seq_num OP_SEQ_NUM , wro.inventory_item_id ITEM_RESOURCE_ID , msi.concatenated_segments ITEM_RESOURCE_NAME , 1 TYPE , msi.primary_uom_code UOM , wro.quantity_issued APPLIED_QUANTITY , nvl(sum(ewob.billed_quantity), 0) BILLED_QUANTITY , wro.inventory_item_id BILL_INVENTORY_ITEM_ID , msi.primary_uom_code BILL_UOM , wro.quantity_issued - nvl(sum(ewob.billed_quantity), 0) BILL_QUANTITY , ewob.billing_method FROM ( SELECT * FROM eam_work_order_bills WHERE billing_method = 3 ) ewob , wip_eam_parameters wep , wip_requirement_operations wro , mtl_system_items_kfv msi WHERE wro.wip_entity_id = ewob.wip_entity_id(+) AND wep.organization_id(+) = ewob.organization_id AND wro.organization_id = ewob.organization_id(+) AND wro.operation_seq_num = ewob.operation_seq_num(+) AND wro.inventory_item_id = ewob.inventory_item_id(+) AND msi.organization_id = wro.organization_id AND msi.inventory_item_id = wro.inventory_item_id GROUP BY wro.wip_entity_id, wro.organization_id, wro.operation_seq_num, wro.inventory_item_id, msi.concatenated_segments, 1 , msi.primary_uom_code, wro.quantity_issued, wro.inventory_item_id , ewob.billing_method UNION SELECT wor.wip_entity_id WIP_ENTITY_ID , wor.organization_id ORGANIZATION_ID , wor.operation_seq_num OP_SEQ_NUM , wor.resource_id ITEM_RESOURCE_ID , br.resource_code ITEM_RESOURCE_NAME , 2 TYPE , wor.uom_code UOM , wor.applied_resource_units APPLIED_QUANTITY , nvl(sum(ewob.billed_quantity), 0) BILLED_QUANTITY , null BILL_INVENTORY_ITEM_ID , null BILL_UOM , wor.applied_resource_units - nvl(sum(ewob.billed_quantity), 0) BILL_QUANTITY , ewob.billing_method FROM ( SELECT * FROM eam_work_order_bills WHERE billing_method = 3 ) ewob , wip_operation_resources wor , bom_resources br WHERE wor.wip_entity_id = ewob.wip_entity_id(+) AND wor.organization_id = ewob.organization_id(+) AND wor.operation_seq_num = ewob.operation_seq_num(+) AND wor.resource_id = ewob.resource_id(+) AND br.organization_id = wor.organization_id AND br.resource_id = wor.resource_id GROUP BY wor.wip_entity_id, wor.organization_id, wor.operation_seq_num, wor.resource_id, br.resource_code, 2 , wor.uom_code, wor.applied_resource_units, null, null, ewob.billing_method UNION SELECT edirv.wip_entity_id wip_entity_id , edirv.organization_id organization_id , edirv.task_number op_seq_num , nvl(edirv.inventory_item_id, edirv.direct_item_sequence_id) item_resource_id , nvl(edirv.item_description, edirv.description) item_resource_name , 3 type , edirv.uom_code uom , edirv.quantity_received applied_quantity , nvl(sum(ewob.billed_quantity), 0) billed_quantity , edirv.inventory_item_id bill_inventory_item_id , edirv.uom_code bill_uom , edirv.quantity_received - nvl(sum(ewob.billed_quantity), 0) BILL_QUANTITY , 3 billing_method FROM eam_work_order_bills ewob , eam_direct_item_recs_v edirv WHERE edirv.wip_entity_id = ewob.wip_entity_id(+) and edirv.organization_id = ewob.organization_id(+) and edirv.task_number = ewob.operation_seq_num(+) and nvl(edirv.inventory_item_id, edirv.direct_item_sequence_id) = ewob.resource_id (+) and ewob.billing_method(+) = 3 GROUP BY edirv.wip_entity_id, edirv.organization_id, edirv.task_number, edirv.inventory_item_id, edirv.direct_item_sequence_id, edirv.item_description, edirv.description, 3 , edirv.quantity_received, edirv.uom_code, ewob.billing_method
View Text - HTML Formatted

SELECT WRO.WIP_ENTITY_ID WIP_ENTITY_ID
, WRO.ORGANIZATION_ID ORGANIZATION_ID
, WRO.OPERATION_SEQ_NUM OP_SEQ_NUM
, WRO.INVENTORY_ITEM_ID ITEM_RESOURCE_ID
, MSI.CONCATENATED_SEGMENTS ITEM_RESOURCE_NAME
, 1 TYPE
, MSI.PRIMARY_UOM_CODE UOM
, WRO.QUANTITY_ISSUED APPLIED_QUANTITY
, NVL(SUM(EWOB.BILLED_QUANTITY)
, 0) BILLED_QUANTITY
, WRO.INVENTORY_ITEM_ID BILL_INVENTORY_ITEM_ID
, MSI.PRIMARY_UOM_CODE BILL_UOM
, WRO.QUANTITY_ISSUED - NVL(SUM(EWOB.BILLED_QUANTITY)
, 0) BILL_QUANTITY
, EWOB.BILLING_METHOD
FROM ( SELECT *
FROM EAM_WORK_ORDER_BILLS
WHERE BILLING_METHOD = 3 ) EWOB
, WIP_EAM_PARAMETERS WEP
, WIP_REQUIREMENT_OPERATIONS WRO
, MTL_SYSTEM_ITEMS_KFV MSI
WHERE WRO.WIP_ENTITY_ID = EWOB.WIP_ENTITY_ID(+)
AND WEP.ORGANIZATION_ID(+) = EWOB.ORGANIZATION_ID
AND WRO.ORGANIZATION_ID = EWOB.ORGANIZATION_ID(+)
AND WRO.OPERATION_SEQ_NUM = EWOB.OPERATION_SEQ_NUM(+)
AND WRO.INVENTORY_ITEM_ID = EWOB.INVENTORY_ITEM_ID(+)
AND MSI.ORGANIZATION_ID = WRO.ORGANIZATION_ID
AND MSI.INVENTORY_ITEM_ID = WRO.INVENTORY_ITEM_ID GROUP BY WRO.WIP_ENTITY_ID
, WRO.ORGANIZATION_ID
, WRO.OPERATION_SEQ_NUM
, WRO.INVENTORY_ITEM_ID
, MSI.CONCATENATED_SEGMENTS
, 1
, MSI.PRIMARY_UOM_CODE
, WRO.QUANTITY_ISSUED
, WRO.INVENTORY_ITEM_ID
, EWOB.BILLING_METHOD UNION SELECT WOR.WIP_ENTITY_ID WIP_ENTITY_ID
, WOR.ORGANIZATION_ID ORGANIZATION_ID
, WOR.OPERATION_SEQ_NUM OP_SEQ_NUM
, WOR.RESOURCE_ID ITEM_RESOURCE_ID
, BR.RESOURCE_CODE ITEM_RESOURCE_NAME
, 2 TYPE
, WOR.UOM_CODE UOM
, WOR.APPLIED_RESOURCE_UNITS APPLIED_QUANTITY
, NVL(SUM(EWOB.BILLED_QUANTITY)
, 0) BILLED_QUANTITY
, NULL BILL_INVENTORY_ITEM_ID
, NULL BILL_UOM
, WOR.APPLIED_RESOURCE_UNITS - NVL(SUM(EWOB.BILLED_QUANTITY)
, 0) BILL_QUANTITY
, EWOB.BILLING_METHOD
FROM ( SELECT *
FROM EAM_WORK_ORDER_BILLS
WHERE BILLING_METHOD = 3 ) EWOB
, WIP_OPERATION_RESOURCES WOR
, BOM_RESOURCES BR
WHERE WOR.WIP_ENTITY_ID = EWOB.WIP_ENTITY_ID(+)
AND WOR.ORGANIZATION_ID = EWOB.ORGANIZATION_ID(+)
AND WOR.OPERATION_SEQ_NUM = EWOB.OPERATION_SEQ_NUM(+)
AND WOR.RESOURCE_ID = EWOB.RESOURCE_ID(+)
AND BR.ORGANIZATION_ID = WOR.ORGANIZATION_ID
AND BR.RESOURCE_ID = WOR.RESOURCE_ID GROUP BY WOR.WIP_ENTITY_ID
, WOR.ORGANIZATION_ID
, WOR.OPERATION_SEQ_NUM
, WOR.RESOURCE_ID
, BR.RESOURCE_CODE
, 2
, WOR.UOM_CODE
, WOR.APPLIED_RESOURCE_UNITS
, NULL
, NULL
, EWOB.BILLING_METHOD UNION SELECT EDIRV.WIP_ENTITY_ID WIP_ENTITY_ID
, EDIRV.ORGANIZATION_ID ORGANIZATION_ID
, EDIRV.TASK_NUMBER OP_SEQ_NUM
, NVL(EDIRV.INVENTORY_ITEM_ID
, EDIRV.DIRECT_ITEM_SEQUENCE_ID) ITEM_RESOURCE_ID
, NVL(EDIRV.ITEM_DESCRIPTION
, EDIRV.DESCRIPTION) ITEM_RESOURCE_NAME
, 3 TYPE
, EDIRV.UOM_CODE UOM
, EDIRV.QUANTITY_RECEIVED APPLIED_QUANTITY
, NVL(SUM(EWOB.BILLED_QUANTITY)
, 0) BILLED_QUANTITY
, EDIRV.INVENTORY_ITEM_ID BILL_INVENTORY_ITEM_ID
, EDIRV.UOM_CODE BILL_UOM
, EDIRV.QUANTITY_RECEIVED - NVL(SUM(EWOB.BILLED_QUANTITY)
, 0) BILL_QUANTITY
, 3 BILLING_METHOD
FROM EAM_WORK_ORDER_BILLS EWOB
, EAM_DIRECT_ITEM_RECS_V EDIRV
WHERE EDIRV.WIP_ENTITY_ID = EWOB.WIP_ENTITY_ID(+)
AND EDIRV.ORGANIZATION_ID = EWOB.ORGANIZATION_ID(+)
AND EDIRV.TASK_NUMBER = EWOB.OPERATION_SEQ_NUM(+)
AND NVL(EDIRV.INVENTORY_ITEM_ID
, EDIRV.DIRECT_ITEM_SEQUENCE_ID) = EWOB.RESOURCE_ID (+)
AND EWOB.BILLING_METHOD(+) = 3 GROUP BY EDIRV.WIP_ENTITY_ID
, EDIRV.ORGANIZATION_ID
, EDIRV.TASK_NUMBER
, EDIRV.INVENTORY_ITEM_ID
, EDIRV.DIRECT_ITEM_SEQUENCE_ID
, EDIRV.ITEM_DESCRIPTION
, EDIRV.DESCRIPTION
, 3
, EDIRV.QUANTITY_RECEIVED
, EDIRV.UOM_CODE
, EWOB.BILLING_METHOD