365: CURSOR COST_C IS
366: SELECT NVL(cst.item_cost,0)
367: FROM cst_cost_types cct,
368: mtl_parameters mtl,
369: cst_item_costs cst
370: WHERE (cst.cost_type_id = cct.cost_type_id
371: OR (cst.cost_type_id = cct.default_cost_type_id
372: AND (NOT EXISTS (SELECT 'Primary Cost Type Row'
373: FROM cst_item_costs cst1
369: cst_item_costs cst
370: WHERE (cst.cost_type_id = cct.cost_type_id
371: OR (cst.cost_type_id = cct.default_cost_type_id
372: AND (NOT EXISTS (SELECT 'Primary Cost Type Row'
373: FROM cst_item_costs cst1
374: WHERE cst1.inventory_item_id = cst.inventory_item_id
375: AND cst1.organization_id = cst.organization_id
376: AND cst1.cost_type_id = cct.cost_type_id))))
377: AND cct.costing_method_type = mtl.primary_cost_method
402: + NVL(cst.tl_material_overhead,0)
403: + NVL(cst.tl_outside_processing,0)
404: FROM cst_cost_types cct,
405: mtl_parameters mtl,
406: cst_item_costs cst
407: WHERE (cst.cost_type_id = cct.cost_type_id
408: OR (cst.cost_type_id = cct.default_cost_type_id
409: AND (NOT EXISTS (SELECT 'Primary Cost Type Row'
410: FROM cst_item_costs cst1
406: cst_item_costs cst
407: WHERE (cst.cost_type_id = cct.cost_type_id
408: OR (cst.cost_type_id = cct.default_cost_type_id
409: AND (NOT EXISTS (SELECT 'Primary Cost Type Row'
410: FROM cst_item_costs cst1
411: WHERE cst1.inventory_item_id = cst.inventory_item_id
412: AND cst1.organization_id = cst.organization_id
413: AND cst1.cost_type_id = cct.cost_type_id))))
414: AND cct.costing_method_type = mtl.primary_cost_method