fix(asset): incorrect date difference calculation (#26805)

This commit is contained in:
Saqib
2021-08-10 16:37:23 +05:30
committed by GitHub
parent 793063bf4e
commit 363225d2ba
2 changed files with 6 additions and 6 deletions

View File

@@ -851,7 +851,7 @@ def get_depreciation_amount(asset, depreciable_value, row):
# if its the first depreciation
if depreciable_value == asset.gross_purchase_amount:
# as per IT act, if the asset is purchased in the 2nd half of fiscal year, then rate is divided by 2
diff = date_diff(asset.available_for_use_date, row.depreciation_start_date)
diff = date_diff(row.depreciation_start_date, asset.available_for_use_date)
if diff <= 180:
rate_of_depreciation = rate_of_depreciation / 2
frappe.msgprint(