var loan = { init:function(){ $("#calculate").bind({ "click":function(){ loan.displayBasic(); } }); }, dataArr:[], displayDetail:function(){ var P = $.url().param('p'); var R = $.url().param('r')/100; var HFR = $.url().param('hfr')/100; var period = $.url().param('period'); var cd = $.url().param('cd'); if(P&&R&&period&&HFR) { P = parseFloat(P); NUM_OF_TERM = parseFloat(period); var handlingFee = 0; handlingFee = P * HFR * NUM_OF_TERM / 12; //old handling fee calculation // if(NUM_OF_TERM<=6){ // if(cd=='1A'){ // handlingFee = P * handlingFeeFactor / 2; // }else{ // handlingFee = P * handlingFeeFactor; // } // } // else // handlingFee = P * (NUM_OF_TERM/12) * handlingFeeFactor; monthlyInstallmentAmount = loan.calMonthlyInstallmentAmount(P,handlingFee,R,NUM_OF_TERM,cd); if(cd=='1A'){ monthlyInstallmentAmount = extraMath.ceil2D(monthlyInstallmentAmount); }else{ monthlyInstallmentAmount = extraMath.ceil2D(Math.round(monthlyInstallmentAmount * 1000) / 1000); } totalInterest = loan.calTotalInterest(P,handlingFee,R,NUM_OF_TERM,cd); totalTerm = NUM_OF_TERM * (NUM_OF_TERM+1) /2; if(cd=='1A'){ totalRepaymentAmount = P + totalInterest; lastMonthlyInstallmentAmount = (loan.calTotalInterest(P,handlingFee,R,period,cd) + P) - (monthlyInstallmentAmount*(NUM_OF_TERM-1)); }else{ totalRepaymentAmount = P + handlingFee + totalInterest; lastMonthlyInstallmentAmount = (loan.calTotalInterest(P,handlingFee,R,period,cd) + P + handlingFee) - (monthlyInstallmentAmount*(NUM_OF_TERM-1)); } for(i=0;i'+loanDisplayText.RepaymentSchedule[lang]+''); } }, calTotalInterest:function(P,handlingFee,R,period,cd){ if(cd=='1A') return P * R * period; else return (P + handlingFee) * R * period; }, calMonthlyInstallmentAmount:function(P,handlingFee,R,period,cd){ if(cd=='1A') return (loan.calTotalInterest(P,handlingFee,R,period,cd) + P )/period; else return (loan.calTotalInterest(P,handlingFee,R,period,cd) + P + handlingFee)/period; }, genTable:function(arr){ var tempTable = ""; tempTable += ""; tempTable += ""; tempTable += ''; tempTable += '"; tempTable += '"; tempTable += '"; tempTable += ""; for(i=0;i"; for(j=0;j"; tempTable += ""; } tempTable += "
'+loanDisplayText.Term[lang]+''+loanDisplayText.MonthlyLoanAmountHandling[lang]+"'+loanDisplayText.MonthlyInterestPayment[lang]+"'+loanDisplayText.CorrespondingInstallmentAmount[lang]+"
"; return tempTable; }, formCheck:function(){ var check = true; var errorText = ""; if($("#p").val().trim()=="") errorText += "- "+loanDisplayText.InputLoanAmount[lang]+"\n"; else if(isNaN($("#p").val())) errorText += "- "+loanDisplayText.InvalidLoanAmount[lang]+"\n"; else if($("#p").val() < 1000 || $("#p").val() > 9999999) errorText += "- "+loanDisplayText.InvalidLoanAmountRange[lang]+"\n"; if($("#period").val().trim()=="") errorText += "- "+loanDisplayText.InputLoanTenor[lang]+"\n"; else if(isNaN($("#period").val())) errorText += "- "+loanDisplayText.InvalidLoanTenor[lang]+"\n"; else if($("#period").val() < 1 || $("#period").val() > 999) errorText += "- "+loanDisplayText.InvalidLoanTenorRange[lang]+"\n"; if($("#r").val().trim()=="") errorText += "- "+loanDisplayText.InputMonthlyFlatRate[lang]+"\n"; else if(isNaN($("#r").val())) errorText += "- "+loanDisplayText.InvalidMonthlyFlatRate[lang]+"\n"; else if($("#r").val() <= 0 || $("#r").val() > 2) errorText += "- "+loanDisplayText.InvalidMonthlyFlatRateRange[lang]+"\n"; if($("#hfr").val().trim()=="") errorText += "- "+loanDisplayText.InputHandlingFeeRate[lang]+"\n"; else if(isNaN($("#hfr").val())) errorText += "- "+loanDisplayText.InputHandlingFeeRate[lang]+"\n"; else if($("#hfr").val() <= 0 || $("#hfr").val() > 15) errorText += "- "+loanDisplayText.InvalidHandlingFeeRateRange[lang]+"\n"; if(errorText) { errorText = errorText; check = false; alert(errorText) } return check; } }; var loanDisplayText = { index:function(cd){ $("#header").html(''); $(".LoanAmount").text(loanDisplayText.LoanAmount[lang]); $(".LoanTenor").text(loanDisplayText.LoanTenor[lang]); $(".MonthlyFlatRate").text(loanDisplayText.MonthlyFlatRate[lang]); $(".HandlingFeeRate").text(loanDisplayText.HandlingFeeRate[lang]); $("#calculate").val(loanDisplayText.Calculate[lang]); $("#clear").val(loanDisplayText.Clear[lang]); $(".CalculationResult").text(loanDisplayText.CalculationResult[lang]); $("#YourInput").text(loanDisplayText.YourInput[lang]); $("#HandlingFee").text(loanDisplayText.HandlingFee[lang]); $("#MonthlyInstallmentAmount").text(loanDisplayText.MonthlyInstallmentAmount[lang]); $("#TotalRepaymentAmount").text(loanDisplayText.TotalRepaymentAmount[lang]); $("#CloseBtn").html(''+loanDisplayText.CloseBtn[lang]+'') if(cd=='1A'){ $(".LoanHeader").text(loanDisplayText.LoanHeader_NEW[lang]); $("#note1").html(loanDisplayText.note1_NEW[lang]); }else{ $(".LoanHeader").text(loanDisplayText.LoanHeader_OLD[lang]); $("#note1").html(loanDisplayText.note1[lang]); } }, detail:function(cd){ $("#header").html(''); $(".LoanAmount").text(loanDisplayText.LoanAmount[lang]); $(".LoanTenor").text(loanDisplayText.LoanTenor[lang]); $(".MonthlyFlatRate").text(loanDisplayText.MonthlyFlatRate[lang]); $(".HandlingFeeRate").text(loanDisplayText.HandlingFeeRate[lang]); $("#HandlingFee").text(loanDisplayText.HandlingFee[lang]); $("#MonthlyInstallmentAmount").text(loanDisplayText.MonthlyInstallmentAmount[lang]); $("#TotalRepaymentAmount").text(loanDisplayText.TotalRepaymentAmount[lang]); if(cd=='1A'){ $(".LoanHeader").text(loanDisplayText.LoanHeader_NEW[lang]); $("#note1").html(loanDisplayText.note1_NEW[lang]); }else{ $(".LoanHeader").text(loanDisplayText.LoanHeader_OLD[lang]); $("#note1").html(loanDisplayText.note1[lang]); } }, LoanAmount:{ "en":"Loan Amount (HKD)", "tc":"貸款額 (港幣)", "sc":"贷款额 (港币)" }, LoanTenor:{ "en":"Loan Tenor (Months)", "tc":"還款期 (月)", "sc":"还款期 (月)" }, MonthlyFlatRate:{ "en":"Monthly Flat Rate (%)", "tc":"每月平息 (%)", "sc":"每月平息 (%)" }, Calculate:{ "en":"Calculate", "tc":"計算", "sc":"计算" }, Clear:{ "en":"Clear", "tc":"重新輸入", "sc":"重新输入" }, CalculationResult:{ "en":"Calculation Result", "tc":"計算結果", "sc":"计算结果" }, YourInput:{ "en":"Your Input", "tc":"你的資料", "sc":"你的资料" }, HandlingFee:{ "en":"Handling Fee (HKD)", "tc":"手續費 (港幣)", "sc":"手续费 (港币)" }, MonthlyInstallmentAmount:{ "en":"Monthly Installment Amount (HKD)", "tc":"每月還款金額 (港幣)", "sc":"每月还款金额 (港币)" }, TotalRepaymentAmount:{ "en":"Total Repayment Amount (HKD)", "tc":"總還款金額 (港幣)", "sc":"总还款金额 (港币)" }, RepaymentSchedule:{ "en":"Repayment Schedule", "tc":"還款表", "sc":"还款表" }, Term:{ "en":"No. of Installment", "tc":"還款期數", "sc":"还款期数" }, MonthlyLoanAmountHandling:{ "en":"Monthly Loan Principal Payment", "tc":"每月償還之本金金額", "sc":"每月偿还之本金金额" }, MonthlyInterestPayment:{ "en":"Monthly Interest Payment", "tc":"每月償還之利息金額", "sc":"每月偿还之利息金额" }, CorrespondingInstallmentAmount:{ "en":"Monthly Installment Amount", "tc":"每月還款金額", "sc":"每月还款金额 " }, OutstandingBalance:{ "en":"Outstanding Balance", "tc":"本金餘額", "sc":"本金余额" }, InputLoanAmount:{ "en":"Please input the Loan Amount.", "tc":"請輸入貸款額。", "sc":"请输入贷款额。" }, InputLoanTenor:{ "en":"Please input the Loan Tenor.", "tc":"請輸入還款期。", "sc":"请输入还款期。" }, InputMonthlyFlatRate:{ "en":"Please input the Monthly Flat Rate.", "tc":"請輸入每月平息。", "sc":"请输入每月平息。" }, InvalidLoanAmount:{ "en":"The amount you inputted is invalid. Please re-enter.", "tc":"你所輸入的貸款額不正確,請重新輸入。", "sc":"你所输入的贷款额不正确,请重新输入。" }, InvalidLoanTenor:{ "en":"The tenor you inputted is invalid. Please re-enter.", "tc":"你所輸入的還款期不正確,請重新輸入。", "sc":"你所输入的还款期不正确,请重新输入。" }, InvalidMonthlyFlatRate:{ "en":"The rate you inputted is invalid. Please re-enter.", "tc":"你所輸入的每月平息不正確,請重新輸入。", "sc":"你所输入的每月平息不正确,请重新输入。" }, InvalidLoanAmountRange:{ "en":"Loan Amount must be between 1,000 to 9,999,999.", "tc":"貸款額須在1,000至9,999,999內。", "sc":"贷款额须在1,000至9,999,999内。" }, InvalidLoanTenorRange:{ "en":"Loan Tenor must be between 1 to 999.", "tc":"還款期數值須在1至999內。", "sc":"还款期数值须在1至999内。" }, InvalidMonthlyFlatRateRange:{ "en":"Monthly flat rate must be between 0 and 2.", "tc":"每月平息須大於0和不大於2。", "sc":"每月平息须大于0和不大于2。" }, note1:{ "en":"Note: (1) The calculation is based on the information provided by customer and the calculator result is for reference only. (2) The handling fee is included in the Monthly Loan Principal Payment. (3) Customer needs to be aware that early loan settlement handling fee, the entire outstanding Loan Principal (including unpaid Handling Fee) and interest up to the next repayment date are involved in early loan settlement. For details, please refer to Key Facts Statement for Installment Loan. The loan principal and interest are apportioned according to the Rule of 78, under which, the proportion of interest in each monthly repayment decreases gradually throughout the loan tenor. Please check with the Bank about the total amount involved before deciding to make early repayment.", "tc":"註: (1) 以上的計算結果是根據客戶提供之資料計算及只供參考。(2) 每月償還之本金金額已包括手續費。(3)提前清還貸款須支付提早償還貸款手續費、整筆結欠貸款本金(包括未繳手續費)及截至下一個月還款日的利息,詳情請參閱現時的分期貸款產品資料概要。 貸款本金及利息以「78法則」 按月攤分,而其中的利息在毎月還款金額所佔之比重會隨還款期數而遞減。因此,建議客戶應先向本行查詢提前還款的總金額及考慮所涉及的手續費,才決定是否選擇提前還款。", "sc":"注: (1) 以上的计算结果是根据客户提供之资料计算及只供参考。(2) 每月偿还之本金金额已包括手续费。(3)提前清还贷款须支付提早偿还贷款手续费、整笔结欠贷款本金(包括未缴手续费)及截至下一个月还款日的利息,详情请参阅现时的分期贷款产品资料概要。 贷款本金及利息以「78法则」 按月摊分,而其中的利息在毎月还款金额所占之比重会随还款期数而递减。因此,建议客户应先向本行查询提前还款的总金额及考虑所涉及的手续费,才决定是否选择提前还款。" }, note1_NEW:{ "en":"Note: (1) The calculation is based on the information provided by customer and the calculator result is for reference only. (2) The Bank will deduct the handling fee from the approved loan amount and then credit the remaining amount to the Customer’s designated account. (3) Customer needs to be aware that early loan settlement handling fee, the entire outstanding Loan Amount (including any arrears but less the portion for payment of the Handling Fee) and interest up to the next repayment date are involved in early loan settlement. For details, please refer to Key Facts Statement for Installment Loan. The loan principal and interest are apportioned according to the Rule of 78, under which, the proportion of interest in each monthly repayment decreases gradually throughout the loan tenor. Please check with the Bank about the total amount involved before deciding to make early repayment.", "tc":"註: (1) 以上的計算結果是根據客戶提供之資料計算及只供參考。(2) 銀行將從批核的貸款金額內扣除手續費 ,始將餘款存入客戶之指定戶口。(3)提前清還貸款須支付提早償還貸款手續費、整筆結欠貸款金額(包括扣除手續費部份之後之已到期欠款)及截至下一個月還款日的利息,詳情請參閱現時的分期貸款產品資料概要。 貸款本金及利息以「78法則」 按月攤分,而其中的利息在毎月還款金額所佔之比重會隨還款期數而遞減。因此,建議客戶應先向本行查詢提前還款的總金額及考慮所涉及的手續費,才決定是否選擇提前還款。", "sc":"注: (1) 以上的计算结果是根据客户提供之资料计算及只供参考。 (2) 银行将从批核的贷款金额内扣除手续费 ,始将余款存入客户之指定户口。 (3)提前清还贷款须支付提早偿还贷款手续费、整笔结欠贷款金额(包括扣除手续费部份之后之已到期欠款)及截至下一个月还款日的利息,详情请参阅现时的分期贷款产品资料概要。 贷款本金及利息以「78法则」 按月摊分,而其中的利息在毎月还款金额所占之比重会随还款期数而递减。因此,建议客户应先向本行查询提前还款的总金额及考虑所涉及的手续费,才决定是否选择提前还款。" }, CloseBtn:{ "en":"Close", "tc":"關閉", "sc":"关闭" }, CloseBtnLink:{ "en":"https://ibanking.cncbinternational.com/CKWPortal/resources/personal/common/winclose.html", "tc":"https://ibanking.cncbinternational.com/CKWPortal/resources/personal/common/winclose.html", "sc":"https://ibanking.cncbinternational.com/CKWPortal/resources/personal/common/winclose.html" }, LoanHeader_OLD:{ "en":"Dollar$mart Personal Loan Calculator", "tc":"Dollar$mart 私人貸款計算機", "sc":"Dollar$mart 私人贷款计算机" }, LoanHeader_NEW:{ "en":"$mart Plus Personal Loan Calculator", "tc":"$mart Plus 私人貸款計算機", "sc":"$mart Plus 私人贷款计算机" }, HandlingFeeRate:{ "en":"Handling Fee (%)", "tc":"手續費 (%)", "sc":"手续费 (%)" }, InputHandlingFeeRate:{ "en":"Please input the Handling Fee (%).", "tc":"請輸入手續費 (%)。", "sc":"请输入手续费 (%)。" }, InvalidHandlingFeeRateRange:{ "en":"Handling Fee (%) must be between 0 to 15.", "tc":"手續費 (%)須在0至15內。", "sc":"手续费 (%)须在0至15内。" }, };