mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-22 11:44:11 +00:00
fix: consider opening asset values while calculating asset depreciation rate
(cherry picked from commit 9d0fe7aa56)
This commit is contained in:
@@ -790,14 +790,19 @@ class Asset(AccountsController):
|
|||||||
args.get("value_after_depreciation")
|
args.get("value_after_depreciation")
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
value = flt(args.get("expected_value_after_useful_life")) / flt(self.gross_purchase_amount)
|
value = flt(args.get("expected_value_after_useful_life")) / (
|
||||||
|
flt(self.gross_purchase_amount) - flt(self.opening_accumulated_depreciation)
|
||||||
|
)
|
||||||
|
|
||||||
depreciation_rate = math.pow(
|
depreciation_rate = math.pow(
|
||||||
value,
|
value,
|
||||||
1.0
|
1.0
|
||||||
/ (
|
/ (
|
||||||
(
|
(
|
||||||
flt(args.get("total_number_of_depreciations"), 2)
|
(
|
||||||
|
flt(args.get("total_number_of_depreciations"), 2)
|
||||||
|
- flt(self.opening_number_of_booked_depreciations)
|
||||||
|
)
|
||||||
* flt(args.get("frequency_of_depreciation"))
|
* flt(args.get("frequency_of_depreciation"))
|
||||||
)
|
)
|
||||||
/ 12
|
/ 12
|
||||||
|
|||||||
Reference in New Issue
Block a user