CREATE PROCEDURE [usp_select_Act_Actual_Customer]
(@BranchID [int]
@CompanyID [tinyint])
--WITH ENCRYPTION
AS
BEGIN
SET NOCOUNT ON
DECLARE @Nulldate [smalldatetime]
SET @Nulldate 0
DECLARE @Serverdate [smalldatetime]
SET @Serverdate GETDATE()
SELECT s.[BranchID] s.[CompanyID] s.[FinancialyearID]
s.[Saledate] s.[Invoiceno] s.[Goodscategoryname]
s.[Bankname] s.[Customercode] s.[Saletype]
s.[Customername] s.[Duedays]
s.[Duedate] s.[Countryname] s.[Totalquantity]
s.[Netvalue] s.[NetvalueInLocal]
s.[Netreceiptamount] s.[Exchangeratetolocal]
FROM [dbo].[fn_Actual_Tsale](0 @BranchID @CompanyID) s
WHERE s.[Receivablefromagent] <> 1
ORDER BY s.[Customername] s.[Saledate]
RETURN(@@ERROR)
END
Ans: This is Procedure And here we Taking record from (fn_Actual_Tsale) function