fix: Null handling

This commit is contained in:
Nabin Hait 2019-05-01 10:59:02 +05:30
parent a08bf7ef86
commit 5762a5d8b6

View File

@ -577,8 +577,8 @@ class SalarySlip(TransactionBase):
def calculate_variable_tax(self, tax_component, payroll_period): def calculate_variable_tax(self, tax_component, payroll_period):
annual_taxable_earning, period_factor = 0, 0 annual_taxable_earning, period_factor = 0, 0
pro_rata_tax_paid, additional_tax_paid, benefit_tax_paid = 0, 0, 0 pro_rata_tax_paid, additional_tax_paid, benefit_tax_paid = 0.0, 0.0, 0.0
unclaimed_earning, unclaimed_benefit, additional_income = 0, 0, 0 unclaimed_earning, unclaimed_benefit, additional_income = 0.0, 0.0, 0.0
# get taxable_earning, additional_income in this slip # get taxable_earning, additional_income in this slip
taxable_earning = self.get_taxable_earnings() taxable_earning = self.get_taxable_earnings()
@ -690,7 +690,7 @@ class SalarySlip(TransactionBase):
"from_date": from_date, "from_date": from_date,
"to_date": self.start_date "to_date": self.start_date
}) })
return sum_additional_earning[0][0] if sum_additional_earning else 0 return flt(sum_additional_earning[0][0]) if sum_additional_earning else 0
def get_tax_paid_in_period(self, payroll_period, tax_component, only_total=False): def get_tax_paid_in_period(self, payroll_period, tax_component, only_total=False):
# find total_tax_paid, tax paid for benefit, additional_salary # find total_tax_paid, tax paid for benefit, additional_salary