-- 1.初始化:关联发货基本数量，累计发货基本数量，累计收货基本数量，累计入库基本数量，累计收货退货基本数量，累计入库退库基本数量
update
	t
set
	t.frelateoutstockbaseqty = t.fsumoutstockqty,
	t.fsumoutstockbaseqty = t.fsumoutstockqty,
	t.fsumreceiptbaseqty = t.fsumreceiptqty,
	t.fsuminstockbaseqty = t.fsuminstockqty,
	t.fsumrecretbaseqty = t.fsumrecretqty,
	t.fsuminstockretbaseqty = fsuminstockretqty
from
	T_PUR_ORDERENTRY_A t,T_PUR_ORDERENTRY a
where
	t.fentryid = a.fentryid
	and a.FUnitId = t.FBasicUnitID;