取物料工作台-现有量

电子表—取现有量

物料工作台 现有量

inv_quantity_tree_pub.clear_quantity_cache;

        inv_quantity_tree_pub.query_quantities(p_api_version_number => 1.0

                                              ,p_init_msg_lst => 'F'

                                              ,x_return_status => l_return_status

                                              ,x_msg_count => l_msg_count

                                              ,x_msg_data => l_msg_data

                                              ,p_organization_id => p_organization_id

                                              ,p_inventory_item_id => p_inventory_item_id  -- 物料

                                              ,p_tree_mode => 2

                                              ,p_is_revision_control => FALSE

                                              ,p_is_lot_control => TRUE    --- 是否受批次控制

                                              ,p_is_serial_control => false  -- 是否受序列控制

                                              ,p_revision => NULL

                                              ,p_lot_number => p_lot_number  -- 批次

                                              ,p_lot_expiration_date => NULL

                                              ,p_subinventory_code => p_subinventory_code   -- 库存

                                              ,p_locator_id => p_inventory_location_id  -- 货位

                                              ,p_onhand_source => inv_quantity_tree_pvt.g_all_subs

                                              ,x_qoh => l_qoh  -- 现有量

                                              ,x_rqoh => l_rqoh

                                              ,x_qr => l_qr

                                              ,x_qs => l_qs

                                              ,x_att => l_att  -- 可用量

                                              ,x_atr => l_atr -- 可保留量);

 

FUNCTION get_item_att_qty(p_inventory_item_id     NUMBER,--物料

                            p_organization_id       NUMBER,--库存组织

                            p_subinventory_code     VARCHAR,--子库存

                            p_inventory_location_id NUMBER--

) RETURN NUMBER IS

    l_onhand_qty    NUMBER;

    l_resv_qty      NUMBER;

    l_qoh           NUMBER;

    l_rqoh          NUMBER;

    l_qr            NUMBER;

    l_qs            NUMBER;

    l_att           NUMBER;

    l_atr           NUMBER;

    l_tree_mode     NUMBER;

    l_booked_qty    NUMBER;

    l_msg_count     VARCHAR2(100);

    l_msg_data      VARCHAR2(1000);

    l_return_status VARCHAR2(1);

    x_return        VARCHAR2(1);

  BEGIN

    -- Transact mode

    l_tree_mode := 2;

    inv_quantity_tree_pub.clear_quantity_cache;

    inv_quantity_tree_pub.query_quantities(p_api_version_number  => 1.0,

                                           p_init_msg_lst        => 'F',

                                           x_return_status       => l_return_status,

                                           x_msg_count           => l_msg_count,

                                           x_msg_data            => l_msg_data,

                                           p_organization_id     => p_organization_id,

                                           p_inventory_item_id   => p_inventory_item_id,

                                           p_tree_mode           => l_tree_mode,

                                           p_is_revision_control => FALSE,

                                           p_is_lot_control      => FALSE,

                                           p_is_serial_control   => FALSE,

                                           p_revision            => NULL,

                                           p_lot_number          => NULL,

                                           p_lot_expiration_date => NULL,

                                           p_subinventory_code   => p_subinventory_code,

                                           p_locator_id          => p_inventory_location_id,

                                           p_onhand_source       => inv_quantity_tree_pvt.g_all_subs,

                                           x_qoh                 => l_qoh,

                                           x_rqoh                => l_rqoh,

                                           x_qr                  => l_qr,

                                           x_qs                  => l_qs,

                                           x_att                 => l_att, --可用量

                                           x_atr                 => l_atr); --可保留量  

  

    RETURN l_att;

  END get_item_att_qty;

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

鱼鱼章

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值