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'

原文地址:https://www.cnblogs.com/youzhangcai1/p/10685326.html