Freigeben über


Die LotSerMst-Tabelle legt die Kosten während einer 1-Schritt-Übertragung von Bin in Bin auf 0 fest

Dieser Artikel bietet eine Lösung für das Problem, dass die Kosten in der LotSerMst-Tabelle in einem Bin in einstufiger Containerübertragung in Microsoft Dynamics SL auf 0 (null) gehen.

Gilt für: Microsoft Dynamics SL
Ursprüngliche KB-Nummer: 3034220

Problembeschreibung

Sie sehen, dass die Kosten in der LotSerMst-Tabelle auf 0 festgelegt werden, nachdem Sie eine einstufige Übertragung von bin in bin ausgeführt haben.

Lösung

Anwenden des Triggers auf die Datenbank:

create trigger xLotSerMstCost on LotSerMst for insert as
set nocount on
if (select COUNT(*) from inserted where Cost=0)>0
begin
update L set L.Cost=(select MAX(m.cost) from LotSerMst m with (nolock) inner join inserted i on m.Invtid = i.invtid and m.LotSerNbr=i.LotSerNbr)
 from LotSerMst L
 inner join inserted i on L.InvtID=i.InvtID and L.LotSerNbr=i.LotSerNbr and L.SiteID=i.SiteID and L.WhseLoc=i.WhseLoc
 inner join Inventory invt with (nolock) on i.InvtID=invt.InvtID
 where i.Cost=0 and i.LotSerNbr<>'' and i.OrigQty=1 and invt.LotSerTrack='SI'
end
go