[Home] [Help]
1: PACKAGE BODY GMDFMVAL_PUB AS
2: /* $Header: GMDPFMVB.pls 120.13.12010000.2 2008/10/14 11:56:02 kannavar ship $ */
3: /* ============================================= */
4: /* PROCEDURE: */
5: /* get_formula_id */
15: /* returns xvalue as NULL and xreturn_code contains the */
16: /* error code. */
17: /* */
18: /* SYNOPSIS: */
19: /* iret := GMDFMVAL_PUB.get_formula_id(pformula_no, */
20: /* pversion, */
21: /* ptype, */
22: /* xvalue, */
23: /* xreturn_code); */
131: /* returns xvalue as NULL and xreturn_code contains the */
132: /* error code. */
133: /* */
134: /* SYNOPSIS: */
135: /* iret := GMDFMVAL_PUB.get_item_id(pitem_no, */
136: /* xitem_id, */
137: /* xitem_um, */
138: /* xreturn_code); */
139: /* */
243: /* returns values as NULL and xreturn_code contains the */
244: /* error code. */
245: /* */
246: /* SYNOPSIS: */
247: /* iret := GMDFMVAL_PUB.determine_product(formula_id, */
248: /* xitem_id, */
249: /* xitem_um, */
250: /* xreturn_code); */
251: /* */
382: /* validating a formula class */
383: /* based on the passed in formula class */
384: /* */
385: /* SYNOPSIS: */
386: /* iret := GMDFMVAL_PUB.formula_class_val(pform_class); */
387: /* */
388: /* RETURNS: */
389: /* 0 Success */
390: /* -92206 Formula Class Not Found. */
438: /* for products only. */
439: /* */
440: /* */
441: /* SYNOPSIS: */
442: /* iret := GMDFMVAL_PUB.cost_alloc_val(pcost_alloc, */
443: /* pline_type); */
444: /* */
445: /* RETURNS: */
446: /* 0 Success */
504: /* 2 - Costing */
505: /* 3 - MSDS (Material Safety Data Sheets) */
506: /* */
507: /* SYNOPSIS: */
508: /* iret := GMDFMVAL_PUB.formula_class_val(pcolumn_name, */
509: /* pvalue); */
510: /* */
511: /* RETURNS: */
512: /* 0 Success */
622: /* */
623: /* This validation is for CHANGES only! */
624: /* */
625: /* SYNOPSIS: */
626: /* iret := GMDFMVAL_PUB.locked_effectivity_val(pformula_id); */
627: /* */
628: /* RETURNS: */
629: /* 0 Success (effectivity may be changed) */
630: /* -92213 Effectivity is locked (update not allowed) */
680: /* formualted UOM of the item is different from */
681: /* the item's primary inventored UOM. */
682: /* */
683: /* SYNOPSIS: */
684: /* iret := GMDFMVAL_PUB.convertuom_val(pitem_id, */
685: /* pfrom_uom, */
686: /* pto_uom); */
687: /* */
688: /* pitem_id the item surrogate (unique number). */
1474: check_type_exception EXCEPTION;
1475: BEGIN
1476: /* Use the function type_val to validate the */
1477: /* field type. Checks if it exists in GEM_LOOKUPS */
1478: iret := GMDFMVAL_PUB.type_val( 'REWORK_TYPE',pType_value);
1479:
1480: If (iret <> 0) THEN
1481: xReturn := 'E';
1482: RAISE check_type_exception;
1604: --The value for by_product_type is only applicable for byproducts
1605: IF (X_formula_dtl.line_type <> 2) THEN
1606: RAISE inv_line_type;
1607: ELSE
1608: l_ret := GMDFMVAL_PUB.type_val(ptype_name => 'GMD_BY_PRODUCT_TYPE',
1609: Pvalue => X_formula_dtl.by_product_type);
1610: IF l_ret <> 0 THEN
1611: RAISE Inv_Byprod_Type;
1612: ELSE
1620: X_formula_dtl.by_product_type := NULL;
1621: END IF;
1622:
1623: --Phantom_type validation
1624: l_ret := GMDFMVAL_PUB.type_val('PHANTOM_TYPE',X_formula_dtl.phantom_type);
1625:
1626: IF (l_ret <> 0) THEN
1627: xReturn := 'E';
1628: RAISE check_type_exception;
1638: xReturn := 'S';
1639: END IF;
1640:
1641: IF (xReturn = 'S') then
1642: l_ret := GMDFMVAL_PUB.type_val('LINE_TYPE',X_formula_dtl.line_type);
1643: IF (l_ret < 0) then
1644: xReturn := 'E';
1645: RAISE check_line_type_exception;
1646: ELSE
1648: END IF;
1649: END IF;
1650:
1651: --Release Type validation
1652: l_ret := GMDFMVAL_PUB.type_val('RELEASE_TYPE',X_formula_dtl.release_type);
1653:
1654: IF (l_ret <> 0) THEN
1655: xReturn := 'E';
1656: RAISE check_rel_type_exception;
1658: xReturn := 'S';
1659: END IF;
1660:
1661: --Scale Type validation
1662: l_ret := GMDFMVAL_PUB.type_val('SCALE_TYPE',X_formula_dtl.scale_type_dtl);
1663:
1664: IF (l_ret <> 0) THEN
1665: xReturn := 'E';
1666: RAise check_scale_type_exception;
1670:
1671: --Item Uom Validation
1672: IF (X_formula_dtl.inventory_item_id IS NOT NULL) then
1673: --Based on the item_id get its primary UOM
1674: GMDFMVAL_PUB.get_item_id(pitem_no => X_formula_dtl.Item_no,
1675: pinventory_item_id => X_formula_dtl.inventory_item_id,
1676: porganization_id => X_formula_dtl.owner_organization_id,
1677: xitem_id => lItem_id,
1678: xitem_um => lItem_um,
1911: --The value for by_product_type is only applicable for byproducts
1912: IF (X_formula_dtl.line_type <> 2) THEN
1913: RAISE inv_line_type;
1914: ELSE
1915: l_ret := GMDFMVAL_PUB.type_val(ptype_name => 'GMD_BY_PRODUCT_TYPE',
1916: Pvalue => X_formula_dtl.by_product_type);
1917: IF l_ret <> 0 THEN
1918: RAISE Inv_Byprod_Type;
1919: ELSE
1927: X_formula_dtl.by_product_type := NULL;
1928: END IF;
1929:
1930: --Phantom_type validation
1931: l_ret := GMDFMVAL_PUB.type_val('PHANTOM_TYPE',X_formula_dtl.phantom_type);
1932:
1933: IF (l_ret <> 0) THEN
1934: xReturn := 'E';
1935: RAISE check_type_exception;
1937: xReturn := 'S';
1938: END IF;
1939:
1940: --Release Type validation
1941: l_ret := GMDFMVAL_PUB.type_val('RELEASE_TYPE',X_formula_dtl.release_type);
1942:
1943: IF (l_ret <> 0) THEN
1944: xReturn := 'E';
1945: RAISE check_rel_type_exception;
1947: xReturn := 'S';
1948: END IF;
1949:
1950: --Scale Type validation
1951: l_ret := GMDFMVAL_PUB.type_val('SCALE_TYPE',X_formula_dtl.scale_type_dtl);
1952:
1953: IF (l_ret <> 0) THEN
1954: xReturn := 'E';
1955: RAise check_scale_type_exception;
1958: END IF;
1959:
1960: --Item Uom Validation
1961: --Based on the item_id get its primary UOM
1962: GMDFMVAL_PUB.get_item_id(pitem_no => X_formula_dtl.Item_no,
1963: pinventory_item_id => X_formula_dtl.inventory_item_id,
1964: porganization_id => X_formula_dtl.owner_organization_id,
1965: xitem_id => lItem_id,
1966: xitem_um => lItem_um,
2216: END IF; -- IF (Cur_check_inactive%FOUND) THEN
2217: END IF; -- IF (V_formula_id IS NOT NULL) THEN
2218: RETURN FALSE;
2219: END inactive_items;
2220: END GMDFMVAL_PUB;