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.

44 lines
1.2 KiB

1 year ago
  1. USE [FastMoneyPro_Remit]
  2. GO
  3. /****** Object: StoredProcedure [dbo].[proc_TransactionCount] Script Date: 7/4/2019 11:35:48 AM ******/
  4. DROP PROCEDURE [dbo].[proc_TransactionCount]
  5. GO
  6. /****** Object: StoredProcedure [dbo].[proc_TransactionCount] Script Date: 7/4/2019 11:35:48 AM ******/
  7. SET ANSI_NULLS ON
  8. GO
  9. SET QUOTED_IDENTIFIER ON
  10. GO
  11. CREATE proc [dbo].[proc_TransactionCount]
  12. as
  13. declare @date date = GetDate() ;
  14. declare @intPaid int , @iSend int , @iCancel int
  15. SELECT @intPaid = COUNT(tranStatus)
  16. FROM dbo.remitTran WITH(NOLOCK)
  17. WHERE paidDate BETWEEN @date AND GETDATE()
  18. SELECT @iSend = COUNT('A')
  19. FROM dbo.remitTran WITH(NOLOCK)
  20. WHERE createdDate BETWEEN @date AND GETDATE()
  21. SELECT @iCancel = COUNT('A')
  22. FROM dbo.remitTran WITH(NOLOCK)
  23. WHERE cancelApprovedDate BETWEEN @date AND GETDATE()
  24. SELECT @iCancel iCancel,@iSend iSend, @intPaid intPaidCount
  25. SELECT [TxnNo] = count(1) ,tranStatus
  26. FROM remitTran(nolock)
  27. where tranStatus NOT IN ('payment','cancel','Paid')
  28. group by tranStatus
  29. UNION ALL
  30. SELECT [TxnNo] = count(1),'Pending GIBL Reprocessing' tranStatus
  31. FROM remitTran trn WITH(NOLOCK)
  32. WHERE trn.approvedBy IS NOT NULL AND trn.payStatus = 'Unpaid'
  33. AND tranStatus = 'payment' AND pCountry = 'Nepal'
  34. AND trn.pAgent = 1056
  35. GO