跳至主要內容

生产入库查询表

五六零网校小于 1 分钟

代码示例

SELECT m1.SeriesName AS '序列', T1.[DocNum] AS '单据编号', T1.GroupNum AS '价格清单', T1.Ref2 AS '生产订单号'
	, T1.[DocDate] AS '过账日期', T1.[TaxDate] AS '单据日期', T1.DocNum AS '入库单号', T0.[ItemCode] AS '物料编号'
	, T0.[Dscription] AS '物料/服务描述', OITB.ItmsGrpNam AS '物料组', T0.[Quantity] AS '数量'
	, T0.Price AS '信息价格', T0.unitMsr AS '计量单位', T0.LineTotal AS '总计', T0.[WhsCode] AS '仓库代码', T0.AcctCode AS '科目代码'
	, T0.OcrCode AS '部门', T0.OcrCode2 AS '人员', 
	T1.Comments AS '备注'
FROM [dbo].[IGN1] T0
	INNER JOIN [dbo].[OIGN] T1 ON T1.[DocEntry] = T0.[DocEntry]
	LEFT JOIN NNM1 M1 ON M1.Series = T1.Series
	LEFT JOIN OITM ON T0.ItemCode = OITM.ItemCode
	LEFT JOIN OITB ON OITB.ItmsGrpCod = OITM.ItmsGrpCod
WHERE (T1.DocDate >= [%1%]
		OR T1.DocDate = GETDATE())
	AND (T1.DocDate <= [%2%]
		OR T1.DocDate = GETDATE())
	AND M1.SeriesName = 'PPSOne'