Jianw
2025-05-13 3b39fe3810c3ee2ec9ec97236c1769c5c85e062c
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
--[[
    编码: WMS-01-10
    名称: 容器-Rest
    作者:HAN  
    日期:2025-1-29
 
    级别: 项目
    
    函数: Reset
 
    功能:
        -- 这个脚本一般有WPF进行调用
        -- 根据 CG_Detail 重新设置容器的明细数量,容器、料格空满状态
 
    更改记录:
 
--]]
wms_cntr= require( "wms_container" )
 
function Reset( strLuaDEID ) 
    local nRet, strRetInfo
    local cntr
    nRet, cntr = m3.GetSysCurEditDataObj( strLuaDEID, "Container" )
    if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "获取当前编辑属性失败! "..task ) end  
    
    -- 先清除一下 CG_Detail 中Qty <=0 的记录
    local strCondition = "S_CNTR_CODE = '" .. cntr.code .."' AND F_QTY <= 0"
    nRet, strRetInfo = mobox.dbdeleteData(strLuaDEID, "CG_Detail", strCondition)
    if (nRet ~= 0) then lua.Error( strLuaDEID, debug.getinfo(1), "删除【CG_Detail】失败!"..strRetInfo) end   
    
    -- 重置容器属性
    wms_cntr.Reset( strLuaDEID, cntr )
end