USE [AIS2025]
GO

/****** Object:  View [dbo].[ZZV_SalOrder]    Script Date: 2025/9/8 16:00:48 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO



ALTER VIEW [dbo].[ZZV_SalOrder]
AS 

SELECT *
,CONVERT(DECIMAL(23,2),ISNULL((SELECT SUM(f.FAllAmount) FROM T_SAL_ORDERENTRY_F f WITH(NOLOCK) WHERE f.fid=a.fid AND f.FAllAmount>0),0.00)) ZhengShuHeJi
FROM dbo.T_SAL_ORDER a WITH(NOLOCK)
WHERE a.FDOCUMENTSTATUS='C'

--select * from ZZV_SalOrder
--where F_CONTACTNUMBER='P202506060020-HH02'
GO


