|
|
@ -32,37 +32,38 @@ $(document).ready(function () { |
|
|
|
$("#searchStatement").attr("disabled", "disabled"); |
|
|
|
var dataToSend = { MethodName: "loadCustomerDataSendPage", CustomerIdNumber: customerIdNumber }; |
|
|
|
var options = |
|
|
|
{ |
|
|
|
url: '', |
|
|
|
data: dataToSend, |
|
|
|
dataType: 'JSON', |
|
|
|
type: 'POST', |
|
|
|
success: function (response) { |
|
|
|
$("#searchCustomer").removeAttr("disabled"); |
|
|
|
if (response[0].errorCode === 0) { |
|
|
|
$('#step2SendRemittance').show(); |
|
|
|
$('#step2SendRemittanceCustomer').show(); |
|
|
|
$('#step2SendRemittanceAgreement').show(); |
|
|
|
$('#signatureDiv').show(); |
|
|
|
$('#step2SendRemittanceSaveButton').show(); |
|
|
|
$("#" + mId + "customerName").text(response[0].CUSTOMERNAME); |
|
|
|
$("#" + mId + "membershiId").text(response[0].MEMBERSHIPID); |
|
|
|
CustomerSignature(); |
|
|
|
ParseDDlDynamic(response, 'ddlBenedeciary', 'FULLNAME', 'RECEIVERID', 'Select Beneficiary'); |
|
|
|
} |
|
|
|
else { |
|
|
|
alert(response[0].Msg); |
|
|
|
$('#step2SendRemittance').hide(); |
|
|
|
$('#step2SendRemittanceCustomer').hide(); |
|
|
|
$('#step2SendRemittanceAgreement').hide(); |
|
|
|
$('#signatureDiv').hide(); |
|
|
|
$('#step2SendRemittanceSaveButton').hide(); |
|
|
|
|
|
|
|
$("#" + mId + "senderIdNumber").val(''); |
|
|
|
$("#" + mId + "senderIdNumber").focus(); |
|
|
|
} |
|
|
|
{ |
|
|
|
url: '', |
|
|
|
data: dataToSend, |
|
|
|
dataType: 'JSON', |
|
|
|
type: 'POST', |
|
|
|
success: function (response) { |
|
|
|
$("#searchCustomer").removeAttr("disabled"); |
|
|
|
if (response[0].errorCode === 0) { |
|
|
|
$('#step2SendRemittance').show(); |
|
|
|
$('#step2SendRemittanceCustomer').show(); |
|
|
|
$('#step2SendRemittanceAgreement').show(); |
|
|
|
$('#signatureDiv').show(); |
|
|
|
$('#step2SendRemittanceSaveButton').show(); |
|
|
|
$("#" + mId + "customerName").text(response[0].CUSTOMERNAME); |
|
|
|
$("#" + mId + "membershiId").text(response[0].MEMBERSHIPID); |
|
|
|
$("#" + mId + "hdnCustomerId").val(response[0].CUSTOMERID); |
|
|
|
CustomerSignature(); |
|
|
|
ParseDDlDynamic(response, 'ddlBenedeciary', 'FULLNAME', 'RECEIVERID', 'Select Beneficiary'); |
|
|
|
} |
|
|
|
else { |
|
|
|
alert(response[0].Msg); |
|
|
|
$('#step2SendRemittance').hide(); |
|
|
|
$('#step2SendRemittanceCustomer').hide(); |
|
|
|
$('#step2SendRemittanceAgreement').hide(); |
|
|
|
$('#signatureDiv').hide(); |
|
|
|
$('#step2SendRemittanceSaveButton').hide(); |
|
|
|
|
|
|
|
$("#" + mId + "senderIdNumber").val(''); |
|
|
|
$("#" + mId + "senderIdNumber").focus(); |
|
|
|
} |
|
|
|
}; |
|
|
|
} |
|
|
|
}; |
|
|
|
$.ajax(options); |
|
|
|
}); |
|
|
|
$("#MainContent_TransactionAgreement").click(function () { |
|
|
@ -82,67 +83,67 @@ $(document).ready(function () { |
|
|
|
|
|
|
|
var dataToSend = { MethodName: "getBenefeciaryDetails", BenefeciaryId: benefeciaryId }; |
|
|
|
var options = |
|
|
|
{ |
|
|
|
url: '', |
|
|
|
data: dataToSend, |
|
|
|
dataType: 'JSON', |
|
|
|
type: 'POST', |
|
|
|
success: function (response) { |
|
|
|
if (response[0].errorCode === 0) { |
|
|
|
$("#" + mId + "receiverFullName").val(response[0].fullName); |
|
|
|
$("#" + mId + "receiveraddress").val(response[0].address); |
|
|
|
$("#" + mId + "receiverMobileNumber").val(response[0].mobile); |
|
|
|
$("#" + mId + "purpose").val(response[0].address); |
|
|
|
$("#" + mId + "relationship").val(response[0].address); |
|
|
|
$("#" + mId + "accountNo").val(response[0].receiverAccountNo); |
|
|
|
|
|
|
|
if (response[0].relationship === '11339') { |
|
|
|
$("#" + mId + "otherRelationshipTextBox").val(response[0].relationOther); |
|
|
|
$('#otherRelationDiv').show(); |
|
|
|
} |
|
|
|
if (response[0].purposeOfRemit === '11347') { |
|
|
|
$('#purposeOtherDiv').show(); |
|
|
|
$("#" + mId + "purposeOther").val(response[0].purposeOther); |
|
|
|
} |
|
|
|
{ |
|
|
|
url: '', |
|
|
|
data: dataToSend, |
|
|
|
dataType: 'JSON', |
|
|
|
type: 'POST', |
|
|
|
success: function (response) { |
|
|
|
if (response[0].errorCode === 0) { |
|
|
|
$("#" + mId + "receiverFullName").val(response[0].fullName); |
|
|
|
$("#" + mId + "receiveraddress").val(response[0].address); |
|
|
|
$("#" + mId + "receiverMobileNumber").val(response[0].mobile); |
|
|
|
$("#" + mId + "purpose").val(response[0].address); |
|
|
|
$("#" + mId + "relationship").val(response[0].address); |
|
|
|
$("#" + mId + "accountNo").val(response[0].receiverAccountNo); |
|
|
|
|
|
|
|
if (response[0].relationship === '11339') { |
|
|
|
$("#" + mId + "otherRelationshipTextBox").val(response[0].relationOther); |
|
|
|
$('#otherRelationDiv').show(); |
|
|
|
} |
|
|
|
if (response[0].purposeOfRemit === '11347') { |
|
|
|
$('#purposeOtherDiv').show(); |
|
|
|
$("#" + mId + "purposeOther").val(response[0].purposeOther); |
|
|
|
} |
|
|
|
|
|
|
|
if ($.isNumeric(response[0].purposeOfRemit)) { |
|
|
|
SetDDLValueSelected(mId + "purpose", response[0].purposeOfRemit); |
|
|
|
} else { |
|
|
|
SetDDLTextSelected(mId + "purpose", response[0].purposeOfRemit); |
|
|
|
} |
|
|
|
if ($.isNumeric(response[0].relationship)) { |
|
|
|
SetDDLValueSelected(mId + "relationship", response[0].relationship); |
|
|
|
} else { |
|
|
|
SetDDLTextSelected(mId + "relationship", response[0].relationship); |
|
|
|
} |
|
|
|
SetDDLTextSelected(mId + "pCountry", response[0].country); |
|
|
|
if ($.isNumeric(response[0].purposeOfRemit)) { |
|
|
|
SetDDLValueSelected(mId + "purpose", response[0].purposeOfRemit); |
|
|
|
} else { |
|
|
|
SetDDLTextSelected(mId + "purpose", response[0].purposeOfRemit); |
|
|
|
} |
|
|
|
if ($.isNumeric(response[0].relationship)) { |
|
|
|
SetDDLValueSelected(mId + "relationship", response[0].relationship); |
|
|
|
} else { |
|
|
|
SetDDLTextSelected(mId + "relationship", response[0].relationship); |
|
|
|
} |
|
|
|
SetDDLTextSelected(mId + "pCountry", response[0].country); |
|
|
|
|
|
|
|
PcountryOnChange('c', response[0].paymentMethod.toUpperCase(), response[0].bankId); |
|
|
|
PcountryOnChange('c', response[0].paymentMethod.toUpperCase(), response[0].bankId); |
|
|
|
|
|
|
|
if (response[0].branchDetails) { |
|
|
|
if (response[0].manualType === 'Y') { |
|
|
|
$("#" + mId + "branch_manual").val(response[0].branchDetails); |
|
|
|
} |
|
|
|
else { |
|
|
|
var dataSelectDDL = { |
|
|
|
id: response[0].branchDetails.split('|')[0], |
|
|
|
text: response[0].branchDetails.split('|')[1] |
|
|
|
}; |
|
|
|
if (dataSelectDDL.id !== 'N/A') { |
|
|
|
var newOption = new Option(dataSelectDDL.text, dataSelectDDL.id, false, false); |
|
|
|
$('.js-example-basic-single').append(newOption).trigger('change'); |
|
|
|
$('.js-example-basic-single').val(dataSelectDDL.id); // Select the option with a value of '1'
|
|
|
|
$('.js-example-basic-single').trigger('change'); |
|
|
|
} |
|
|
|
if (response[0].branchDetails) { |
|
|
|
if (response[0].manualType === 'Y') { |
|
|
|
$("#" + mId + "branch_manual").val(response[0].branchDetails); |
|
|
|
} |
|
|
|
else { |
|
|
|
var dataSelectDDL = { |
|
|
|
id: response[0].branchDetails.split('|')[0], |
|
|
|
text: response[0].branchDetails.split('|')[1] |
|
|
|
}; |
|
|
|
if (dataSelectDDL.id !== 'N/A') { |
|
|
|
var newOption = new Option(dataSelectDDL.text, dataSelectDDL.id, false, false); |
|
|
|
$('.js-example-basic-single').append(newOption).trigger('change'); |
|
|
|
$('.js-example-basic-single').val(dataSelectDDL.id); // Select the option with a value of '1'
|
|
|
|
$('.js-example-basic-single').trigger('change'); |
|
|
|
} |
|
|
|
} |
|
|
|
ShowHideAccountNo(); |
|
|
|
} |
|
|
|
else { |
|
|
|
alert(response[0].Msg); |
|
|
|
} |
|
|
|
ShowHideAccountNo(); |
|
|
|
} |
|
|
|
}; |
|
|
|
else { |
|
|
|
alert(response[0].Msg); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
$.ajax(options); |
|
|
|
}); |
|
|
|
$("#" + mId + "purpose").on("change", function () { |
|
|
@ -265,6 +266,7 @@ function ResetAmountFields() { |
|
|
|
//GetElement("spnSchemeOffer").innerHTML = "";
|
|
|
|
//GetElement("spnWarningMsg").innerHTML = "";
|
|
|
|
} |
|
|
|
|
|
|
|
function PcountryOnChange(obj, pmode, pAgentSelected = "") { |
|
|
|
var pCountry = $("#" + mId + "pCountry").val(); |
|
|
|
if (pCountry === "" || pCountry === null) |
|
|
@ -277,37 +279,37 @@ function PcountryOnChange(obj, pmode, pAgentSelected = "") { |
|
|
|
if (obj === 'pcurr') { |
|
|
|
method = "PCurrPcountry"; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var dataToSend = { MethodName: method, pCountry: pCountry }; |
|
|
|
var options = |
|
|
|
{ |
|
|
|
url: '', |
|
|
|
data: dataToSend, |
|
|
|
dataType: 'JSON', |
|
|
|
type: 'POST', |
|
|
|
async: false, |
|
|
|
success: function (response) { |
|
|
|
if (obj === 'c') { |
|
|
|
LoadPayMode(response, document.getElementById(mId + "pMode"), 'pcurr', "", pmode); |
|
|
|
ReceivingModeOnChange("", pAgentSelected); |
|
|
|
GetPayoutPartner(response[0].serviceTypeId); |
|
|
|
|
|
|
|
CheckForBranchShowIde(); |
|
|
|
} |
|
|
|
else if (obj === 'pcurr') { |
|
|
|
if (response === "") |
|
|
|
return false; |
|
|
|
$("#" + mId + "lblPayCurr").text(response[0].currencyCode); |
|
|
|
$("#" + mId + "lblExCurr").text(response[0].currencyCode); |
|
|
|
{ |
|
|
|
url: '', |
|
|
|
data: dataToSend, |
|
|
|
dataType: 'JSON', |
|
|
|
type: 'POST', |
|
|
|
async: false, |
|
|
|
success: function (response) { |
|
|
|
if (obj === 'c') { |
|
|
|
LoadPayMode(response, document.getElementById(mId + "pMode"), 'pcurr', "", pmode); |
|
|
|
ReceivingModeOnChange("", pAgentSelected); |
|
|
|
GetPayoutPartner(response[0].serviceTypeId); |
|
|
|
|
|
|
|
CheckForBranchShowIde(); |
|
|
|
} |
|
|
|
else if (obj === 'pcurr') { |
|
|
|
if (response === "") |
|
|
|
return false; |
|
|
|
$("#" + mId + "lblPayCurr").text(response[0].currencyCode); |
|
|
|
$("#" + mId + "lblExCurr").text(response[0].currencyCode); |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
return true; |
|
|
|
}, |
|
|
|
error: function (result) { |
|
|
|
alert("Due to unexpected errors we were unable to load data"); |
|
|
|
} |
|
|
|
}; |
|
|
|
return true; |
|
|
|
}, |
|
|
|
error: function (result) { |
|
|
|
alert("Due to unexpected errors we were unable to load data"); |
|
|
|
} |
|
|
|
}; |
|
|
|
$.ajax(options); |
|
|
|
} |
|
|
|
|
|
|
@ -363,6 +365,7 @@ function LoadLocationDDL(response) { |
|
|
|
LoadSublocation(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function LoadPayMode(response, myDDL, recall, selectField, obj) { |
|
|
|
var data = response; |
|
|
|
//CheckSession(data);
|
|
|
@ -392,11 +395,13 @@ function LoadPayMode(response, myDDL, recall, selectField, obj) { |
|
|
|
SetDDLTextSelected(mId + "pMode", obj); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function ReceivingModeOnChange(pModeSelected, pAgentSelected) { |
|
|
|
ResetAmountFields(); |
|
|
|
$("#" + mId + "pAgent").empty(); |
|
|
|
PaymentModeChange(pModeSelected, pAgentSelected); |
|
|
|
} |
|
|
|
|
|
|
|
function PaymentModeChange(pModeSelected, pAgentSelected) { |
|
|
|
var pMode = ""; |
|
|
|
if (pModeSelected === "" || pModeSelected === null) |
|
|
@ -417,27 +422,28 @@ function PaymentModeChange(pModeSelected, pAgentSelected) { |
|
|
|
} |
|
|
|
var dataToSend = { MethodName: "loadAgentBank", pMode: pMode, pCountry: pCountry }; |
|
|
|
var options = |
|
|
|
{ |
|
|
|
url: '', |
|
|
|
data: dataToSend, |
|
|
|
dataType: 'JSON', |
|
|
|
type: 'POST', |
|
|
|
async: false, |
|
|
|
success: function (response) { |
|
|
|
//LoadAgentSetting();
|
|
|
|
ParseLoadDDl(response, GetElement(mId + "pAgent"), 'agentSelection', ""); |
|
|
|
if (pAgentSelected !== "" && pAgentSelected !== null && pAgentSelected !== undefined) { |
|
|
|
SetDDLValueSelected(mId + "pAgent", pAgentSelected); |
|
|
|
} |
|
|
|
var agentId = $("#" + mId + "pAgent").val(); |
|
|
|
if (agentId !== "" && agentId !== null && agentId !== undefined) { |
|
|
|
var payMode = $("#" + mId + "pMode").val(); |
|
|
|
$('.same').show(); |
|
|
|
} |
|
|
|
{ |
|
|
|
url: '', |
|
|
|
data: dataToSend, |
|
|
|
dataType: 'JSON', |
|
|
|
type: 'POST', |
|
|
|
async: false, |
|
|
|
success: function (response) { |
|
|
|
//LoadAgentSetting();
|
|
|
|
ParseLoadDDl(response, GetElement(mId + "pAgent"), 'agentSelection', ""); |
|
|
|
if (pAgentSelected !== "" && pAgentSelected !== null && pAgentSelected !== undefined) { |
|
|
|
SetDDLValueSelected(mId + "pAgent", pAgentSelected); |
|
|
|
} |
|
|
|
}; |
|
|
|
var agentId = $("#" + mId + "pAgent").val(); |
|
|
|
if (agentId !== "" && agentId !== null && agentId !== undefined) { |
|
|
|
var payMode = $("#" + mId + "pMode").val(); |
|
|
|
$('.same').show(); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
$.ajax(options); |
|
|
|
} |
|
|
|
|
|
|
|
function ParseLoadDDl(response, myDDL, recall, selectField) { |
|
|
|
var data = response; |
|
|
|
//CheckSession(data);
|
|
|
@ -498,6 +504,7 @@ function ParseLoadDDl(response, myDDL, recall, selectField) { |
|
|
|
var pCountry = $("#" + mId + "pCountry option:selected").text(); |
|
|
|
var pCurr = $("#" + mId + "lblPayCurr").text(); |
|
|
|
} |
|
|
|
|
|
|
|
function ClearCalculatedAmount() { |
|
|
|
$("#" + mId + "txtCollAmt").val(''); |
|
|
|
$("#" + mId + "lblSendAmt").val(0); |
|
|
@ -506,6 +513,7 @@ function ClearCalculatedAmount() { |
|
|
|
$("#" + mId + "txtPayAmt").val(''); |
|
|
|
$("#" + mId + "customerRateFields").hide(); |
|
|
|
} |
|
|
|
|
|
|
|
function GetPayoutPartner(payMode) { |
|
|
|
var pCountry = $("#" + mId + "pCountry").val(); |
|
|
|
var pMode = $("#" + mId + "pMode").val(); |
|
|
@ -597,6 +605,7 @@ function ParseBranchDDl(response, myDDL, recall, selectField) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function CollAmtOnChange() { |
|
|
|
var collAmt = $("#" + mId + "txtCollAmt").val(); |
|
|
|
if (collAmt === "") |
|
|
@ -610,6 +619,7 @@ function CollAmtOnChange() { |
|
|
|
} |
|
|
|
checkdata(collAmt, 'cAmt'); |
|
|
|
} |
|
|
|
|
|
|
|
function CurrencyFormatted(amount) { |
|
|
|
var i = parseFloat(amount); |
|
|
|
if (isNaN(i)) { i = 0.00; } |
|
|
@ -628,6 +638,7 @@ function CurrencyFormatted(amount) { |
|
|
|
|
|
|
|
return CommaFormatted(s, amount); |
|
|
|
} |
|
|
|
|
|
|
|
function CommaFormatted(amount, amountMain) { |
|
|
|
var delimiter = ","; |
|
|
|
var a = amount.split('.', 2); |
|
|
@ -656,13 +667,13 @@ function CommaFormatted(amount, amountMain) { |
|
|
|
return amount; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function checkdata(amt, obj) { |
|
|
|
if (amt > 0) |
|
|
|
CalculateTxn(amt, obj); |
|
|
|
else |
|
|
|
ClearCalculatedAmount(); |
|
|
|
} |
|
|
|
|
|
|
|
function CalculateTxn(amt, obj, isManualSc) { |
|
|
|
|
|
|
|
var collAmt = parseFloat($("#" + mId + "txtCollAmt").val().replace(',', '').replace(',', '').replace(',', '')); |
|
|
@ -772,20 +783,21 @@ function CalculateTxn(amt, obj, isManualSc) { |
|
|
|
}; |
|
|
|
|
|
|
|
var options = |
|
|
|
{ |
|
|
|
url: '', |
|
|
|
data: dataToSend, |
|
|
|
dataType: 'JSON', |
|
|
|
type: 'POST', |
|
|
|
async: false, |
|
|
|
success: function (response) { |
|
|
|
ParseCalculateData(response, obj); |
|
|
|
} |
|
|
|
}; |
|
|
|
{ |
|
|
|
url: '', |
|
|
|
data: dataToSend, |
|
|
|
dataType: 'JSON', |
|
|
|
type: 'POST', |
|
|
|
async: false, |
|
|
|
success: function (response) { |
|
|
|
ParseCalculateData(response, obj); |
|
|
|
} |
|
|
|
}; |
|
|
|
$.ajax(options); |
|
|
|
$("#DivLoad").hide(); |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
function ParseCalculateData(response, amtType) { |
|
|
|
var data = response; |
|
|
|
if (data[0].ErrCode === '1') { |
|
|
@ -830,6 +842,7 @@ function ParseCalculateData(response, amtType) { |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function roundNumber(rnum, rlength) { // Arguments: number to round, number of decimal places
|
|
|
|
var newnumber = Math.round(rnum * Math.pow(10, rlength)) / Math.pow(10, rlength); |
|
|
|
return parseFloat(newnumber); // Output the result to the form field (change for your purposes)
|
|
|
@ -838,7 +851,9 @@ function roundNumber(rnum, rlength) { // Arguments: number to round, number of d |
|
|
|
function ValidateDetailsMain() { |
|
|
|
var isFormDataValid = ValidateDetails(); |
|
|
|
if (isFormDataValid === true) { |
|
|
|
return CheckSignatureCustomerFromCustomerRegister(); |
|
|
|
// return CheckSignatureCustomerFromCustomerRegister();
|
|
|
|
// return true;
|
|
|
|
SendTransactionJS(); |
|
|
|
} |
|
|
|
else { |
|
|
|
return false; |
|
|
@ -899,36 +914,11 @@ function ValidateDetails() { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function SetMessageBox(msg, errorCode) { |
|
|
|
alert(msg); |
|
|
|
} |
|
|
|
|
|
|
|
function VerifyDetails() { |
|
|
|
var dataToSend = { |
|
|
|
Methodname: 'ValidateDetails' |
|
|
|
, membershipId: $("#" + mId + "senderIdNumber").val() |
|
|
|
, receiverName: $("#" + mId + "receiverFullName").val() |
|
|
|
} |
|
|
|
$.post('', dataToSend, function (response) { |
|
|
|
var data = JSON.parse(response); |
|
|
|
if (data[0].ERROR_CODE == '0') { |
|
|
|
var pMode = $("#" + mId + "pMode").val(); |
|
|
|
var pgent = $("#" + mId + "pAgent").val(); |
|
|
|
var pbranch = $("#" + mId + "branch").val(); |
|
|
|
|
|
|
|
$("#" + mId + "hddPmode").val(pMode); |
|
|
|
$("#" + mId + "hddPagent").val(pgent); |
|
|
|
$("#" + mId + "hddpBranch").val(pbranch); |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
alert(data[0].Msg); |
|
|
|
return false; |
|
|
|
} |
|
|
|
}).fail(function (response) { |
|
|
|
return false; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
function SetDDLValueSelected(ddl, selectText) { |
|
|
|
$("#" + ddl + " option").each(function () { |
|
|
|
if ($(this).val() === $.trim(selectText)) { |
|
|
@ -938,26 +928,6 @@ function SetDDLValueSelected(ddl, selectText) { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
function ClearAllData() { |
|
|
|
$("#" + mId + "receiverFullName").val(''); |
|
|
|
$("#" + mId + "receiveraddress").val(''); |
|
|
|
$("#" + mId + "receiverMobileNumber").val(''); |
|
|
|
$("#" + mId + "purpose").val(''); |
|
|
|
$("#" + mId + "relationship").val(''); |
|
|
|
$("#" + mId + "purposeOther").val(''); |
|
|
|
$("#" + mId + "otherRelationshipTextBox").val(''); |
|
|
|
$('#otherRelationDiv').hide(); |
|
|
|
$('#purposeOtherDiv').hide(); |
|
|
|
$("#" + mId + "purpose").val(''); |
|
|
|
$("#" + mId + "relationship").val(''); |
|
|
|
$("#" + mId + "pCountry").val(''); |
|
|
|
$("#" + mId + "pAgent").empty(); |
|
|
|
$("#" + mId + "branch").empty(); |
|
|
|
|
|
|
|
SetDDLTextSelected(mId + "pCountry", ''); |
|
|
|
ClearCalculatedAmount(); |
|
|
|
} |
|
|
|
|
|
|
|
function CheckForMobileNumber(nField, fieldName) { |
|
|
|
var numberPattern = /^[+]?[0-9]{6,16}$/; |
|
|
|
test = numberPattern.test(nField.value); |
|
|
@ -1006,4 +976,222 @@ function SetPayCurrency(pCountry) { |
|
|
|
} |
|
|
|
}; |
|
|
|
$.ajax(options); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$(document).on('click', '#calc', function () { |
|
|
|
if (ValidateDetailsMain() == "true") { |
|
|
|
SendTransactionJS(); |
|
|
|
} |
|
|
|
/* GetAdditionalCDDIForm();*/ |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
function SendTransactionJS() { |
|
|
|
var idNumber = $("#" + mId + "senderIdNumber").val(); |
|
|
|
var receiverFullNameValue = $("#" + mId + "receiverFullName").val(); |
|
|
|
var receiveraddressValue = $("#" + mId + "receiveraddress").val(); |
|
|
|
var receiverMobileNumberValue = $("#" + mId + "receiverMobileNumber").val(); |
|
|
|
var pCountryId = $("#" + mId + "pCountry").val(); |
|
|
|
var pmodeId = $("#" + mId + "pMode").val(); |
|
|
|
var pagentId = $("#" + mId + "pAgent").val(); |
|
|
|
var branchId = $("#" + mId + "branch").val(); |
|
|
|
var accountnoValue = $("#" + mId + "accountNo").val(); |
|
|
|
var cAmt = $("#" + mId + "txtCollAmt").val(); |
|
|
|
var tamt = $("#" + mId + "lblSendAmt").val(); |
|
|
|
var serviceCharge = $("#" + mId + "lblServiceChargeAmt").val(); |
|
|
|
var purposeOfRemittanceId = $("#" + mId + "purpose").val(); |
|
|
|
var otherPurpose = $("#" + mId + "purposeOther").val(); |
|
|
|
var relationShipId = $("#" + mId + "relationShip").val(); |
|
|
|
var otherRelation = $("#" + mId + "otherRelationshipTextBox").val(); |
|
|
|
var referralNameValue = $("#" + mId + "referralName").val(); |
|
|
|
var collectionMode = $("#" + mId + "ddlCollMode").val(); |
|
|
|
var deliveryMethod = $("#" + mId + "pMode").val(); |
|
|
|
|
|
|
|
var isCDDI = $("#" + mId + "hddIsAdditionalCDDI").val(); |
|
|
|
var hddAgentRefId = $("#" + mId + "hddAgentRefId").val(); |
|
|
|
var xmlDataForCDDI = ''; |
|
|
|
if (isCDDI === 'Y') { |
|
|
|
xmlDataForCDDI = GetXMLData(); |
|
|
|
//sessionStorage.setItem("XmlDataForCDDI", xmlDataForCDDI);
|
|
|
|
} |
|
|
|
|
|
|
|
var dataToSend = { |
|
|
|
MethodName: 'sendTransaction', idNumber: idNumber, receiverFullNameValue: receiverFullNameValue, receiveraddressValue: receiveraddressValue, receiverMobileNumberValue: receiverMobileNumberValue, |
|
|
|
pCountryId: pCountryId, pmodeId: pmodeId, pagentId: pagentId, branchId: branchId, accountnoValue: accountnoValue, cAmt: cAmt, tamt: tamt, serviceCharge: serviceCharge, purposeOfRemittanceId: purposeOfRemittanceId, |
|
|
|
otherPurpose: otherPurpose, relationShipId: relationShipId, otherRelation: otherRelation, referralNameValue: referralNameValue, collectionMode: collectionMode, deliveryMethod: deliveryMethod, |
|
|
|
hddAgentRefId: hddAgentRefId, isCDDI: isCDDI, xmlDataForCDDI: xmlDataForCDDI |
|
|
|
}; |
|
|
|
$.ajax({ |
|
|
|
type: "POST", |
|
|
|
data: dataToSend, |
|
|
|
async: true, |
|
|
|
success: function (response) { |
|
|
|
var data = jQuery.parseJSON(response); |
|
|
|
|
|
|
|
if (data[0][0].errorCode !== 0) { |
|
|
|
|
|
|
|
$("#" + mId + "complianceField").show(); |
|
|
|
$("#" + mId + "divCompliance").show(); |
|
|
|
|
|
|
|
if (data[0][0].errorCode == "100") // 100 means ofac
|
|
|
|
{ |
|
|
|
var result = data[0][0].id.split('|'); |
|
|
|
$("#" + mId + "hdnOfacRes").val(result[0]); |
|
|
|
$("#" + mId + "hdnOfacReason").val(result[1]); |
|
|
|
$("#" + mId + "hdnTrackBy").val(data[0][0].extra); |
|
|
|
|
|
|
|
if (data.table.row.count > 0) { |
|
|
|
LoadOfacList(data[0], data[1], data[0][0].receiverFullName); |
|
|
|
} |
|
|
|
if (data.table.count > 2) { |
|
|
|
if (data[3].row.count > 0 && data[2][0].errorCode != "0") { |
|
|
|
LoadCompliance(data[2], data[3], "tran"); // add agentRefId
|
|
|
|
ShowDuplicateTxn(data[5], data[6]); |
|
|
|
} |
|
|
|
else { |
|
|
|
ShowDuplicateTxn(data[3], data[4]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else if (data[0][0].errorCode == "101" || data[0][0].errorCode == "102" || data[0][0].errorCode == "103") { |
|
|
|
ShowDuplicateTxn(data[3], data[4]); |
|
|
|
LoadCompliance(data[0], data[1], "questionnaire"); // add agentRefId
|
|
|
|
} |
|
|
|
else { |
|
|
|
ShowDuplicateTxn(data[1], data[2]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
SaveTransaction(); |
|
|
|
} |
|
|
|
// $('#btnSaveAdditionalCDDI').attr('disabled', false);
|
|
|
|
|
|
|
|
}, |
|
|
|
fail: function () { |
|
|
|
$('#calc').attr('disabled', false); |
|
|
|
alert("Error fetching data"); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
function ClearAllCustomerInfo() { |
|
|
|
$('.infoDiv').css('pointer-events', 'auto'); |
|
|
|
$('#' + mId + "Manage").hide(); |
|
|
|
$('#' + mId + "additionalCDDI").hide(); |
|
|
|
|
|
|
|
$("#" + mId + "calc").attr('disabled', false); |
|
|
|
$("#" + mId + "hddIsAdditionalCDDI").val('N'); |
|
|
|
$("#" + mId + "hddAgentRefId").val(''); |
|
|
|
|
|
|
|
// ClearCDDIInfo();
|
|
|
|
|
|
|
|
$("#" + mId + "senderIdNumber").val(''); |
|
|
|
$("#" + mId + "receiverFullName").val(''); |
|
|
|
$("#" + mId + "receiveraddress").val(''); |
|
|
|
$("#" + mId + "receiverMobileNumber").val(''); |
|
|
|
$("#" + mId + "pCountry").val(''); |
|
|
|
$("#" + mId + "pmode").val(''); |
|
|
|
$("#" + mId + "pagent").val(''); |
|
|
|
$("#" + mId + "branch").val(''); |
|
|
|
$("#" + mId + "accountno").val(''); |
|
|
|
$("#" + mId + "txtCollAmt").val(''); |
|
|
|
$("#" + mId + "lblSendAmt").val(''); |
|
|
|
$("#" + mId + "lblServiceChargeAmt").val(''); |
|
|
|
$("#" + mId + "purpose").val(''); |
|
|
|
$("#" + mId + "purposeOther").val(''); |
|
|
|
$("#" + mId + "relationShip").val(''); |
|
|
|
$("#" + mId + "otherRelationshipTextBox").val(''); |
|
|
|
$("#" + mId + "referralName").val(''); |
|
|
|
$("#" + mId + "ddlCollMode").val(''); |
|
|
|
$("#" + mId + "pmode").val(''); |
|
|
|
} |
|
|
|
|
|
|
|
function ClearAllData() { |
|
|
|
$("#" + mId + "receiverFullName").val(''); |
|
|
|
$("#" + mId + "receiveraddress").val(''); |
|
|
|
$("#" + mId + "receiverMobileNumber").val(''); |
|
|
|
$("#" + mId + "purpose").val(''); |
|
|
|
$("#" + mId + "relationship").val(''); |
|
|
|
$("#" + mId + "purposeOther").val(''); |
|
|
|
$("#" + mId + "otherRelationshipTextBox").val(''); |
|
|
|
$('#otherRelationDiv').hide(); |
|
|
|
$('#purposeOtherDiv').hide(); |
|
|
|
$("#" + mId + "purpose").val(''); |
|
|
|
$("#" + mId + "relationship").val(''); |
|
|
|
$("#" + mId + "pCountry").val(''); |
|
|
|
$("#" + mId + "pAgent").empty(); |
|
|
|
$("#" + mId + "branch").empty(); |
|
|
|
|
|
|
|
SetDDLTextSelected(mId + "pCountry", ''); |
|
|
|
ClearCalculatedAmount(); |
|
|
|
} |
|
|
|
|
|
|
|
$(document).on('click', '#btnSendTxnCDDI', function () { |
|
|
|
var isValid = 'Y'; |
|
|
|
$(".requiredCompliance").each(function () { |
|
|
|
if (!$.trim($(this).val())) { |
|
|
|
$(this).addClass('error'); |
|
|
|
isValid = 'N'; |
|
|
|
} |
|
|
|
}); |
|
|
|
if (isValid === 'N') { |
|
|
|
return alert("Required Field(s)\n _____________________________ \n The red fields are required!") |
|
|
|
} |
|
|
|
SaveTransaction(); |
|
|
|
}); |
|
|
|
|
|
|
|
function SaveTransaction() { |
|
|
|
var idNumber = $("#" + mId + "senderIdNumber").val(); |
|
|
|
var receiverFullNameValue = $("#" + mId + "receiverFullName").val(); |
|
|
|
var receiveraddressValue = $("#" + mId + "receiveraddress").val(); |
|
|
|
var receiverMobileNumberValue = $("#" + mId + "receiverMobileNumber").val(); |
|
|
|
var pCountryId = $("#" + mId + "pCountry").val(); |
|
|
|
var pmodeId = $("#" + mId + "pMode").val(); |
|
|
|
var pagentId = $("#" + mId + "pAgent").val(); |
|
|
|
var branchId = $("#" + mId + "branch").val(); |
|
|
|
var accountnoValue = $("#" + mId + "accountNo").val(); |
|
|
|
var cAmt = $("#" + mId + "txtCollAmt").val(); |
|
|
|
var tamt = $("#" + mId + "lblSendAmt").val(); |
|
|
|
var serviceCharge = $("#" + mId + "lblServiceChargeAmt").val(); |
|
|
|
var purposeOfRemittanceId = $("#" + mId + "purpose").val(); |
|
|
|
var otherPurpose = $("#" + mId + "purposeOther").val(); |
|
|
|
var relationShipId = $("#" + mId + "relationShip").val(); |
|
|
|
var otherRelation = $("#" + mId + "otherRelationshipTextBox").val(); |
|
|
|
var referralNameValue = $("#" + mId + "referralName").val(); |
|
|
|
var collectionMode = $("#" + mId + "ddlCollMode").val(); |
|
|
|
var deliveryMethod = $("#" + mId + "pMode").val(); |
|
|
|
|
|
|
|
var isCDDI = $("#" + mId + "hddIsAdditionalCDDI").val(); |
|
|
|
var hddAgentRefId = $("#" + mId + "hddAgentRefId").val(); |
|
|
|
var xmlDataForCDDI = ''; |
|
|
|
if (isCDDI === 'Y') { |
|
|
|
xmlDataForCDDI = GetXMLData(); |
|
|
|
//sessionStorage.setItem("XmlDataForCDDI", xmlDataForCDDI);
|
|
|
|
} |
|
|
|
|
|
|
|
var dataToSend = { |
|
|
|
MethodName: 'saveTransaction', idNumber: idNumber, receiverFullNameValue: receiverFullNameValue, receiveraddressValue: receiveraddressValue, receiverMobileNumberValue: receiverMobileNumberValue, |
|
|
|
pCountryId: pCountryId, pmodeId: pmodeId, pagentId: pagentId, branchId: branchId, accountnoValue: accountnoValue, cAmt: cAmt, tamt: tamt, serviceCharge: serviceCharge, purposeOfRemittanceId: purposeOfRemittanceId, |
|
|
|
otherPurpose: otherPurpose, relationShipId: relationShipId, otherRelation: otherRelation, referralNameValue: referralNameValue, collectionMode: collectionMode, deliveryMethod: deliveryMethod, |
|
|
|
hddAgentRefId: hddAgentRefId, isCDDI: isCDDI, xmlDataForCDDI: xmlDataForCDDI |
|
|
|
}; |
|
|
|
$.ajax({ |
|
|
|
type: "POST", |
|
|
|
data: dataToSend, |
|
|
|
async: true, |
|
|
|
success: function (response) { |
|
|
|
var data = jQuery.parseJSON(response); |
|
|
|
//alert(data[0][0].Msg);
|
|
|
|
if (data.errorCode = "0") { |
|
|
|
var id = data.Extra.split('|')[1]; |
|
|
|
window.location.replace("PrintSendMoneyRequestDetails.aspx?customerId=" + id + "&rowId=" + data.Id); |
|
|
|
} |
|
|
|
alert(data.Msg); |
|
|
|
}, |
|
|
|
fail: function () { |
|
|
|
$('#calc').attr('disabled', false); |
|
|
|
alert("Error fetching data"); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |