1. 程式人生 > >金蝶K3WISE 銷售訂單序時簿即時庫存的開發

金蝶K3WISE 銷售訂單序時簿即時庫存的開發

K3WISE15.0的即時庫存是不在序時簿裡面顯示的
1.先給老單序時簿新增欄位
這裡假設為 FEntrySelfS0169
2.通過批更的方式同步庫存到這個列中
update SEOrderEntry set FEntrySelfS0169=(select sum(FQty) from ICInventory where ICInventory.FItemID=SEOrderEntry.FItemID group by ICInventory.FItemID)
update SEOrderEntry set FEntrySelfS0169=’0’
where FEntrySelfS0169 is null
3.設定即時庫存表的觸發器

CREATE PROCEDURE jskc
as
update SEOrderEntry set FEntrySelfS0169=(select sum(FQty) from ICInventory where ICInventory.FItemID=SEOrderEntry.FItemID group by ICInventory.FItemID )
update SEOrderEntry set FEntrySelfS0169=’0’
where FEntrySelfS0169 is null
go

create trigger T_addKC
on ICInventory
for insert
as
exec jskc
go

create trigger T_delKC
on ICInventory
for delete
as
exec jskc
go

create trigger T_updateKC
on ICInventory
for update
as
exec jskc
go