|
|
发表于 2012/8/8 09:10:10
|
显示全部楼层
修改工厂日历后,会导致后台工厂日历表数据变动。
POMT的承诺交货日是根据下达日期,工厂日历和检验日期计算得出的。
通过以下的sql函数可以得到屏幕上显示的交货日期。
[FSDBMR].[dbo].udf_FindDate(l.RequiredDate,-1*InspectionLeadTimeDays)
sql脚本如下:
select h.PONumber
,h.VendorID
,h.Buyer
,l.POLineNumber
,l.POLineType
,case
when i.ItemNumber is null
then l.NonInventoryItemNumber
else i.ItemNumber
end ItemNumber
,case
when i.ItemDescription is null
then l.NonInventoryItemDescription
else i.ItemDescription
end ItemDescription
,case
when i.ItemUM is null
then l.NonInventoryItemUM
else i.ItemUM
end ItemUM
,l.POLineStatus
,l.LineItemOrderedQuantity,
case when l.POLineType ='P' or l.POLineType ='S' then [FSDBMR].[dbo].udf_FindDate(l.RequiredDate,-1*InspectionLeadTimeDays)
else [FSDBMR].[dbo].udf_FindDate(l.RequiredDate,0) end Reqire
from FS_POLine l
join FS_POHeader h on h.POHeaderKey = l.POHeaderKey
left join FS_Item i on i.ItemKey = l.ItemKey
where h.PONumber ='XXXXXX'
order by l.POLineNumber |
|