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.

33 lines
1.9 KiB

1 year ago
  1. USE [FastMoneyPro_Remit]
  2. GO
  3. /****** Object: StoredProcedure [dbo].[PROC_AcDepositUnpaidSummary] 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_AcDepositUnpaidSummary]
  9. AS
  10. BEGIN
  11. SET NOCOUNT ON;
  12. SELECT
  13. receiveAgentId = m.receiveAgentID
  14. --,rBankID = bb.mapCodeInt
  15. ,rBankName = CASE WHEN m.receiveAgentId = -1 THEN 'IME Nepal' ELSE ISNULL(bank.agentName, 'Others') END
  16. ,Txn = count(*)
  17. ,AMT = sum(totalroundamt)
  18. FROM ime_plus_01.[dbo].AccountTransaction m WITH(NOLOCK)
  19. LEFT JOIN agentMaster bank WITH(NOLOCK) ON m.receiveAgentID=bank.mapCodeInt
  20. WHERE 1=1
  21. --AND m.receiveAgentid='11600000'
  22. AND [STATUS] = 'Un-Paid' AND paymenttype = 'Bank Transfer' AND TransStatus='Payment'
  23. AND receiveAgentid IS NOT NULL
  24. --AND bank.mapCodeInt IS NOT NULL
  25. GROUP BY bank.agentName, m.receiveAgentID
  26. ORDER BY rbankName
  27. END
  28. GO