Appraisal score allowed to be fraction

This commit is contained in:
Nabin Hait 2011-09-22 11:00:53 +05:30
parent fdb0e362a7
commit e8475f9b85
4 changed files with 262 additions and 285 deletions

View File

@ -123,6 +123,11 @@ cur_frm.cscript['Declare Completed'] = function(doc,cdt,cdn){
cur_frm.cscript.score = function(doc,cdt,cdn){
var d = locals[cdt][cdn];
if (d.score){
if (flt(d.score) > 5) {
msgprint("Score must be less than or equal to 5");
d.score = 0;
refresh_field('score', d.name, 'appraisal_details');
}
total = flt(d.per_weightage*d.score)/100;
d.score_earned = total.toPrecision(2);
refresh_field('score_earned', d.name, 'appraisal_details');

View File

@ -56,6 +56,7 @@ class DocType:
msgprint("Target achieved or Score can be added only by Appraisal Approver")
raise Exception
def validate_fiscal_year(self):
fy=sql("select year_start_date from `tabFiscal Year` where name='%s'"%self.doc.fiscal_year)
ysd=fy and fy[0][0] or ""

View File

@ -5,16 +5,17 @@
{
'creation': '2010-09-01 15:48:05',
'docstatus': 0,
'modified': '2011-06-27 14:39:10',
'modified': '2011-09-22 10:59:43',
'modified_by': 'Administrator',
'owner': 'ashwini@webnotestech.com'
},
# These values are common for all DocType
{
'_last_update': '1308808105',
'_last_update': '1316075905',
'autoname': 'APRSL.#####',
'colour': 'White:FFF',
'default_print_format': 'Standard',
'doctype': 'DocType',
'module': 'HR',
'name': '__common__',
@ -22,7 +23,7 @@
'section_style': 'Simple',
'server_code_error': ' ',
'show_in_menu': 0,
'version': 160
'version': 161
},
# These values are common for all DocField
@ -56,7 +57,6 @@
'cancel': 1,
'create': 1,
'doctype': 'DocPerm',
'idx': 1,
'permlevel': 0,
'role': 'System Manager',
'submit': 1,
@ -66,7 +66,6 @@
# DocPerm
{
'doctype': 'DocPerm',
'idx': 2,
'permlevel': 1,
'role': 'System Manager'
},
@ -77,7 +76,6 @@
'cancel': 1,
'create': 1,
'doctype': 'DocPerm',
'idx': 3,
'permlevel': 0,
'role': 'System Manager',
'submit': 1,
@ -87,7 +85,6 @@
# DocPerm
{
'doctype': 'DocPerm',
'idx': 4,
'permlevel': 1,
'role': 'System Manager'
},
@ -98,7 +95,6 @@
'cancel': 1,
'create': 1,
'doctype': 'DocPerm',
'idx': 5,
'permlevel': 0,
'role': 'HR Manager',
'submit': 1,
@ -111,7 +107,6 @@
'cancel': 1,
'create': 1,
'doctype': 'DocPerm',
'idx': 6,
'permlevel': 0,
'role': 'HR User',
'submit': 1,
@ -121,7 +116,6 @@
# DocPerm
{
'doctype': 'DocPerm',
'idx': 7,
'permlevel': 1,
'role': 'HR Manager'
},
@ -129,7 +123,6 @@
# DocPerm
{
'doctype': 'DocPerm',
'idx': 8,
'permlevel': 1,
'role': 'HR User'
},
@ -138,7 +131,6 @@
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 1,
'label': 'Employee Details',
'oldfieldtype': 'Section Break',
'permlevel': 0
@ -151,9 +143,9 @@
'doctype': 'DocField',
'fieldname': 'status',
'fieldtype': 'Select',
'idx': 2,
'in_filter': 1,
'label': 'Status',
'no_copy': 1,
'oldfieldname': 'status',
'oldfieldtype': 'Select',
'options': '\nDraft\nSubmitted\nCompleted\nCancelled',
@ -168,7 +160,6 @@
'doctype': 'DocField',
'fieldname': 'employee',
'fieldtype': 'Link',
'idx': 3,
'in_filter': 1,
'label': 'Employee',
'oldfieldname': 'employee',
@ -185,7 +176,6 @@
'doctype': 'DocField',
'fieldname': 'employee_name',
'fieldtype': 'Data',
'idx': 4,
'in_filter': 1,
'label': 'Employee Name',
'oldfieldname': 'employee_name',
@ -198,7 +188,6 @@
'doctype': 'DocField',
'fieldname': 'fiscal_year',
'fieldtype': 'Select',
'idx': 5,
'in_filter': 1,
'label': 'Fiscal Year',
'oldfieldname': 'fiscal_year',
@ -213,7 +202,6 @@
'doctype': 'DocField',
'fieldname': 'company',
'fieldtype': 'Select',
'idx': 6,
'in_filter': 1,
'label': 'Company',
'oldfieldname': 'company',
@ -227,7 +215,6 @@
{
'doctype': 'DocField',
'fieldtype': 'Column Break',
'idx': 7,
'oldfieldtype': 'Column Break',
'permlevel': 0,
'width': '50%'
@ -238,7 +225,6 @@
'doctype': 'DocField',
'fieldname': 'start_date',
'fieldtype': 'Date',
'idx': 8,
'in_filter': 1,
'label': 'Start Date',
'oldfieldname': 'start_date',
@ -252,7 +238,6 @@
'doctype': 'DocField',
'fieldname': 'end_date',
'fieldtype': 'Date',
'idx': 9,
'in_filter': 1,
'label': 'End Date',
'oldfieldname': 'end_date',
@ -267,7 +252,6 @@
'doctype': 'DocField',
'fieldname': 'kra_approver',
'fieldtype': 'Select',
'idx': 10,
'in_filter': 0,
'label': 'Approver',
'oldfieldname': 'kra_approver',
@ -282,7 +266,6 @@
'fieldname': 'amended_from',
'fieldtype': 'Data',
'hidden': 1,
'idx': 11,
'label': 'Amended From',
'no_copy': 1,
'oldfieldname': 'amended_from',
@ -299,7 +282,6 @@
'fieldname': 'amendment_date',
'fieldtype': 'Date',
'hidden': 1,
'idx': 12,
'label': 'Amendment Date',
'no_copy': 1,
'oldfieldname': 'amendment_date',
@ -316,7 +298,6 @@
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldtype': 'Button',
'idx': 13,
'label': 'Declare Completed',
'oldfieldtype': 'Button',
'permlevel': 0,
@ -327,7 +308,6 @@
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 14,
'oldfieldtype': 'Section Break',
'options': 'Simple',
'permlevel': 0
@ -340,7 +320,6 @@
'doctype': 'DocField',
'fieldname': 'kra_template',
'fieldtype': 'Link',
'idx': 15,
'label': 'KRA Template',
'oldfieldname': 'kra_template',
'oldfieldtype': 'Link',
@ -352,7 +331,6 @@
{
'doctype': 'DocField',
'fieldtype': 'Button',
'idx': 16,
'label': 'Fetch Template',
'oldfieldtype': 'Button',
'options': 'fetch_kra',
@ -366,7 +344,6 @@
'doctype': 'DocField',
'fieldtype': 'Button',
'hidden': 1,
'idx': 17,
'label': 'Update',
'oldfieldtype': 'Button',
'permlevel': 0,
@ -380,7 +357,6 @@
'doctype': 'DocField',
'fieldname': 'appraisal_details',
'fieldtype': 'Table',
'idx': 18,
'label': 'Appraisal Details',
'oldfieldname': 'appraisal_details',
'oldfieldtype': 'Table',
@ -393,7 +369,6 @@
'allow_on_submit': 1,
'doctype': 'DocField',
'fieldtype': 'Button',
'idx': 19,
'label': 'Calculate Total Score',
'oldfieldtype': 'Button',
'options': 'calculate_total',
@ -405,8 +380,7 @@
'doctype': 'DocField',
'fieldname': 'total_score',
'fieldtype': 'Currency',
'idx': 20,
'label': 'Total Score',
'label': 'Total Score (Out of 5)',
'no_copy': 1,
'oldfieldname': 'total_score',
'oldfieldtype': 'Currency',

View File

@ -5,8 +5,8 @@
{
'creation': '2010-09-01 15:48:05',
'docstatus': 0,
'modified': '2010-09-20 14:06:57',
'modified_by': 'rahul@webnotestech.com',
'modified': '2011-09-22 10:45:37',
'modified_by': 'Administrator',
'owner': 'ashwini@webnotestech.com'
},
@ -14,13 +14,14 @@
{
'autoname': 'APRSLD.#####',
'colour': 'White:FFF',
'default_print_format': 'Standard',
'doctype': 'DocType',
'istable': 1,
'module': 'HR',
'name': '__common__',
'section_style': 'Simple',
'server_code_error': ' ',
'version': 13
'version': 15
},
# These values are common for all DocField
@ -45,7 +46,6 @@
'doctype': 'DocField',
'fieldname': 'kra',
'fieldtype': 'Small Text',
'idx': 1,
'label': 'KRA',
'oldfieldname': 'kra',
'oldfieldtype': 'Small Text',
@ -58,7 +58,6 @@
'doctype': 'DocField',
'fieldname': 'per_weightage',
'fieldtype': 'Currency',
'idx': 2,
'label': 'Weightage (%)',
'oldfieldname': 'per_weightage',
'oldfieldtype': 'Currency',
@ -72,7 +71,6 @@
'doctype': 'DocField',
'fieldname': 'target_achieved',
'fieldtype': 'Small Text',
'idx': 3,
'label': 'Target Achieved',
'no_copy': 1,
'oldfieldname': 'target_achieved',
@ -86,15 +84,15 @@
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'score',
'fieldtype': 'Select',
'idx': 4,
'fieldtype': 'Currency',
'label': 'Score (0-5)',
'no_copy': 1,
'oldfieldname': 'score',
'oldfieldtype': 'Select',
'options': '\n0\n1\n2\n3\n4\n5',
'permlevel': 0,
'trigger': 'Client'
'trigger': 'Client',
'width': '60px'
},
# DocField
@ -102,7 +100,6 @@
'doctype': 'DocField',
'fieldname': 'score_earned',
'fieldtype': 'Currency',
'idx': 5,
'label': 'Score Earned',
'no_copy': 1,
'oldfieldname': 'score_earned',