From 2abdd95e3c28e4f2c3bc041d16c27d9d1c0c2c4c Mon Sep 17 00:00:00 2001 From: gagan Date: Wed, 19 Aug 2020 09:06:14 +0000 Subject: [PATCH] --- Database/Sp/PROC_AGENT_RECEIVER_SETUP.sql | 24 ++----- Database/Sp/proc_customerInfo.sql | 70 +++++++++---------- .../Receiver/ReceiverRegistrationNew.js | 13 +++- JMEAgentSystem/WebPages/Account/Login.aspx | 2 +- .../BenificiaryRegistration/Manage.aspx | 2 +- 5 files changed, 52 insertions(+), 59 deletions(-) diff --git a/Database/Sp/PROC_AGENT_RECEIVER_SETUP.sql b/Database/Sp/PROC_AGENT_RECEIVER_SETUP.sql index 84cde13..8b9d769 100644 --- a/Database/Sp/PROC_AGENT_RECEIVER_SETUP.sql +++ b/Database/Sp/PROC_AGENT_RECEIVER_SETUP.sql @@ -70,30 +70,16 @@ BEGIN IF @flag = 'i-new' BEGIN DECLARE @customerIdNew BIGINT - IF LEN(@customerId) > 7 + IF NOT EXISTS(SELECT 'X' FROM CUSTOMERMASTER WITH(NOLOCK) WHERE idnumber = @customerId) BEGIN - IF NOT EXISTS(SELECT 'X' FROM CUSTOMERMASTER WITH(NOLOCK) WHERE cast(MEMBERSHIPID as varchar) = @customerId) - BEGIN - SELECT '1' errorCode,''''+cast(@customerId as varchar) + ''' customerId does not exists.' msg,null id - RETURN - END - ELSE - BEGIN - SELECT @customerIdNew = customerId from customerMaster where MEMBERSHIPID = @customerId - END + SELECT '1' errorCode,''''+cast(@customerId as varchar) + ''' customerId does not exists.' msg,null id + RETURN END ELSE BEGIN - IF NOT EXISTS(SELECT 'X' FROM CUSTOMERMASTER WITH(NOLOCK) WHERE cast(POSTALCODE as varchar) = @customerId) - BEGIN - SELECT '1' errorCode,''''+cast(@customerId as varchar) + ''' customerId does not exists.' msg,null id - RETURN - END - ELSE - BEGIN - SELECT @customerIdNew = customerId from customerMaster where postalCode = @customerId - END + SELECT @customerIdNew = customerId from customerMaster where idnumber = @customerId END + SELECT @membershipId = membershipId from CUSTOMERMASTER WITH(NOLOCK) WHERE customerId = @customerIdNew INSERT INTO receiverInformation (fullname diff --git a/Database/Sp/proc_customerInfo.sql b/Database/Sp/proc_customerInfo.sql index cd00067..de54d2f 100644 --- a/Database/Sp/proc_customerInfo.sql +++ b/Database/Sp/proc_customerInfo.sql @@ -12,62 +12,58 @@ BEGIN IF @flag = 'getCustomerAndReceiverInfo' BEGIN DECLARE @customerIdNew BIGINT - select @customerIdNew = CUSTOMERID FROM CUSTOMERMASTER WHERE MEMBERSHIPID =@customerId - - IF len(@customerId) > 7 - BEGIN - select @customerIdNew = CUSTOMERID FROM CUSTOMERMASTER WHERE MEMBERSHIPID =@customerId - END - ELSE - BEGIN - SELECT @customerIdNew = CUSTOMERID FROM customerMaster WHERE postalCode = @CUSTOMERID - END + select @customerIdNew = CUSTOMERID FROM CUSTOMERMASTER WHERE idnumber =@customerId IF cast(@customerIdNew as varchar) IS NULL BEGIN - SELECT '1' Error_Code,'Customer Doesnot Exists' Msg,@CUSTOMERID id + SELECT '1' Error_Code,'Customer Does not exists' Msg,@CUSTOMERID id RETURN END SELECT fullname,membershipId FROM customerMaster WHERE CUSTOMERID = @customerIdNew - --get bank and branch details - DECLARE @BRANCHDETAILS VARCHAR(100), @BANKDETAILS VARCHAR(250),@paymentMethod VARCHAR(20) - SELECT @BRANCHDETAILS = CASE WHEN R.PCOUNTRY IN ('Nepal', 'Vietnam') THEN pBankBranchName - ELSE CAST(A.BRANCH_ID AS VARCHAR) + '|' + A.BRANCH_NAME + ' - ' + A.BRANCH_CODE1 END - ,@BANKDETAILS = R.PBANKNAME - ,@paymentMethod = R.paymentMethod + SELECT * INTO #receiverId + from + ( + SELECT receiverId from receiverinformation + WHERE customerid = @customerIdNew + )x + + + SELECT * INTO #transactionDetails + from + ( + SELECT ROW_NUMBER() OVER( PARTITION BY REC.CUSTOMERID ORDER BY REC.id desc) rowId + ,CASE WHEN R.PCOUNTRY IN ('Nepal', 'Vietnam') THEN pBankBranchName + ELSE CAST(A.BRANCH_ID AS VARCHAR) + '|' + A.BRANCH_NAME + ' - ' + A.BRANCH_CODE1 END pBranchName + ,R.pBankName + ,R.paymentMethod + ,R.accountno + ,REC.customerid receiverId FROM REMITTRAN R(NOLOCK) INNER JOIN TRANRECEIVERS REC(NOLOCK) ON REC.TRANID = R.ID LEFT JOIN API_BANK_BRANCH_LIST A(NOLOCK) ON A.BRANCH_ID = R.PBANKBRANCH LEFT JOIN PAYER_BANK_DETAILS AP(NOLOCK) ON AP.PAYER_ID = R.PayerId WHERE 1=1 --AND R.PCOUNTRY = 'INDIA' - AND REC.CUSTOMERID = @RECEIVERID - ORDER BY R.ID ASC - SELECT TOP 10 * FROM VWREMITTRAN ORDER BY ID DESC - + AND REC.CUSTOMERID in (select receiverId from #receiverId) + )x + where rowId = 1 - SELECT ROW_NUMBER() OVER (ORDER BY RECEIVERID) SN, + select ROW_NUMBER() OVER(ORDER BY RI.RECEIVERID) SN, isnull(firstname,'') + isnull(' '+middleName,'') + isnull(' ' + lastname1,'') [fullname], isnull(address,'-') address, isnull(mobile,'-') mobile, - isnull(@paymentMethod,case when ri.paymentMode = '1' then 'Cash Payment' + ISNULL(TD.paymentMethod,case when ri.paymentMode = '1' then 'Cash Payment' when ri.paymentMode = '2' then 'Bank Deposit' else 'Mobile Wallet' END) PaymentMethod, - ISNULL(@BANKDETAILS,RI) bankName, - ISNULL(@BRANCHDETAILS,CASE WHEN RI.PCOUNTRY IN ('Nepal', 'Vietnam') THEN bankBranchName + ISNULL(TD.pBankName,ISNULL(ABL.BANK_NAME,'-')) bankName, + ISNULL(TD.pBranchName,CASE WHEN RI.COUNTRY IN ('Nepal', 'Vietnam') THEN bankBranchName ELSE CAST(A.BRANCH_ID AS VARCHAR) + '|' + A.BRANCH_NAME + ' - ' + A.BRANCH_CODE1 END) branchName, - - - - FROM receiverInformation RI(NOLOCK) - LEFT JOIN API_BANK_BRANCH_LIST A(NOLOCK) ON A.BRANCH_ID = RI.BANKLOCATION - - select * from - - SELECT TOP 10 collmode,paymentMethod,PCOUNTRY,pBankBranchName,bankBranchName,* FROM VWREMITTRAN ORDER BY ID DESC - SELECT TOP 100 bankBranchName,* FROM RECEIVERINFORMATION ORDER BY RECEIVERID DESC - SELECT TOP 10 * FROM VWTRANRECEIVERS ORDER BY ID DESC - WHERE customerId = @customerIdNew + ISNULL(TD.accountNo,ISNULL(RI.receiverAccountNo,'-')) accountNo + from receiverinformation ri(nolock) + LEFT JOIN #transactionDetails TD ON TD.RECEIVERID = RI.RECEIVERID + LEFT JOIN API_BANK_LIST ABL (NOLOCK) ON ABL.BANK_ID = RI.payOutPartner + LEFT JOIN API_BANK_BRANCH_LIST A(NOLOCK) ON A.BRANCH_ID = RI.BANKLOCATION + WHERE RI.CUSTOMERID = @customerIdNew END IF @flag = 'details-fromMembershipId' BEGIN diff --git a/JMEAgentSystem/Scripts/Receiver/ReceiverRegistrationNew.js b/JMEAgentSystem/Scripts/Receiver/ReceiverRegistrationNew.js index f54a992..824c7d6 100644 --- a/JMEAgentSystem/Scripts/Receiver/ReceiverRegistrationNew.js +++ b/JMEAgentSystem/Scripts/Receiver/ReceiverRegistrationNew.js @@ -277,7 +277,7 @@ function CheckFormValidation(e) { debugger $("#" + mId + "ddlIdType").removeAttr("style"); $("#" + mId + "txtIdValue").removeAttr("style"); - paymentMode = $("#" + mId + "ddlPaymentMode").val(); + var reqField = "customerId,ddlCountry,ddlBenificiaryType,txtReceiverFName,txtReceiverLName,txtReceiverAddress,ddlPaymentMode,ddlNativeCountry,"; idTypeVal = $("#" + mId + "ddlIdType").val(); if (idTypeVal !== null && idTypeVal !== "" && idTypeVal !== "0") { @@ -292,6 +292,17 @@ function CheckFormValidation(e) { if (ValidRequiredField(reqField) === false) { return false; } + debugger + var pMode = $("#" + mId + "ddlPaymentMode").val(); + var pAgent = $("#" + mId + "ddlPayoutPatner").val(); + if (pMode == "2") { + if (pAgent == '' || pAgent == undefined || pAgent == null || pAgent == "null") { + $("#" + mId + "ddlPayoutPatner").css('background-color', '#FFCCD2'); + swal('Required Field(s)\n _____________________________ \n The red fields are required!'); + return false + } + } + $("#" + mId + "register").attr("disabled", "disabled"); return true; } diff --git a/JMEAgentSystem/WebPages/Account/Login.aspx b/JMEAgentSystem/WebPages/Account/Login.aspx index b07804b..a2603d1 100644 --- a/JMEAgentSystem/WebPages/Account/Login.aspx +++ b/JMEAgentSystem/WebPages/Account/Login.aspx @@ -9,7 +9,7 @@
- +
diff --git a/JMEAgentSystem/WebPages/BenificiaryRegistration/Manage.aspx b/JMEAgentSystem/WebPages/BenificiaryRegistration/Manage.aspx index c7ecb64..5f6f719 100644 --- a/JMEAgentSystem/WebPages/BenificiaryRegistration/Manage.aspx +++ b/JMEAgentSystem/WebPages/BenificiaryRegistration/Manage.aspx @@ -22,7 +22,7 @@
-
+