fixed get_server_values to make them utf-8 friendly

This commit is contained in:
Rushabh Mehta
2011-08-12 10:55:43 +05:30
parent b3453e6ed5
commit 89717292b7
36 changed files with 95 additions and 195 deletions

View File

@@ -26,7 +26,7 @@ class DocType:
emp_nm = sql("select employee_name from `tabEmployee` where name=%s", self.doc.employee)
emp_nm= emp_nm and emp_nm[0][0] or ''
self.doc.employee_name = emp_nm
return cstr(emp_nm)
return emp_nm
def fetch_kra(self):
if not self.doc.kra_template:
@@ -88,7 +88,7 @@ class DocType:
if d.score:
total = total + flt(d.score_earned)
ret={'total_score':flt(total)}
return cstr(ret)
return ret
def declare_completed(self):
ret={}

View File

@@ -34,7 +34,7 @@ class DocType:
set(self.doc, 'employee_name', emp_nm and emp_nm[0][0] or '')
ret = { 'employee_name' : emp_nm and emp_nm[0][0] or ''}
return str(ret)
return ret
#validation for duplicate record
def validate_duplicate_record(self):

View File

@@ -41,7 +41,7 @@ class DocType:
if self.doc.date_of_birth:
dt = getdate(self.doc.date_of_birth) + datetime.timedelta(21915)
ret = {'date_of_retirement': dt.strftime('%Y-%m-%d')}
return str(ret)
return ret
# check if salary structure exists
#========================================================================================================

View File

@@ -66,7 +66,7 @@ class DocType:
'carry_forwarded_leaves' : prev_bal,
'total_leaves_allocated' : flt(prev_bal) + flt(self.doc.new_leaves_allocated)
}
return str(ret)
return ret
# ********************************************** validate *****************************************************

View File

@@ -42,7 +42,7 @@ class DocType:
'grade' : cstr(det[0][4]),
'backup_employee': cstr(self.doc.employee)
}
return cstr(ret)
return ret
# Set Salary structure field values
@@ -53,7 +53,7 @@ class DocType:
'bank_ac_no' : basic_info and basic_info[0][1] or '',
'esic_no' : basic_info and basic_info[0][2] or '',
'pf_no' : basic_info and basic_info[0][3] or ''}
return cstr(ret)
return ret
# Make earning and deduction table
#---------------------------------------------------------