{"id":1175,"date":"2021-10-09T14:40:58","date_gmt":"2021-10-09T06:40:58","guid":{"rendered":"http:\/\/www.haoht.com.cn\/?p=1175"},"modified":"2021-10-09T14:40:58","modified_gmt":"2021-10-09T06:40:58","slug":"%e5%90%88%e5%90%8c%e7%9a%84%e9%87%87%e8%b4%ad%e6%b8%85%e5%8d%95%e4%bf%ae%e6%94%b9%e5%90%8e%e5%ba%94%e8%af%a5%e8%87%aa%e5%8a%a8%e6%9b%b4%e6%96%b0%e5%90%88%e5%90%8c%e6%80%bb%e4%bb%b7","status":"publish","type":"post","link":"http:\/\/www.haoht.com.cn\/1175\/","title":{"rendered":"\u5408\u540c\u7684\u91c7\u8d2d\u6e05\u5355\u4fee\u6539\u540e\u5e94\u8be5\u81ea\u52a8\u66f4\u65b0\u5408\u540c\u603b\u4ef7"},"content":{"rendered":"

\u5408\u540c\u7684\u91c7\u8d2d\u6e05\u5355\u4fee\u6539\u540e\u5e94\u8be5\u81ea\u52a8\u66f4\u65b0\u5408\u540c\u603b\u4ef7<\/h2>\n

— \u4ee5\u4e0b\u662f\u4ee3\u7801\u90e8\u5206<\/p>\n

–[[<\/div>\n
\u00a0 \u00a0 Code: SD-0404<\/div>\n
\u00a0 \u00a0 Author\uff1ahan\u00a0 \u00a0 \u00a0Create Date:\u00a0 2021-8-11<\/div>\n
\u00a0 \u00a0 Version\uff1aV1.0<\/div>\n
\u00a0 \u00a0 \u529f\u80fd:<\/div>\n
\u00a0 \u00a0 \u00a0 \u00a0 \u66f4\u65b0\u8ba2\u5355\u4e2d\u7684\u4ef7\u683c F_TOTAL<\/div>\n
–]]<\/div>\n
json\u00a0 = require (“json”)<\/div>\n
mobox = require (“OILua_JavelinExt”)<\/div>\n
<\/div>\n
function AfterDataObjModify ( strLuaDEID )<\/div>\n
\u00a0 \u00a0 local nRet,strRetInfo, strPOCode<\/div>\n
<\/div>\n
\u00a0 \u00a0 — \u83b7\u53d6 \u8ba2\u5355\u7f16\u53f7<\/div>\n
\u00a0 \u00a0 nRet, strRetInfo = mobox.getCurEditDataObjAttr( strLuaDEID, “S_PO_CODE”\u00a0 )<\/div>\n
\u00a0 \u00a0 if ( nRet ~= 0 or strRetInfo == ” ) then<\/div>\n
\u00a0 \u00a0 \u00a0 \u00a0 mobox.error( strLuaDEID, “\u83b7\u53d6\u4ef7\u683c\u4fe1\u606f\u5931\u8d25!” )<\/div>\n
\u00a0 \u00a0 \u00a0 \u00a0 return<\/div>\n
\u00a0 \u00a0 end<\/div>\n
\u00a0 \u00a0 local retAttrs = json.decode( strRetInfo )<\/div>\n
\u00a0 \u00a0 strPOCode = retAttrs[1].value<\/div>\n
<\/div>\n
\u00a0 \u00a0 — \u83b7\u53d6\u8fd9\u4e2a\u8ba2\u5355\u4e0b\u9762\u7684 \u603b\u4ef7<\/div>\n
\u00a0 \u00a0 local strCondition = “S_PO_CODE = ‘”..strPOCode..”‘”<\/div>\n
\u00a0 \u00a0 nRet, strRetInfo = mobox.getDataObjAttrSum( strLuaDEID, “\u91c7\u8d2d\u6e05\u5355”, strCondition, “F_SUBTOTAL” )<\/div>\n
\u00a0 \u00a0 if ( nRet ~= 0\u00a0 ) then<\/div>\n
\u00a0 \u00a0 \u00a0 \u00a0 mobox.error( strLuaDEID, strRetInfo)<\/div>\n
\u00a0 \u00a0 \u00a0 \u00a0 return<\/div>\n
\u00a0 \u00a0 end<\/div>\n
\u00a0 \u00a0 local fSumTotal = 0<\/div>\n
\u00a0 \u00a0 local retValue = json.decode( strRetInfo )<\/div>\n
\u00a0 \u00a0 if ( retValue[1] ~= ”\u00a0 ) then<\/div>\n
\u00a0 \u00a0 \u00a0 \u00a0 fSumTotal = tonumber( retValue[1] )<\/div>\n
\u00a0 \u00a0 end<\/div>\n
<\/div>\n
\u00a0 \u00a0 strCondition = “S_PO_CODE = ‘”..strPOCode..”‘”<\/div>\n
\u00a0 \u00a0 strSetAttr = “F_TOTAL = “..fSumTotal<\/div>\n
\u00a0 \u00a0 nRet, strRetInfo = mobox.updateDataAttrByCondition( strLuaDEID, “\u8ba2\u5355”, strCondition, strSetAttr )<\/div>\n
\u00a0 \u00a0 if ( nRet ~= 0 ) then<\/div>\n
\u00a0 \u00a0 \u00a0 \u00a0 mobox.error( strLuaDEID, strRetInfo )<\/div>\n
\u00a0 \u00a0 \u00a0 \u00a0 return<\/div>\n
\u00a0 \u00a0 end<\/div>\n
end<\/div>\n","protected":false},"excerpt":{"rendered":"

\u5408\u540c\u7684\u91c7\u8d2d\u6e05\u5355\u4fee\u6539\u540e\u5e94\u8be5\u81ea\u52a8\u66f4\u65b0\u5408\u540c\u603b\u4ef7 — \u4ee5\u4e0b\u662f\u4ee3\u7801\u90e8\u5206 –[[ \u00a0 \u00a0 Code […]<\/p>\n","protected":false},"author":1,"featured_media":1177,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,2],"tags":[15],"class_list":["post-1175","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ercikf","category-pcenter","tag-sql"],"_links":{"self":[{"href":"http:\/\/www.haoht.com.cn\/wp-json\/wp\/v2\/posts\/1175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.haoht.com.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.haoht.com.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.haoht.com.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.haoht.com.cn\/wp-json\/wp\/v2\/comments?post=1175"}],"version-history":[{"count":1,"href":"http:\/\/www.haoht.com.cn\/wp-json\/wp\/v2\/posts\/1175\/revisions"}],"predecessor-version":[{"id":1178,"href":"http:\/\/www.haoht.com.cn\/wp-json\/wp\/v2\/posts\/1175\/revisions\/1178"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.haoht.com.cn\/wp-json\/wp\/v2\/media\/1177"}],"wp:attachment":[{"href":"http:\/\/www.haoht.com.cn\/wp-json\/wp\/v2\/media?parent=1175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.haoht.com.cn\/wp-json\/wp\/v2\/categories?post=1175"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.haoht.com.cn\/wp-json\/wp\/v2\/tags?post=1175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}