zoukankan      html  css  js  c++  java
  • EBS 物料单位换算

    api: inv_convert.inv_um_convert

    FUNCTION get_uom_rate(pn_item_id NUMBER
    ,pv_from_uom VARCHAR2) RETURN NUMBER AS
    lv_from_uom_code VARCHAR2(15);
    lv_from_uom VARCHAR2(15);
    lv_to_uom_code VARCHAR2(15);
    lv_to_uom VARCHAR2(15);

    ln_return_rate NUMBER;
    BEGIN
    BEGIN
    SELECT msi.primary_uom_code
    ,msi.primary_unit_of_measure
    INTO lv_to_uom_code
    ,lv_to_uom
    FROM mtl_system_items_b msi
    WHERE msi.inventory_item_id = pn_item_id
    AND msi.organization_id = gn_default_organization_id;
    EXCEPTION
    WHEN OTHERS THEN
    lv_to_uom_code := NULL;
    END;
    --dbms_output.put_line(pv_from_uom ||'--'||lv_to_uom_code||'--');
    IF pv_from_uom = lv_to_uom
    THEN
    ln_return_rate := 1;
    ELSE
    SELECT inv_uom.from_uom_code
    INTO lv_from_uom_code
    FROM (SELECT mucc.from_uom_code
    ,mucc.from_uom_class
    ,mucc.from_unit_of_measure
    ,mucc.inventory_item_id
    FROM mtl_uom_class_conversions mucc
    UNION
    SELECT mucc.to_uom_code
    ,mucc.to_uom_class
    ,mucc.to_unit_of_measure
    ,mucc.inventory_item_id
    FROM mtl_uom_class_conversions mucc) inv_uom
    WHERE inv_uom.from_unit_of_measure = pv_from_uom
    AND inv_uom.inventory_item_id = pn_item_id;

    ln_return_rate := inv_convert.inv_um_convert(pn_item_id, lv_from_uom_code, lv_to_uom_code);
    END IF;
    RETURN ln_return_rate;
    END;

  • 相关阅读:
    B
    A
    【转】通过身边小事解释机器学习是什么?
    【转】什么是无监督学习?
    机器学习中的监督学习和无监督学习
    经典传染病传播模型
    复杂网络的主要研究内容
    网络科学导论【第一章】读书脑图
    无标度网络模型
    小世界网络模型
  • 原文地址:https://www.cnblogs.com/gary-bao/p/4861145.html
Copyright © 2011-2022 走看看