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.

55 lines
3.8 KiB

1 year ago
  1. USE [FastMoneyPro_Remit]
  2. GO
  3. /****** Object: StoredProcedure [dbo].[proc_mgReceipt] Script Date: 9/27/2019 1:30:14 PM ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. --EXEC proc_mgReceipt @flag = 'receipt' , @user = 'admin' , @controlNo = 'MG71372868'
  9. CREATE procEDURE [dbo].[proc_mgReceipt] (
  10. @flag VARCHAR(50)
  11. ,@user VARCHAR(30) = NULL
  12. ,@controlNo VARCHAR(30) = NULL
  13. ,@tranId INT = NULL
  14. )
  15. AS
  16. SET NOCOUNT ON;
  17. IF @flag = 'receipt'
  18. BEGIN
  19. SELECT
  20. referenceNumber = dbo.FNADecryptString(controlNo)
  21. ,receiverName = tr.firstName + ISNULL( ' ' + tr.middleName, '') + ISNULL( ' ' + tr.lastName1, '') + ISNULL( ' ' + tr.lastName2, '')
  22. ,recDOB = convert(varchar,tr.dob,101)
  23. ,recAddress = tr.[address]
  24. ,recContactNumber = isnull(tr.homePhone,tr.mobile)
  25. ,receivingCountry = rt.pCountry
  26. ,senderName = ts.firstName + ISNULL( ' ' + ts.middleName, '') + ISNULL( ' ' + ts.lastName1, '') + ISNULL( ' ' + ts.lastName2, '')
  27. ,sendAmount = rt.pAmt
  28. ,expectedReceiveAmt = rt.pAmt
  29. ,sendingCountry = rt.sCountry
  30. ,authorisationCode = ts.txnTestAnswer
  31. ,officeName = ts.companyName
  32. ,aDate = convert(varchar,rt.createdDatelocal,101)
  33. ,mgOperationIdNo = rt.controlNo2
  34. ,amountPaid = rt.pAmt
  35. ,currency = rt.payoutCurr
  36. ,totalRoundAmount = rt.pAmt
  37. ,receiverIdType = tr.idType2
  38. ,receiverIdNumber = tr.idNumber2
  39. ,receiverCountryOfBirth = tr.nativeCountry
  40. ,issuingStateCountry = tr.idPlaceOfIssue
  41. ,receiverOccupation = tr.occupation
  42. ,recSignatureDate = convert(varchar,rt.paidDate,101)
  43. FROM remitTran rt WITH(NOLOCK)
  44. INNER JOIN tranReceivers tr WITH(NOLOCK) ON rt.id = tr.tranId
  45. INNER JOIN tranSenders ts WITH(NOLOCK) ON rt.id = ts.tranId
  46. WHERE controlNo = dbo.FNAEncryptString(@controlNo)
  47. END
  48. GO