mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-13 09:43:49 +00:00
fix(asset): prorata daily depr amount calculation
This commit is contained in:
@@ -1532,11 +1532,7 @@ def get_straight_line_or_manual_depr_amount(asset, row, schedule_idx, number_of_
|
|||||||
# if the Depreciation Schedule is being prepared for the first time
|
# if the Depreciation Schedule is being prepared for the first time
|
||||||
else:
|
else:
|
||||||
if row.daily_prorata_based:
|
if row.daily_prorata_based:
|
||||||
amount = (
|
amount = flt(asset.gross_purchase_amount) - flt(row.expected_value_after_useful_life)
|
||||||
flt(asset.gross_purchase_amount)
|
|
||||||
- flt(asset.opening_accumulated_depreciation)
|
|
||||||
- flt(row.expected_value_after_useful_life)
|
|
||||||
)
|
|
||||||
total_days = (
|
total_days = (
|
||||||
date_diff(
|
date_diff(
|
||||||
get_last_day(
|
get_last_day(
|
||||||
@@ -1548,7 +1544,11 @@ def get_straight_line_or_manual_depr_amount(asset, row, schedule_idx, number_of_
|
|||||||
),
|
),
|
||||||
add_days(
|
add_days(
|
||||||
get_last_day(
|
get_last_day(
|
||||||
add_months(row.depreciation_start_date, -1 * row.frequency_of_depreciation)
|
add_months(
|
||||||
|
row.depreciation_start_date,
|
||||||
|
(row.frequency_of_depreciation * (asset.number_of_depreciations_booked + 1))
|
||||||
|
* -1,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
1,
|
1,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user