erp雖然說是抓最新單價,取價順序也是核價優先,但是資料庫裡有部份單價用的是上一次的**,人為原因還是系統原因折騰了半天也不知道,操作人老是說不會去點單價,而系統我再次測試卻又是最新單價,避免再次出現,我對一**商寫了幾句sql語句,將歷史**全部失效為最新**日,這樣在前台再次測試就只有乙個單價了,就算想前台改也改不了,當然可以手動改動,那就是人為原因了
declare @ph varchar(20)
declare @maxrq varchar(8)
declare bj cursor for select distinct ma001 from mocma where ma003='0056'
open bj
fetch next from bj into @ph
while @@fetch_status =0
begin
select @maxrq=max(ma012) from mocma where ma003='0056' and ma001=@ph
update mocma set ma013=@maxrq where ma003='0056' and ma001=@ph and ma012<>@maxrq
fetch next from bj into @ph
endclose bj
deallocate bj
易飛8無銷售報價的BOM成本參考
alter procedure dbo sp bom expand itemno varchar 80 as begin bom展階 itemno 查詢品號 返回 元件品號v1001,主件品號v1002,階碼v1004,階層次v1005,尾階標誌v1006,展開標誌v1007,組成用量v1011,底...