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.

64 lines
5.1 KiB

9 months ago
  1. USE [FastMoneyPro_Remit]
  2. GO
  3. /****** Object: StoredProcedure [dbo].[proc_customerInfoWithPinNo] Script Date: 12/18/2023 11:21:42 PM ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. ALTER PROC [dbo].[proc_customerInfoWithPinNo]
  9. @flag varchar(40)
  10. ,@user varchar(20) = NULL
  11. ,@customerId BIGINT = NULL
  12. AS
  13. ---------------------------------------------------------------
  14. -- Set '111111' as default txnpin for now
  15. ---------------------------------------------------------------
  16. BEGIN
  17. IF @flag = 'getDetailsWithPin'
  18. BEGIN
  19. DECLARE @pinNo int,@userName varchar(50),@firstName varchar(20),@password varchar(10),@createdFrom char(1),@txnPin int
  20. SELECT @firstName = FIRSTNAME
  21. ,@createdFrom = createdFrom
  22. ,@txnPin = txnPin
  23. ,@userName = username
  24. ,@password = customerPassword
  25. FROM CUSTOMERMASTER WHERE CUSTOMERID =@customerId
  26. IF @userName IS NULL
  27. BEGIN
  28. SELECT @userName = DBO.GetRandomUsername(@firstName)
  29. update customerMaster set userName = @userName where customerId = @customerId
  30. END
  31. --IF @password IS NULL
  32. --BEGIN
  33. -- SELECT @password = DBO.FNAGetRandomPassword(6)
  34. -- update customerMaster set customerPassword = @password where customerId = @customerId
  35. --END
  36. IF @txnPin IS NULL OR @txnPin=''
  37. BEGIN
  38. SET @pinNo = '111111'--DBO.FNAGetRandomTransactionPinNo(6)
  39. update customerMaster set txnPin = @pinNo where customerId = @customerId
  40. END
  41. SELECT FullName
  42. ,txnPin PinNo
  43. ,username UserName
  44. ,DBO.FNADECRYPTSTRING(customerPassword) Password
  45. --,[Address] = ISNULL(substring(detail.zip_code,1,3),'')+'-'+ ISNULL(substring(detail.zip_code,4,7),'') + isnull(',' + SS.stateName, '') + isnull(',' + detail.city_name, '') + isnull(', ' +detail.street_name,'') + ISNULL( ', '+ cm.additionalAddress,'')
  46. ,[Address1] = ISNULL(substring(detail.zip_code,1,3),'')+'-'+ ISNULL(substring(detail.zip_code,4,7),'') + ISNULL(',' +SS.stateName, '')+(',')
  47. ,[Address2] = ISNULL(detail.street_name,'') + ISNULL(',' + detail.city_name, '')+(',')
  48. --,[stateName] = ISNULL(',' + SS.stateName, '') + isnull(', ' +detail.street_name,'')
  49. --,[cityName] = ISNULL(',' + detail.city_name, '') + isnull(', ' +detail.street_name,'')
  50. --,[streetName] = ISNULL(', ' +detail.street_name,'')
  51. ,[additionalAddress] = ISNULL( cm.additionalAddress,'')
  52. FROM customermaster CM (NOLOCK)
  53. LEFT JOIN tbl_japan_address_detail detail WITH (NOLOCK) ON detail.zip_code = CM.zipcode
  54. LEFT JOIN dbo.countryStateMaster SS(NOLOCK) ON cast(SS.stateId as int)= detail.state_Id
  55. WHERE customerId = @customerId
  56. END
  57. END