USE [FastMoneyPro_Remit] GO /****** Object: StoredProcedure [dbo].[proc_customerInfoWithPinNo] Script Date: 12/18/2023 11:21:42 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROC [dbo].[proc_customerInfoWithPinNo] @flag varchar(40) ,@user varchar(20) = NULL ,@customerId BIGINT = NULL AS --------------------------------------------------------------- -- Set '111111' as default txnpin for now --------------------------------------------------------------- BEGIN IF @flag = 'getDetailsWithPin' BEGIN DECLARE @pinNo int,@userName varchar(50),@firstName varchar(20),@password varchar(10),@createdFrom char(1),@txnPin int SELECT @firstName = FIRSTNAME ,@createdFrom = createdFrom ,@txnPin = txnPin ,@userName = username ,@password = customerPassword FROM CUSTOMERMASTER WHERE CUSTOMERID =@customerId IF @userName IS NULL BEGIN SELECT @userName = DBO.GetRandomUsername(@firstName) update customerMaster set userName = @userName where customerId = @customerId END --IF @password IS NULL --BEGIN -- SELECT @password = DBO.FNAGetRandomPassword(6) -- update customerMaster set customerPassword = @password where customerId = @customerId --END IF @txnPin IS NULL OR @txnPin='' BEGIN SET @pinNo = '111111'--DBO.FNAGetRandomTransactionPinNo(6) update customerMaster set txnPin = @pinNo where customerId = @customerId END SELECT FullName ,txnPin PinNo ,username UserName ,DBO.FNADECRYPTSTRING(customerPassword) Password --,[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,'') ,[Address1] = ISNULL(substring(detail.zip_code,1,3),'')+'-'+ ISNULL(substring(detail.zip_code,4,7),'') + ISNULL(',' +SS.stateName, '')+(',') ,[Address2] = ISNULL(detail.street_name,'') + ISNULL(',' + detail.city_name, '')+(',') --,[stateName] = ISNULL(',' + SS.stateName, '') + isnull(', ' +detail.street_name,'') --,[cityName] = ISNULL(',' + detail.city_name, '') + isnull(', ' +detail.street_name,'') --,[streetName] = ISNULL(', ' +detail.street_name,'') ,[additionalAddress] = ISNULL( cm.additionalAddress,'') FROM customermaster CM (NOLOCK) LEFT JOIN tbl_japan_address_detail detail WITH (NOLOCK) ON detail.zip_code = CM.zipcode LEFT JOIN dbo.countryStateMaster SS(NOLOCK) ON cast(SS.stateId as int)= detail.state_Id WHERE customerId = @customerId END END