K3 單據,單據體自定義字段顯示及時庫存

 --1、解決了顯示可發數量的單據,且已經審覈的單據,庫存數據更新後,單據上的可發數量隨庫存變化,現在能實現當時的可發數量和件數保存到單據中

--2、解決了負庫存數據顯示爲0的問題
--2011.09.28 by 申憲峯

--更改顯示現庫存和可發件數的單據模板的取數方式
--領料單
update ictemplateentry set frelationid='fitemid',faction='.,f_104' where fid='B04' and ffieldname='FEntrySelfB0426'
update ictemplateentry set frelationid='fitemid',faction='.,f_105' where fid='B04' and ffieldname='FEntrySelfB0427'

--產成品入庫
update ictemplateentry set frelationid='fitemid',faction='.,f_104' where fid='A02' and ffieldname='FEntrySelfA0225'
update ictemplateentry set frelationid='fitemid',faction='.,f_105' where fid='A02' and ffieldname='FEntrySelfA0226'

--其他入庫
update ictemplateentry set frelationid='fitemid',faction='.,f_104' where fid='A97' and ffieldname='FEntrySelfA9726'
update ictemplateentry set frelationid='fitemid',faction='.,f_105' where fid='A97' and ffieldname='FEntrySelfA9727'

--其他出庫
update ictemplateentry set frelationid='fitemid',faction='.,f_104' where fid='B09' and ffieldname='FEntrySelfB0924'
update ictemplateentry set frelationid='fitemid',faction='.,f_105' where fid='B09' and ffieldname='FEntrySelfB0925'

--銷售訂單
update ictemplateentry set frelationid='fitemid',faction='.,f_104' where fid='S01' and ffieldname='FEntrySelfS0133'
update ictemplateentry set frelationid='fitemid',faction='.,f_105' where fid='S01' and ffieldname='FEntrySelfS0134'

--發貨通知單
update ictemplateentry set frelationid='fitemid',faction='.,f_104' where fid='S02' and ffieldname='FEntrySelfS0218'
update ictemplateentry set frelationid='fitemid',faction='.,f_105' where fid='S02' and ffieldname='FEntrySelfS0221'

--採購申請單
update ictemplateentry set frelationid='fitemid',faction='.,f_104' where fid='P01' and ffieldname='FEntrySelfP0118'
update ictemplateentry set frelationid='fitemid',faction='.,f_105' where fid='P01' and ffieldname='FEntrySelfP0119'

--採購訂單
update ictemplateentry set frelationid='fitemid',faction='.,f_104' where fid='P02' and ffieldname='FEntrySelfP0223'
update ictemplateentry set frelationid='fitemid',faction='.,f_105' where fid='P02' and ffieldname='FEntrySelfP0226'

 -採購申請單,上限,下限,到貨週期
select * from ictemplateentry where fid='p01'

update ictemplateentry set frelationid='fitemid',faction='.,FLOWLIMIT' where fid='P01' and ffieldname='FEntrySelfP0116'
update ictemplateentry set frelationid='fitemid',faction='.,FHIGHLIMIT' where fid='P01' and ffieldname='FEntrySelfP0117'
update ictemplateentry set frelationid='fitemid',faction='.,FFIXLEADTIME' where fid='P01' and ffieldname='FEntrySelfP0120'

--採購訂單,上限,下限,計劃單價
select * from ictemplateentry where fid='p02'

update ictemplateentry set frelationid='fitemid',faction='.,FLOWLIMIT' where fid='P02' and ffieldname='FEntrySelfP0224'
update ictemplateentry set frelationid='fitemid',faction='.,FHIGHLIMIT' where fid='P02' and ffieldname='FEntrySelfP0225'
update ictemplateentry set frelationid='fitemid',faction='.,FPLANPRICE' where fid='P02' and ffieldname='FEntrySelfP0227'

--購貨發票,計劃單價
select * from ictemplateentry where fid='I02'
update ictemplateentry set frelationid='fitemid',faction='.,FPLANPRICE' where fid='I02' and ffieldname='FEntrySelfI0231'

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章