Help for configuring the calculation on client scripts

Are Kaveri
Tera Contributor

I have below requirement for service portal.

there is a Issuance of Loan eligilibilty for one of the portal form.

 

i am not understanding how to calculate below .

Loan amount to be issued =((Basic pay*17% + HRA) *12) *(15 years or number of years) 

 

I am not understanding how to calculate above calculation using catalog client script.

 

anyone has achieved similar requirement ? Please share it will be helpfull

1 REPLY 1

Sandeep Rajput
Tera Patron
Tera Patron

@Are Kaveri If you have variables representing Basic pay, HRA and number of years then simply it is a matter of multiplying the numbers in the catalog client script.

//Calculation

Loan amount to be issued =((Basic pay*17% + HRA) *12) *(15 years or number of years) 
var basicPay = g_form.getValue('basic_pay');
var hra = g_form.getValue('hra');
var number_of_years = g_form.getValue('number_of_years')?g_form.getValue('number_of_years'):15; //if the field number_of_years is empty then consider 15
var loanAmount = ((basicPay*17)/100+hra)*12*number_of_years;

 

Hope this helps.