Merge pull request #8068 from rohitwaghchaure/asset_depreciation_issue

[fix] Precision issue during making of depreciation schedule
This commit is contained in:
Nabin Hait 2017-03-23 16:59:12 +05:30 committed by GitHub
commit c7dc838306

View File

@ -112,8 +112,8 @@ class Asset(Document):
def set_accumulated_depreciation(self):
accumulated_depreciation = flt(self.opening_accumulated_depreciation)
for d in self.get("schedules"):
accumulated_depreciation += flt(d.depreciation_amount)
d.accumulated_depreciation_amount = accumulated_depreciation
accumulated_depreciation += flt(d.depreciation_amount, d.precision("depreciation_amount"))
d.accumulated_depreciation_amount = flt(accumulated_depreciation, d.precision("accumulated_depreciation_amount"))
def get_depreciation_amount(self, depreciable_value):
if self.depreciation_method in ("Straight Line", "Manual"):