frappe/frappe#478 fixes
This commit is contained in:
parent
7db7112d3f
commit
0cf531c8a6
@ -1 +1,10 @@
|
||||
[]
|
||||
[
|
||||
{
|
||||
"doctype": "Deduction Type",
|
||||
"deduction_name": "_Test Professional Tax"
|
||||
},
|
||||
{
|
||||
"doctype": "Deduction Type",
|
||||
"deduction_name": "_Test TDS"
|
||||
}
|
||||
]
|
@ -1 +1,12 @@
|
||||
[]
|
||||
[
|
||||
{
|
||||
"doctype": "Earning Type",
|
||||
"earning_name": "_Test Basic Salary",
|
||||
"taxable": "Yes"
|
||||
},
|
||||
{
|
||||
"doctype": "Earning Type",
|
||||
"earning_name": "_Test Allowance",
|
||||
"taxable": "Yes"
|
||||
}
|
||||
]
|
@ -17,8 +17,8 @@ class LeaveApproverIdentityError(frappe.ValidationError): pass
|
||||
from frappe.model.controller import DocListController
|
||||
class LeaveApplication(DocListController):
|
||||
def setup(self):
|
||||
if frappe.db.exists(self.doctype, self.name):
|
||||
self.previous_doc = frappe.get_doc(self.doctype, self.name)
|
||||
if not getattr(self, "__islocal", None) and frappe.db.exists(self.doctype, self.name):
|
||||
self.previous_doc = frappe.db.get_value(self.doctype, self.name, "*", as_dict=True)
|
||||
else:
|
||||
self.previous_doc = None
|
||||
|
||||
|
@ -23,10 +23,10 @@ class TestSalarySlip(unittest.TestCase):
|
||||
ss.insert()
|
||||
self.assertEquals(ss.total_days_in_month, 31)
|
||||
self.assertEquals(ss.payment_days, 30)
|
||||
self.assertEquals(ss.doclist[1].e_modified_amount, 14516.13)
|
||||
self.assertEquals(ss.doclist[2].e_modified_amount, 500)
|
||||
self.assertEquals(ss.doclist[3].d_modified_amount, 100)
|
||||
self.assertEquals(ss.doclist[4].d_modified_amount, 48.39)
|
||||
self.assertEquals(ss.earning_details[0].e_modified_amount, 14516.13)
|
||||
self.assertEquals(ss.earning_details[1].e_modified_amount, 500)
|
||||
self.assertEquals(ss.deduction_details[0].d_modified_amount, 100)
|
||||
self.assertEquals(ss.deduction_details[1].d_modified_amount, 48.39)
|
||||
self.assertEquals(ss.gross_pay, 15016.13)
|
||||
self.assertEquals(ss.net_pay, 14867.74)
|
||||
|
||||
@ -35,10 +35,10 @@ class TestSalarySlip(unittest.TestCase):
|
||||
ss.insert()
|
||||
self.assertEquals(ss.total_days_in_month, 30)
|
||||
self.assertEquals(ss.payment_days, 29)
|
||||
self.assertEquals(ss.doclist[1].e_modified_amount, 14500)
|
||||
self.assertEquals(ss.doclist[2].e_modified_amount, 500)
|
||||
self.assertEquals(ss.doclist[3].d_modified_amount, 100)
|
||||
self.assertEquals(ss.doclist[4].d_modified_amount, 48.33)
|
||||
self.assertEquals(ss.earning_details[0].e_modified_amount, 14500)
|
||||
self.assertEquals(ss.earning_details[1].e_modified_amount, 500)
|
||||
self.assertEquals(ss.deduction_details[0].d_modified_amount, 100)
|
||||
self.assertEquals(ss.deduction_details[1].d_modified_amount, 48.33)
|
||||
self.assertEquals(ss.gross_pay, 15000)
|
||||
self.assertEquals(ss.net_pay, 14851.67)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user