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
ÿþ--[[
    x: WMS-81-02
     Tðy: úQeQ“^KmՋ-Rú^T
    \O€ÿHAN  
    åegÿ2024-1-19
 
    §~+RÿúVš[ (ô‹f,gµkãNx(Wy˜îv-N N*YOØSS)
    
    ýQpeÿ AfterDataObjCreate
 
    ŸRý€:
        -- ‚Yœg/f eQ“^ Rú^T ÿOŠb ¹[hVŒTîvh'MOۏLˆÑ~š[ ÿv^NžX R“^:S0ÓN“^ϑ
        -- ‚Yœg/f úQ“^ Rú^T ÿ¹[hVŒT'MOã‰Ñ~ ÿÏQ“^:S0ÓN“^ϑ
    ôf9e°‹U_:
--]]
 
wms_wh = require( "wms_wh" )
 
function AfterDataObjCreate ( strLuaDEID ) 
    local   nRet, strRetInfo
 
    -- step1: ·ƒÖSS_MR0úQeQ“^KmՋ0ù[aŒ
    local test
    nRet, test = m3.GetSysCurEditDataObj( strLuaDEID, "WMS_TEST_WH_IO" )
    if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "·ƒÖSS_MR‘^\'`1Y%! "..test ) end 
    if ( test.cntr_code == '' or test.cntr_code == nil ) then
        lua.Error( strLuaDEID, debug.getinfo(1), "¹[hV÷S Ný€:Nzz! " ) 
    end
    
    lua.Debug( strLuaDEID, debug.getinfo(1), "test_type", test.test_type )
    
    if (test.test_type == "eQ“^") then
        if (test.loc_code == nil or  test.loc_code == nil ) then
            lua.Error( strLuaDEID, debug.getinfo(1), "eQ“^Å_{˜‰nxš['MO! " ) 
        end
        local loc
        nRet, loc = wms_wh.GetLocInfo( test.loc_code)
        if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "WMS_GetLocInfo1Y%! "..loc ) end
 
        nRet, strRetInfo = wms_wh.Loc_Container_Binding( strLuaDEID, test.loc_code, test.cntr_code, "Ñ~š[ã‰Ñ~¹eÕl-ºNå]",  "KmՋpenc(u‹O" )
        if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), ''MO¹[hVÑ~š[1Y%!'..strRetInfo ) end       
        
        --  R“^:S/“^ϑhˆ ÿÇCG_Detail    ÿ
        wms_base.Add_WHAreaQty_ByCGDetail(strLuaDEID, loc.wh_code, loc.area_code, test.cntr_code )
    else
        local loc_code = wms_wh.GetLocCodeByCNTR( strLuaDEID, test.cntr_code )
        if ( loc_code == "") then
            lua.Error( strLuaDEID, debug.getinfo(1), "¹[hV÷S'"..test.cntr_code.."'¡l    gŒT'MOÑ~š[!" ) 
        end
        local loc
        bRet, loc = wms_wh.GetLocInfo( loc_code)
        if ( nRet ~= 0 )  then lua.Error( strLuaDEID, debug.getinfo(1), "WMS_GetLocInfo1Y%! "..loc ) end
        nRet, strRetInfo = wms_wh.Loc_Container_Unbinding( strLuaDEID, loc.code, test.cntr_code, "Ñ~š[ã‰Ñ~¹eÕl-ºNå]",  "KmՋpenc(u‹O" )
        if ( nRet ~= 0 ) then lua.Error( strLuaDEID, debug.getinfo(1), ''MO¹[hVÑ~š[1Y%!'..strRetInfo ) end       
               
        -- ÏQ“^:S/ÓN“^ϑhˆ ÿÇCG_Detail    ÿ
        wms_base.Reduce_WHAreaQty_ByCGDetail(strLuaDEID, loc.wh_code, loc.area_code, test.cntr_code )
    end
end