|
|
@ -2,7 +2,16 @@ |
|
|
|
$(document).ready(function () { |
|
|
|
$("#branchRequired").hide(); |
|
|
|
|
|
|
|
$(document).on("change", "#" + mId + "receiverMobileNumber", function () { |
|
|
|
var isValid = CheckForMobileNumber(this, "Mobile No."); |
|
|
|
if (isValid === false) { |
|
|
|
$(this).val(''); |
|
|
|
$(this).focus(); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
$("#searchCustomer").click(function () { |
|
|
|
ClearAllData(); |
|
|
|
$('#step2SendRemittance').hide(); |
|
|
|
$('#step2SendRemittanceAgreement').hide(); |
|
|
|
$('#signatureDiv').hide(); |
|
|
@ -34,7 +43,7 @@ $(document).ready(function () { |
|
|
|
$('#step2SendRemittanceSaveButton').show(); |
|
|
|
|
|
|
|
CustomerSignature(); |
|
|
|
ParseDDlDynamic(response, 'ddlBenedeciary', 'FULLNAME', 'RECEIVERID', 'Select Beneficiary') |
|
|
|
ParseDDlDynamic(response, 'ddlBenedeciary', 'FULLNAME', 'RECEIVERID', 'Select Beneficiary'); |
|
|
|
} |
|
|
|
else { |
|
|
|
alert(response[0].Msg); |
|
|
@ -59,6 +68,7 @@ $(document).ready(function () { |
|
|
|
} |
|
|
|
}); |
|
|
|
$("#" + mId + "ddlBenedeciary").on("change", function () { |
|
|
|
ClearAllData(); |
|
|
|
var benefeciaryId = $("#" + mId + "ddlBenedeciary").val(); |
|
|
|
if (benefeciaryId === null || benefeciaryId === '' || benefeciaryId === undefined) { |
|
|
|
return false; |
|
|
@ -78,6 +88,7 @@ $(document).ready(function () { |
|
|
|
$("#" + 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); |
|
|
@ -119,6 +130,7 @@ $(document).ready(function () { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
ShowHideAccountNo(); |
|
|
|
} |
|
|
|
else { |
|
|
|
alert(response[0].Msg); |
|
|
@ -129,7 +141,7 @@ $(document).ready(function () { |
|
|
|
}); |
|
|
|
$("#" + mId + "purpose").on("change", function () { |
|
|
|
let purposeValue = $("#" + mId + "purpose option:selected").val(); |
|
|
|
if (purposeValue == '11347') { |
|
|
|
if (purposeValue === '11347') { |
|
|
|
$("#purposeOtherDiv").show(); |
|
|
|
} else { |
|
|
|
$("#purposeOtherDiv").hide(); |
|
|
@ -137,10 +149,10 @@ $(document).ready(function () { |
|
|
|
}); |
|
|
|
$("#" + mId + "relationship").on("change", function () { |
|
|
|
let relationValue = $("#" + mId + "relationship option:selected").val(); |
|
|
|
if (relationValue == '11339') { |
|
|
|
$("#" + mId + "otherRelationDiv").show(); |
|
|
|
if (relationValue === '11339') { |
|
|
|
$("#otherRelationDiv").show(); |
|
|
|
} else { |
|
|
|
$("#" + mId + "otherRelationDiv").hide(); |
|
|
|
$("#otherRelationDiv").hide(); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
@ -218,15 +230,19 @@ $(document).ready(function () { |
|
|
|
}); |
|
|
|
|
|
|
|
$("#" + mId + "pMode").on('change', function () { |
|
|
|
ShowHideAccountNo(); |
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
function ShowHideAccountNo() { |
|
|
|
var pmode = $("#" + mId + "pMode").val(); |
|
|
|
if (pmode == "2") { |
|
|
|
if (pmode === "2") { |
|
|
|
$("#accountDiv").show(); |
|
|
|
} else { |
|
|
|
$("#accountDiv").hide(); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
function ResetAmountFields() { |
|
|
|
//Reset Fields
|
|
|
@ -619,14 +635,8 @@ function CommaFormatted(amount, amountMain) { |
|
|
|
else |
|
|
|
return amount; |
|
|
|
} |
|
|
|
function ClearCalculatedAmount() { |
|
|
|
$("#" + mId + "txtCollAmt").val(''); |
|
|
|
$("#" + mId + "lblSendAmt").val(0); |
|
|
|
$("#" + mId + "lblServiceChargeAmt").val(0); |
|
|
|
$("#" + mId + "lblExRate").val(0); |
|
|
|
$("#" + mId + "txtPayAmt").val(''); |
|
|
|
$("#" + mId + "customerRateFields").hide(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function checkdata(amt, obj) { |
|
|
|
if (amt > 0) |
|
|
|
CalculateTxn(amt, obj); |
|
|
@ -719,7 +729,7 @@ function CalculateTxn(amt, obj, isManualSc) { |
|
|
|
if (pCountry === "203" && payCurr === "USD") { |
|
|
|
if ((pMode === "1" && pAgent !== 2091) || (pMode !== "12" && pAgent !== 2091)) { |
|
|
|
alert('USD receiving is only allow for Door to Door'); |
|
|
|
ClearAmountFields(); |
|
|
|
ClearCalculatedAmount(); |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
@ -760,7 +770,7 @@ function ParseCalculateData(response, amtType) { |
|
|
|
var data = response; |
|
|
|
if (data[0].ErrCode === '1') { |
|
|
|
alert(data[0].Msg); |
|
|
|
ClearAmountFields(); |
|
|
|
ClearCalculatedAmount(); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
@ -886,4 +896,33 @@ 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); |
|
|
|
if (!test) { |
|
|
|
alert(fieldName + " Is Not Valid !"); |
|
|
|
nField.value = ""; |
|
|
|
return false |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |