1
Jianw
9 天以前 70f29da38121b9a467841253e3268feb5df02902
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--[[
    编码: WMS-71-21
    名称: 库存量表差异-刷新库存量表
    作者:HAN  
    日期:2025-1-29
    级别:固定 (说明本段代码在项目中不太会变化)
    
    函数: ResetInventory
 
    功能:
        刷新仓库或库区量表
    更改记录:
   
--]]
 
wms_base = require ("wms_base")
 
function ResetInventory ( strLuaDEID ) 
    local nRet, strRetInfo
    local paramter
 
    nRet, paramter = m3.GetSysDataJson( strLuaDEID )
    if ( nRet ~=0 ) then lua.Error( strLuaDEID, debug.getinfo(1), paramter ) end  
    -- {"wh_code":"x","area_code":"x"}
    local wh_code = paramter.wh_code
    local area_code = paramter.area_code
    if ( wh_code == nil or wh_code == '') then lua.Error( strLuaDEID, debug.getinfo(1), "仓库编码必须有值! " ) end  
    if ( area_code == nil ) then area_code = '' end
 
    if ( area_code ~= '' ) then
        nRet, strRetInfo = wms.wms_ResetInventory( "Area", area_code )
        if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), strRetInfo ) end
    else
        nRet, strRetInfo = wms.wms_ResetInventory( "Warehouse", wh_code )
        if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), strRetInfo ) end        
    end
 
end