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
ÿþ--[[
    x: WMS-19-07
     Tðy: ¹[hV'ÁTfÆ~-Rú^T
    \O€ÿHAN
    åegÿ2023-10-25
 
    §~+RÿúVš[ (ô‹f,gµkãNx(Wy˜îv-N N*YOØSS)
 
    ýQpeÿ AfterDataObjCreate
 
    ŸRý€:
        -- Œ(u wms_CGBinding ¹[hV'ÁTÑ~š[Íd\O ÿv^ R
N¶gUSfÆ~-NÑ~š[peϑ
    ôf9e°‹U_:
        V8.0  HAN  2023/12/15
              -- ‚Yœg    g
N¶gUSMb—‰ R
N¶gUS-N„v/}¡‹Ñ~š[peϑ
=
        V9.0   HAN  2024-1-12
               -- Šb wms_CGBinding9e:Nwms_Putaway_IncAccBindingQty
        V9.1   HAN  2024-3-28
               -- Container hˆ-N„v N_DETAIL_COUNT + 1
--]]
 
json  = require("json")
mobox = require("OILua_JavelinExt")
m3    = require("oi_base_mobox")
function AfterDataObjCreate(strLuaDEID)
    local nRet, strRetInfo
 
    -- step1: ·ƒÖSS_MR0¹[hV'ÁTfÆ~0ù[aŒ
    local cg_detail
    nRet, cg_detail = m3.GetSysCurEditDataObj(strLuaDEID, "CG_Detail")
    if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "·ƒÖSS_MR‘^\'`1Y%! " .. cg_detail) end
 
    -- ·ƒÖS¹[hV(W0¹[hV'ÁTfÆ~0-N„v*Npe
    local count
    local strCondtion = "S_CNTR_CODE = '" .. cg_detail.cntr_code .. "'"
    nRet, count = mobox.getDataObjCount(strLuaDEID, "CG_Detail", strCondtion)
    if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "·ƒÖS¹[hV'ÁTfÆ~1Y%!") end
 
    -- V9.1 ¹[hV-N„v N_DETAIL_COUNT + 1
    local strCondition = "S_CODE = '" .. cg_detail.cntr_code .. "'"
    local strUpdateSql = "N_DETAIL_COUNT =" .. tonumber(count)
    nRet, strRetInfo = mobox.updateDataAttrByCondition(strLuaDEID, "Container", strCondition, strUpdateSql)
    if (nRet ~= 0) then lua.Error(strLuaDEID, debug.getinfo(1), "ôf°e0¹[hV0-N„vfÆ~agpe1Y%!" .. strRetInfo) end
end