From 8c2618c27accc2fab77c1c84df132cb55d0f4413 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 2 Sep 2011 17:43:32 +0530 Subject: [PATCH 1/2] delete salary control panel and reload salary slip --- patches/patch.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/patches/patch.py b/patches/patch.py index 14d7c926cb..0c821842ae 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 353 +last_patch = 354 #------------------------------------------- @@ -290,3 +290,6 @@ def execute(patch_no): ch.save(1) elif patch_no == 353: reload_doc('hr', 'doctype', 'salary_manager') + elif patch_no == 354: + reload_doc('hr', 'doctype', 'salary_slip') + delete_doc('DocType', 'Salary Control Panel') From 343e10586b71957ea1a968ad64b2373303a3d411 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 2 Sep 2011 17:45:13 +0530 Subject: [PATCH 2/2] fixed sal slip email format --- hr/doctype/salary_slip/salary_slip.py | 69 ++++++++++++++------------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/hr/doctype/salary_slip/salary_slip.py b/hr/doctype/salary_slip/salary_slip.py index 6a1705054e..3a42dca806 100644 --- a/hr/doctype/salary_slip/salary_slip.py +++ b/hr/doctype/salary_slip/salary_slip.py @@ -182,24 +182,24 @@ class DocType(TransactionBase): earn_table = '' ded_table = '' if earn_ret: - earn_table += "" + earn_table += "
" for e in earn_ret: if not e[1]: - earn_table +=''%(cstr(e[0])) + earn_table +=''%(cstr(e[0])) else: - earn_table +=''%(cstr(e[0]),cstr(e[1])) + earn_table +=''%(cstr(e[0]),cstr(e[1])) earn_table += '
%s0.00
%s0.00
%s%s
%s%s
' if ded_ret: - ded_table += "" + ded_table += "
" for d in ded_ret: if not d[1]: - ded_table +=''%(cstr(d[0])) + ded_table +='%s'%(cstr(d[0])) else: - ded_table +=''%(cstr(d[0]),cstr(d[1])) + ded_table +=''%(cstr(d[0]),cstr(d[1])) ded_table += '
%s0.00
0.00
%s%s
%s%s
' letter_head = sql("select value from `tabSingles` where field = 'letter_head' and doctype = 'Control Panel'") @@ -210,57 +210,58 @@ class DocType(TransactionBase): msg = '''
%s
- + - - + + - - - -

Salary Slip

Salary Slip

Employee Code : %sEmployee Name : %sEmployee Code : %sEmployee Name : %s
Month : %sFiscal Year : %s
- - - - - + + - - - + + + + + + + + + + - - + +
Department : %sBranch : %sDesignation : %sMonth : %sFiscal Year : %s
Grade : %sBank Account No. : %sBank Name : %sDepartment : %sBranch : %s
Designation : %sGrade : %s
Bank Account No. : %sBank Name : %s
Arrear Amount : %sPayment days : %sArrear Amount : %sPayment days : %s
- +
- - + + - - + +
EarningDeductionEarningsDeductions
%s%s%s%s
- +
- - + + - + Net Pay : + - + -
Gross Pay : %sTotal Deduction : %sGross Pay : %sTotal Deduction : %s
Net Pay : %s%s
Net Pay(in words) : %sNet Pay(in words) : %s
'''%(cstr(letter_head[0][0]),cstr(self.doc.employee), cstr(self.doc.employee_name), cstr(self.doc.month), cstr(self.doc.fiscal_year), cstr(self.doc.department), cstr(self.doc.branch), cstr(self.doc.designation), cstr(self.doc.grade), cstr(self.doc.bank_account_no), cstr(self.doc.bank_name), cstr(self.doc.arrear_amount), cstr(self.doc.payment_days), earn_table, ded_table, cstr(self.doc.gross_pay), cstr(self.doc.total_deduction), cstr(self.doc.net_pay), cstr(self.doc.total_in_words)) + '''%(cstr(letter_head[0][0]),cstr(self.doc.employee), cstr(self.doc.employee_name), cstr(self.doc.month), cstr(self.doc.fiscal_year), cstr(self.doc.department), cstr(self.doc.branch), cstr(self.doc.designation), cstr(self.doc.grade), cstr(self.doc.bank_account_no), cstr(self.doc.bank_name), cstr(self.doc.arrear_amount), cstr(self.doc.payment_days), earn_table, ded_table, cstr(flt(self.doc.gross_pay)), cstr(flt(self.doc.total_deduction)), cstr(flt(self.doc.net_pay)), cstr(self.doc.total_in_words)) sendmail([receiver], sender='automail@erpnext.com', subject=subj, parts=[['text/plain', msg]]) else: msgprint("Company Email ID not found.")