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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
ÿþ---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by HUI.
--- DateTime: 2024/3/6 8:48
---
 
json = require("json")
mobox = require("OILua_JavelinExt")
require("oi_basestrfunc")
require("WMS-DevComm")
require("WMS-Equipment")
require("WMS-Container")
require("WMS-WHAreaLoc")
require("XX-BASE")
 
function AfterConfirm (strLuaDEID)
 
    Debug(strLuaDEID, debug.getinfo(1), "xØveQ“^-\ONRú^", 1)
 
    local nRet, strRetInfo, InStockInfo
 
    -- –™HQ·ƒÖSu˜b—“eQpenc
    nRet, strRetInfo = GetSysInputParameter(strLuaDEID)
    if (nRet ~= 0) then
        Error(strLuaDEID, debug.getinfo(1), "·ƒÖSS_MR‘ù[aŒ1Y%" .. strRetInfo)
    end
    if (strRetInfo == '') then
        mobox.setInfo(strLuaDEID, "“eQáOo` Ný€:Nzz!")
        return
    end
    Debug(strLuaDEID, debug.getinfo(1), ";N—zãSpenc:", strRetInfo)
 
    -- ·ƒÖS…_eQ“^—zãSáOo`
    nRet, InStockInfo = mobox.getCurEditDataPacket(strLuaDEID)
    if (nRet ~= 0) then
        Error(strLuaDEID, debug.getinfo(1), "àeÕl·ƒÖSLuapencS!")
    end
    if (InStockInfo == '') then
        mobox.setInfo(strLuaDEID, "…_eQ“^-N„váOo` Ný€:Nzz!")
        return
    end
    Debug(strLuaDEID, debug.getinfo(1), "…_eQ“^—zãSpenc:", InStockInfo)
 
    -- w¹p'MO
    local start_bit = InStockInfo.S_START_BIT
    -- È~¹p'MO
    local end_bit = InStockInfo.S_END_BIT
    -- ¹[hVx
    local cntr_code = InStockInfo.S_CNTR_CODE
    -- ¹[hV{|‹W
    local cntr_type = InStockInfo.S_CNTR_TYPE
    -- ir™e Tðy
    local item_name = InStockInfo.S_ITEM_NAME
    -- ir™ex
    local item_code = InStockInfo.S_ITEM_CODE
    -- peϑ
    local num = InStockInfo.N_NUM
 
 
    -- \ir™eŒTXbØvۏLˆÑ~š[
    local container_good = AllocObject(strLuaDEID, "Container_Good")
    container_good.cntr_no = cntr_code
    container_good.item_code = item_code
    container_good.item_name = item_name
    container_good.uom = "CSKQ"
    container_good.qty = num
    nRet, strRetInfo = CreateDataObj(strLuaDEID, container_good)
    if (nRet ~= 0) then
        Error(strLuaDEID, debug.getinfo(1), 'Rú^0¹[hV'ÁT01Y%!' .. strRetInfo)
    end
 
    -- ·ƒÖSw¹p'MOáOo`
    local location_start
    nRet, location_start = WMS_Location_GetInfo(strLuaDEID, start_bit)
    if (nRet ~= 0) then
        Error(strLuaDEID, debug.getinfo(1), 'WMS_Location_GetInfo·ƒÖS'MOáOo`1Y%!' .. location_start)
    end
 
    -- ·ƒÖSÈ~¹p'MOáOo`
    local location_end
    nRet, location_end = WMS_Location_GetInfo(strLuaDEID, end_bit)
    if (nRet ~= 0) then
        Error(strLuaDEID, debug.getinfo(1), 'WMS_Location_GetInfo·ƒÖS'MOáOo`1Y%!' .. location_end)
    end
 
    -- Rú^\ON
    local operation = AllocObject(strLuaDEID, "Operation")
    operation.start_wh_code = location_start.wh_code
    operation.start_area_code = location_start.area_code
    operation.start_loc_code = location_start.code
    operation.end_wh_code = location_end.wh_code
    operation.end_area_code = location_end.area_code
    operation.end_loc_code = location_end.code
    operation.op_type = WMS_nConst(strLuaDEID, "\ON{|‹W-eQ“^")
    operation.op_def_name = "xØveQ“^"
    operation.cntr_code = cntr_code
 
    Debug(strLuaDEID, debug.getinfo(1), "\ONRú^MR:", operation)
 
    nRet, strRetInfo = CreateDataObj(strLuaDEID, operation)
    if (nRet ~= 0) then
        Error(strLuaDEID, debug.getinfo(1), 'Rú^0\ON01Y%!' .. strRetInfo)
    end
 
end