lzh
2025-06-24 13c4a636539584ab977fddacfae884b3ec250aee
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
ÿþ--[[
 x: GT-100-19
  Tðy: ß~¡‹¹[hVpeϑ
 \O€: LZH
 eQãSýQpeÿGetCntrCount
 ŸRý€ô‹f: ß~¡‹@b    gFRIDpeϑåNÊSö€Fh;`peϑ0XbØv;`peϑ0ö€FhïS(uϑ0XbØvïS(uϑ
    “eQpencÿ                                                                                        
    {
    ÂSpe…_š[
    }
 
    Yt;‘
 
 ØSôf†SòS:
 --]]
require("WMS-Equipment")
wms_cntr = require( "wms_container" )
wms_wh = require( "wms_wh" )
require("GT-Base")
function GetCntrCount(strLuaDEID)
    local nRet, in_date
    -- step1 ·ƒÖS¥cãSpenc
    nRet, in_date = m3.GetSysDataJson(strLuaDEID)
    if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "WCStoreCallback àeÕl·ƒÖSpencS!" .. in_date) end
    lua.Debug(strLuaDEID, debug.getinfo(1), 'ÂSpe:', in_date)
 
    -- step2 $R­e Å_kXy˜ /f&Tý    g<Pÿ¡l<P¥b•ԏÞV
    --  local locationCode = in_date.locationCode -- w¹pMOn
    --  if (locationCode == nil or locationCode == '') then lua.Error(strLuaDEID, debug.getinfo(1), "w¹p Ný€:Nzz!") end
 
    -- ß~¡‹;`peϑ
    local container_count
    local strCondition = "S_CODE = S_CODE"
    nRet, container_count = mobox.getDataObjCount( strLuaDEID, "Container", strCondition )
    if (nRet ~= 0) then
        lua.Error(strLuaDEID, debug.getinfo(1), "ß~¡‹0¹[hVpeϑ01Y%! " .. container_count)
    end
 
    -- ß~¡‹ö€Fh;`peϑ
    local jk_count
    strCondition = "S_CODE LIKE '106EGR%'"
    nRet, jk_count = mobox.getDataObjCount( strLuaDEID, "Container", strCondition )
    if (nRet ~= 0) then
        lua.Error(strLuaDEID, debug.getinfo(1), "ß~¡‹0¹[hVpeϑ01Y%! " .. jk_count)
    end
 
    -- ß~¡‹XbØv;`peϑ
    local tp_count
    strCondition = "S_CODE LIKE '106EGP%'"
    nRet, tp_count = mobox.getDataObjCount( strLuaDEID, "Container", strCondition )
    if (nRet ~= 0) then
        lua.Error(strLuaDEID, debug.getinfo(1), "ß~¡‹0¹[hVpeϑ01Y%! " .. tp_count)
    end
 
    -- ß~¡‹ö€FhïS(upeϑ
    local bdjk_count
    strCondition = "S_CNTR_CODE LIKE '106EGR%'"
    nRet, bdjk_count = mobox.getDataObjCount( strLuaDEID, "CG_Detail", strCondition )
    if (nRet ~= 0) then
        lua.Error(strLuaDEID, debug.getinfo(1), "ß~¡‹0¹[hV'ÁTfÆ~01Y%! " .. bdjk_count)
    end
    -- ïS(uö€Fh = ö€Fh;`peϑ - Ñ~š[ö€Fh
    local kyjk_count = tonumber(jk_count) - tonumber(bdjk_count)
 
    -- ß~¡‹XbØvïS(upeϑ
    local bdtp_count
    strCondition = "S_CNTR_CODE LIKE '106EGP%'"
    nRet, bdtp_count = mobox.getDataObjCount( strLuaDEID, "CG_Detail", strCondition )
    if (nRet ~= 0) then
        lua.Error(strLuaDEID, debug.getinfo(1), "ß~¡‹0¹[hV'ÁTfÆ~01Y%! " .. bdtp_count)
    end
    -- ïS(uXbØv = XbØv;`peϑ - Ñ~š[XbØv
    local kytp_count = tonumber(tp_count) - tonumber(bdtp_count)
 
    local data = {
        container_count = container_count,
        jk_count = jk_count,
        tp_count = tp_count,
        kyjk_count = kyjk_count,
        kytp_count = kytp_count
    }
 
    mobox.returnValue(strLuaDEID,1,lua.table2str(data))
end