[Home] [Help]
946: =====================*/
947: CURSOR Cur_get_material_lines (V_step_id NUMBER) IS
948: -- NPD Conv. Use inventory_iem_id and detail_uom instead of item_id and item_um
949: SELECT s.formulaline_id, d.line_type, d.qty, d.detail_uom, d.inventory_item_id, d.scale_type
950: FROM gmd_recipe_step_materials s,
951: fm_matl_dtl d
952: WHERE s.recipe_id = P_parent_id
953: AND s.formulaline_id = d.formulaline_id
954: AND s.routingstep_id = V_step_id
1326: =====================*/
1327: CURSOR Cur_get_material_lines (V_step_id NUMBER) IS
1328: -- NPD Conv. Use inventory_item_id and detail_uom instead of item_id and item_um from fm_matl_dtl
1329: SELECT s.formulaline_id, d.line_type, d.qty, d.detail_uom, d.inventory_item_id, d.scale_type
1330: FROM gmd_recipe_step_materials s,
1331: fm_matl_dtl d
1332: WHERE s.recipe_id = P_parent_id
1333: AND s.formulaline_id = d.formulaline_id
1334: AND s.routingstep_id = V_step_id
1746: FROM fm_matl_dtl
1747: WHERE formula_id = V_formula_id
1748: AND NVL(contribute_step_qty_ind, 'Y') = 'Y'
1749: AND formulaline_id NOT IN (SELECT formulaline_id
1750: FROM gmd_recipe_step_materials
1751: WHERE recipe_id = P_check.parent_id)
1752: AND (P_check.formulaline_id IS NULL OR
1753: formulaline_id <> P_check.formulaline_id)
1754: ;
2082:
2083: CURSOR Cur_get_step_mat_recipes (p_formulaline_id NUMBER, p_routingstep_id NUMBER) IS
2084: SELECT m.recipe_id,
2085: r.recipe_status
2086: FROM gmd_recipe_step_materials m,
2087: gmd_recipes_b r,
2088: gmd_status_b s
2089: WHERE s.status_code = r.recipe_status
2090: AND r.recipe_id = m.recipe_id
2113:
2114: P_check_step_mat.ASQC_RECIPES := x_recipe_cntr;
2115:
2116: SELECT COUNT(unique recipe_id) into P_check_step_mat.STEP_ASSOC_RECIPES
2117: FROM gmd_recipe_step_materials
2118: WHERE (P_check.formulaline_id is not null AND formulaline_id = P_check.formulaline_id)
2119: OR
2120: (p_check.routingstep_id is not null AND routingstep_id = P_check.routingstep_id) ;
2121:
2137: -- DESCRIPTION:
2138: -- This PL/SQL procedure accepts a formulaline_id or routingstep_id
2139: -- which is being deleted from the formula material table or routing detail
2140: -- table, respectively. The formualine_id or routingstep_id is deleted from
2141: -- GMD_RECIPE_STEP_MATERIALS. Then, if ASQC flag = yes, step qty's are
2142: -- recalculated.
2143: --
2144: -- REQUIREMENTS
2145: -- Calling program must first call check_del_from_step_mat.
2204: -- For the next version, check if formulaline's which would go away because a routing step
2205: -- is deleted actually ARE marked as contributing-to-step-qty. If not, then asqc can be
2206: -- recalc'ed.
2207: IF P_check_step_mat.STEP_ASSOC_RECIPES > 0 THEN
2208: DELETE FROM gmd_recipe_step_materials
2209: WHERE (P_check.formulaline_id is not null AND formulaline_id = P_check.formulaline_id)
2210: OR
2211: (p_check.routingstep_id is not null AND routingstep_id = P_check.routingstep_id) ;
2212: