Jianw
2025-05-14 29f8b36ebb718d2051bf0e7e701973ec4419ee80
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--[[
    编码: WMS-31-10
    名称: 盘点差异-盘点差异转移
    作者:HAN  
    日期:2025-1-29
    级别:固定 (说明本段代码在项目中不太会变化)
    
    函数: CountDiffProcess
 
    功能:
        根据选中的【盘点差异】表重新设置CG_Detail和库存量表
        把盘点结果上报给上游系统
 
    更改记录:
        V2.0 HAN 2025-2-9
             盘点差异转移时需要把差异数量批分到 CG_Detail上,如果盘点的时候是把两个相同的货品合并一起盘点的情况
--]]
wms_count= require( "wms_count" )
 
function CountDiffProcess ( strLuaDEID ) 
    local   nRet, strRetInfo
 
    -- step1  获取当前点中盘点差异
    nRet, objs = m3.GetSysDataJson( strLuaDEID )
    if ( nRet ~=0 ) then lua.Error( strLuaDEID, debug.getinfo(1), objs ) end  
    nRet, strRetInfo = wms_count.CountDiff_Transfter ( strLuaDEID, objs ) 
    if ( nRet ~= 0 ) then
        mobox.stopProgram( strLuaDEID, strRetInfo )
        return
    end
    local nCount = #objs
 
    local action
    if ( nCount  == 1 ) then
        action = {
            {
                action_type = "refresh_cur_row",
                value = ""
            }
        }
    else
        action = {
            {
                action_type = "refresh",
                value = ""
            }
        }        
    end
    nRet, strRetInfo = mobox.setAction(strLuaDEID, lua.table2str(action))
    if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), "setAction错误: "..strRetInfo) end      
 
end