闲来无聊,问了几个同事,居然没有一个答对的。
有的说Economic Stock需要考虑Inventory Blocked,有人说需要考虑Committed(上图没有显示出来,因为默认不显示,而我们公司在用Commitment),核心的On Order和Allocated是大家公认的。
于是花了几分钟从代码中找到正确的公式: Economic Stock = On Hand + On Order – Allocated
function calculate.total.fields()
{
select sum(whwmd215.qhnd):cum.stoc, sum(whwmd215.qall):cum.allo,
sum(whwmd215.qord):cum.ordr, sum(whwmd215.qblk):cum.blck
from whwmd215
where whwmd215._index2 = {:whwmd215.item}
selectdo
cum.econ = cum.stoc + cum.ordr – cum.allo
selectempty
cum.stoc = 0
cum.allo = 0
cum.ordr = 0
cum.blck = 0
cum.econ = 0
endselect
display.total.fields(
“whwmd215.qhnd”, cum.stoc,
“whwmd215.qall”, cum.allo,
“whwmd215.qord”, cum.ordr,
“whwmd215.qblk”, cum.blck,
“econ.stock”, cum.econ,
“tcibd001.cuni”, tcibd001.cuni)
}
发现越来越没追求了,静搞些初级的东西。