You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
2.7 KiB

1 year ago
  1. USE [FastMoneyPro_Remit]
  2. GO
  3. /****** Object: StoredProcedure [dbo].[proc_HoUserTxn] Script Date: 9/27/2019 1:30:14 PM ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. CREATE proc [dbo].[proc_HoUserTxn](
  9. @user varchar(30)=NULL
  10. ,@flag varchar(10)=NULL
  11. ,@fromDate varchar(40)=NULL
  12. ,@toDate varchar(40)=NULL
  13. )AS
  14. BEGIN
  15. IF @flag='rpt'
  16. BEGIN
  17. SELECT
  18. [Tran Id]=rt.id
  19. ,[Control No]=rt.controlNo
  20. ,[Sender]=rt.senderName
  21. ,[Receiver]=rt.receiverName
  22. ,[User Full Name]=x.userFullName
  23. ,[Sending Branch]=rt.sBranchName
  24. ,[Amount]=dbo.showDecimal(rt.pAmt)
  25. ,[Payout Branch]=rt.pBranchName
  26. ,[Approved Date]=rt.approvedDate
  27. ,[Tran Status]=tranStatus
  28. FROM
  29. (
  30. SELECT
  31. userFullName = ISNULL( ' ' + au.firstName, '') + ISNULL( ' ' + au.middleName, '') + ISNULL( ' ' + au.lastName, '')
  32. FROM dbo.applicationUsers au WITH(NOLOCK) WHERE agentId = 1001
  33. )x INNER JOIN remitTran rt WITH(NOLOCK) ON rt.senderName = x.userFullName OR rt.receiverName = x.userFullName
  34. WHERE rt.approvedDate BETWEEN @fromDate AND @toDate+' 23:59:59'
  35. EXEC proc_errorHandler '0', 'Report has been prepared successfully.', NULL
  36. SELECT 'From Date' head,@fromDate VALUE
  37. UNION ALL
  38. SELECT 'TO Date' head,@toDate VALUE
  39. SELECT 'Ho User Vs Transaction' title
  40. END
  41. END
  42. GO