由于业务需要,财务要求按他们的数据批次修改某月的其它入库单价。
1、建立表
T_HH_TempPrdt:
[FItemID]
,[FNumber]
,[FPrice]
2、通过SSMS导入财务给的EXCEL数据。
3、更新物料内码
update T_HH_TempPrdt
set T_HH_TempPrdt.fitemID=t_ICItem.fitemid
from T_HH_TempPrdt
left join t_ICItem
on T_HH_TempPrdt.fnumber=t_ICItem.FNumber
4、更新单据价格:
update ICStockBillEntry
set ICStockBillEntry.FPrice=T_HH_TempPrdt.FPrice,ICStockBillEntry.FAuxPrice=T_HH_TempPrdt.FPrice,ICStockBillEntry.FAmount=ICStockBillEntry.FQty*T_HH_TempPrdt.FPrice
from ICStockBillEntry
inner join T_HH_TempPrdt on ICStockBillEntry.FItemID = T_HH_TempPrdt.fitemID
left join ICStockBill on ICStockBillEntry.FInterID=ICStockBill.FInterID
where ICStockBill.FDate >='2018-01-01 00:00:00.000' and ICStockBill.FDate <'2018-02-01 00:00:00.000' and ICStockBill.FTranType=10