# Appraisal total score (Out of 100)

In Appraisal Total Score, Just now its in Out of 5, but i want out of 100 also.

its should be calculate from (Out of 5 score):

1. eg: employee A score 3.5. now it should be converted to OUT of 100
(3.5*100)/5 = 70.

is this is correct way.

1. i don’t know how to write script in .js and .py to put about calculation. Below is my form.

in Total filed i want to show (Out of 100) score.

@kinzang, You can add a custom field `score(0-100)` to the child table to store the score out of 100 and add a custom script which would calculate the score on the basis of value entered in the `score(0-5)` field.

And, add another `total_score` field which would show you the total score on the basis of the `score(0-100)` in the child table.

Thanks @shreya115, but i want both (Out of 5) and (Out of 100). Just i want, Total score in (Out of 100), below (Total score Out of 5 field). don’t want to change Score(0-5) and Score Earned. Can you help me to write script.

@kinzang, You will have to add two fields in the child table, one which would show the score out of 100 on the basis of score out of 5. Another, which would show you the earned scores out of 100 on the basis of weightage. The total field in the form is based on the scores earned. So, the summation of the earned scores out of 100 will show you the total out of 100.

You can refer this file to write your custom script as per the custom fields you add.

can i do without add earned score out of 100. just directly calculate from (Total score (Out of 5))

formula: (Total score(Out of 5)/5)*100.
eg: below screen short example:

1. Total score (Out of 5) is 3.5
calculation: 3.5/5=0.7
= 0.7*100= 70

cur_frm.cscript.calculate_total = function (doc, cdn, cdt){

var total = flt(total_score/5)*100;
refresh_field(‘total’);

}

but there is no affect and Total is giving 0, as given in screen short

``````cur_frm.cscript.calculate_total = function(doc,cdt,cdn){
var val = doc.goals || [];
var total =0;
for(var i = 0; i<val.length; i++){
total = flt(total)+flt(val[i].score_earned);
}
doc.total_score = flt(total);
refresh_field('total_score');
var total1=parseFloat(parseFloat(total)*100)/(val.length*5)
doc.total=total1
refresh_field('total');
}
``````

Put This in Appraisal Custom Script

Thanks @Maheshwari_Bhavesh, But code dose not affect any things in page.

//added script for get total score out of 100

cur_frm.cscript.calculate_total = function (doc, cdn, cdt){
var val = doc.goals || [];
var total =0;
for(var i = 0; i<val.length; i++){
total = flt(total)+flt(val[i].score_earned);

``````}
doc.total_score = flt(total);
refresh_field('total_score');
var total1 = parseFloat(parseFloat(total_score)*100)/(val.length*5)
doc.total=total1;
efresh_field('total');
``````

}

cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) {
return{ query: “erpnext.controllers.queries.employee_query” }
}

erpnext/erpnext/doctype/appraisal/appraisal.js ???

-Search Custom Script in global search
-make new custom script
-select Appraisal in doctype
-put above code which i sent in script box
-save
-Go to Apprail Document Reload And Check

i have added in custom script but no effect on Appraisal page. still zero value in Total

total_score is working??

its working Total_score but not working Total

so i think your total field name is different please check that

above is customize form…

``````cur_frm.cscript.calculate_total = function(doc,cdt,cdn){
var val = doc.goals || [];
var total =0;
for(var i = 0; i<val.length; i++){
total = flt(total)+flt(val[i].score_earned);
}
doc.total_score = flt(total);
refresh_field('total_score');
var total1=parseFloat(parseFloat(total)*100)/(val.length*5)
doc.total=parseFloat(total1)
refresh_field('total');
``````

}

try it and check browser console it’s working for me…

Thanks all which have command on mu issue. finally i solved problem adding below code in js

doc.total_score1 = flt(total/5)*100;//this is for out of 100
refresh_field(‘total_score1’);