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.

183 lines
7.4 KiB

9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
  1. USE [FastMoneyPro_Remit]
  2. GO
  3. /****** Object: StoredProcedure [dbo].[GetUserInfo] Script Date: 2/6/2024 5:17:13 PM ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. ALTER PROC [dbo].[GetUserInfo] (
  9. @FLAG VARCHAR(20)
  10. ,@customerId VARCHAR(200) = NULL
  11. ,@username VARCHAR(100) = NULL
  12. ,@idNumber VARCHAR(100) = NULL
  13. ,@dob VARCHAR(100) = NULL
  14. ,@mobile VARCHAR(100) = NULL
  15. ,@emailId VARCHAR(500) = NULL
  16. ,@tranId VARCHAR(500) = NULL
  17. )
  18. AS
  19. BEGIN
  20. IF @FLAG = 'basic-reg'
  21. BEGIN
  22. DECLARE @MEMBESHIP_ID VARCHAR(50) = NULL;
  23. IF EXISTS (
  24. SELECT *
  25. FROM dbo.customerMastertemp(NOLOCK)
  26. WHERE username = @emailId
  27. AND membershipId IS NULL
  28. )
  29. BEGIN
  30. EXEC PROC_GENERATE_MEMBERSHIP_ID @CUSTOMERID = 0
  31. ,@USER = 'mobile'
  32. ,@loginBranchId = 0
  33. ,@MEMBESHIP_ID = @MEMBESHIP_ID OUT
  34. UPDATE dbo.customerMasterTemp
  35. SET MEMBERSHIPID = @MEMBESHIP_ID
  36. WHERE username = @emailId
  37. SELECT CONCAT (
  38. ISNULL(firstName, '')
  39. ,' '
  40. ,ISNULL(middleName, '')
  41. ,' '
  42. ,ISNULL(lastName1, '')
  43. ) AS fullName
  44. ,customerId
  45. ,membershipId
  46. ,firstName
  47. ,ISNULL(middleName, '') AS middleName
  48. ,lastName1
  49. ,mobile
  50. ,CONCAT (
  51. ISNULL(zipCode, postalCode)
  52. ,' '
  53. ,ISNULL(city, '')
  54. ,' '
  55. ,ISNULL(address, '')
  56. ) AS address
  57. ,email
  58. ,createdDate
  59. FROM customerMastertemp
  60. WHERE email = @emailId --and mobile = @mobile
  61. END
  62. ELSE
  63. BEGIN
  64. SELECT CONCAT (
  65. ISNULL(firstName, '')
  66. ,' '
  67. ,ISNULL(middleName, '')
  68. ,' '
  69. ,ISNULL(lastName1, '')
  70. ) AS fullName
  71. ,customerId
  72. ,membershipId
  73. ,firstName
  74. ,ISNULL(middleName, '') AS middleName
  75. ,lastName1
  76. ,mobile
  77. ,CONCAT (
  78. ISNULL(zipCode, postalCode)
  79. ,' '
  80. ,ISNULL(city, '')
  81. ,' '
  82. ,ISNULL(address, '')
  83. ) AS address
  84. ,email
  85. ,createdDate
  86. FROM customerMaster
  87. WHERE email = @emailId --and mobile = @mobile
  88. END
  89. RETURN;
  90. END
  91. IF @FLAG = 'kyc'
  92. BEGIN
  93. SELECT CONCAT (
  94. ISNULL(firstName, '')
  95. ,' '
  96. ,ISNULL(middleName, '')
  97. ,' '
  98. ,ISNULL(lastName1, '')
  99. ) AS fullName
  100. ,customerId
  101. ,membershipId
  102. ,firstName
  103. ,ISNULL(middleName, '') AS middleName
  104. ,lastName1
  105. ,mobile
  106. ,CONCAT (
  107. ISNULL(zipCode, '')
  108. ,' '
  109. ,ISNULL(city, '')
  110. ,' '
  111. ,ISNULL(ADDITIONALADDRESS, '')
  112. ) AS address
  113. ,email
  114. ,createdDate
  115. FROM customerMaster
  116. WHERE customerId = @customerId
  117. RETURN
  118. END
  119. IF @FLAG = 'get-txn-details'
  120. BEGIN
  121. SELECT TST.email
  122. ,senderName
  123. ,pcountry
  124. ,scountry
  125. ,receiverName
  126. ,paymentMethod
  127. ,pBankName
  128. ,ISNULL(pBankBranchName, 'HO') pBankBranch
  129. ,accountNo
  130. ,pAmt
  131. ,tAmt
  132. ,serviceCharge
  133. ,rewardPoints
  134. ,camt
  135. ,createdDate
  136. ,customerRate
  137. FROM remitTranTemp RTT
  138. INNER JOIN tranSendersTemp TST ON RTT.id = TST.tranId
  139. WHERE RTT.id = @tranId
  140. --UNION ALL
  141. --SELECT senderName, pcountry, scountry, receiverName, paymentMethod, pBankName, pBankBranch, pBankBranchName, accountNo, pAmt, tAmt,
  142. --serviceCharge, rewardPoints, tAmt, createdDate FROM remitTran rt
  143. --INNER JOIN tranSenders ts ON rt.holdTranId = ts.tranId
  144. --where rt.holdTranId = @tranId
  145. RETURN
  146. END
  147. IF @FLAG = 'txn-details'
  148. BEGIN
  149. SELECT ISNULL(Ts.email, rt.createdby) email
  150. ,senderName
  151. ,dbo.decryptDb(controlNo) controlNo
  152. ,createdDate
  153. ,pcountry
  154. ,pBankName
  155. ,pBankBranch
  156. ,pBankBranchName
  157. ,accountNo
  158. ,receiverName
  159. ,pAmt
  160. ,tAmt
  161. ,serviceCharge
  162. ,camt
  163. ,paymentMethod
  164. ,ts.email
  165. FROM remitTran rt
  166. INNER JOIN tranSenders ts ON rt.id = ts.tranId
  167. WHERE rt.id = @tranId
  168. RETURN
  169. END
  170. END