跳至主要內容

交货草稿财务审核状态查询

五六零网校小于 1 分钟

示例代码

DECLARE @TDate DATETIME
SET @TDate = dateadd(d, -7, getdate())
SELECT T1.DocEntry AS '草稿编号', t1.DocNum AS '交货单号', T1.TaxDate AS '单据日期', T1.CardCode AS '供应商编号'
	, T1.CardName AS '供应商名称', T2.ItemCode AS '物料编码', T3.ItemName AS '物料名称', T2.Quantity AS '交货数量', T5.Status
	, CASE T5.Status
		WHEN 'N' THEN '不批准'
		WHEN 'Y' THEN '批准'
		WHEN 'W' THEN '未批'
	END AS '财务审批状态'
FROM ODRF T1
	INNER JOIN DRF1 T2 ON t1.DocEntry = t2.DocEntry
	LEFT JOIN OITM T3 ON T2.ItemCode = T3.ItemCode
	LEFT JOIN OWDD T4 ON T4.DocEntry = T1.DocEntry
	LEFT JOIN WDD1 T5
	ON T5.WddCode = T4.WddCode
		AND T5.UserID = 6
WHERE T4.ObjType = 112
	AND T5.Status IS NOT NULL
	AND T1.TaxDate > @TDate
ORDER BY T1.DocEntry
FOR BROWSE