Merge branch 'develop' into develop

This commit is contained in:
Deepesh Garg 2020-07-04 18:28:06 +05:30 committed by GitHub
commit 4993ab5191
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 7 deletions

View File

@ -79,10 +79,12 @@ class TestLoan(unittest.TestCase):
"qty": 4000.00,
}]
loan_application = create_loan_application('_Test Company', self.applicant2, 'Stock Loan', pledge, "Repay Over Number of Periods", 12)
loan_application = create_loan_application('_Test Company', self.applicant2,
'Stock Loan', pledge, "Repay Over Number of Periods", 12)
create_pledge(loan_application)
loan = create_loan_with_security(self.applicant2, "Stock Loan", "Repay Over Number of Periods", 12, loan_application)
loan = create_loan_with_security(self.applicant2, "Stock Loan", "Repay Over Number of Periods",
12, loan_application)
self.assertEquals(loan.loan_amount, 1000000)
def test_loan_disbursement(self):
@ -92,6 +94,7 @@ class TestLoan(unittest.TestCase):
}]
loan_application = create_loan_application('_Test Company', self.applicant2, 'Stock Loan', pledge, "Repay Over Number of Periods", 12)
create_pledge(loan_application)
loan = create_loan_with_security(self.applicant2, "Stock Loan", "Repay Over Number of Periods", 12, loan_application)
@ -217,7 +220,8 @@ class TestLoan(unittest.TestCase):
"qty": 2000.00
}]
loan_application = create_loan_application('_Test Company', self.applicant2, 'Stock Loan', pledges)
loan_application = create_loan_application('_Test Company', self.applicant2, 'Stock Loan', pledges,
"Repay Over Number of Periods", 12)
create_pledge(loan_application)
loan = create_loan_with_security(self.applicant2, "Stock Loan", "Repay Over Number of Periods", 12, loan_application,
@ -247,7 +251,9 @@ class TestLoan(unittest.TestCase):
"haircut": 50,
}]
loan_application = create_loan_application('_Test Company', self.applicant2, 'Stock Loan', pledges)
loan_application = create_loan_application('_Test Company', self.applicant2,
'Stock Loan', pledges, "Repay Over Number of Periods", 12)
create_pledge(loan_application)
loan = create_loan_with_security(self.applicant2, "Stock Loan", "Repay Over Number of Periods", 12, loan_application)

View File

@ -105,7 +105,7 @@ class TestSalarySlip(unittest.TestCase):
#Gross pay calculation based on attendances
gross_pay = 78000 - ((78000 / (days_in_month - no_of_holidays)) * flt(ss.leave_without_pay))
self.assertEqual(ss.gross_pay, gross_pay)
self.assertEqual(flt(ss.gross_pay, 2), flt(gross_pay, 2))
frappe.db.set_value("Payroll Settings", None, "payroll_based_on", "Leave")

View File

@ -11,14 +11,17 @@ def update_itemised_tax_data(doc):
for row in doc.items:
tax_rate = 0.0
item_tax_rate = frappe.parse_json(row.item_tax_rate)
item_tax_rate = 0.0
if row.item_tax_rate:
item_tax_rate = frappe.parse_json(row.item_tax_rate)
# First check if tax rate is present
# If not then look up in item_wise_tax_detail
if item_tax_rate:
for account, rate in iteritems(item_tax_rate):
tax_rate += rate
elif itemised_tax.get(row.item_code):
elif row.item_code and itemised_tax.get(row.item_code):
tax_rate = sum([tax.get('tax_rate', 0) for d, tax in itemised_tax.get(row.item_code).items()])
row.tax_rate = flt(tax_rate, row.precision("tax_rate"))