fix: pass correct argument to method get_deprication_amount

This commit is contained in:
Anurag Mishra 2019-03-07 16:17:00 +05:30
parent d4754619d0
commit 1b0f5fd430

View File

@ -255,7 +255,7 @@ class Asset(AccountsController):
def get_depreciation_amount(self, depreciable_value, total_number_of_depreciations, row):
percentage_value = 100.0 if row.depreciation_method == 'Written Down Value' else 200.0
factor = percentage_value / total_number_of_depreciations
factor = percentage_value / cint(total_number_of_depreciations)
depreciation_amount = flt(depreciable_value * factor / 100, 0)
value_after_depreciation = flt(depreciable_value) - depreciation_amount
@ -275,7 +275,7 @@ class Asset(AccountsController):
flt(row.expected_value_after_useful_life)) / (cint(row.total_number_of_depreciations) -
cint(self.number_of_depreciations_booked)) * prorata_temporis
else:
depreciation_amount = self.get_depreciation_amount(depreciable_value, row)
depreciation_amount = self.get_depreciation_amount(depreciable_value, row.total_number_of_depreciations, row)
return depreciation_amount