mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-23 13:12:22 +01:00
fix: pro-rata amount for straight line method
(cherry picked from commit 16a5475c0c)
This commit is contained in:
@@ -638,9 +638,9 @@ def get_straight_line_or_manual_depr_amount(
|
|||||||
# if the Depreciation Schedule is being modified after Asset Value Adjustment due to decrease in asset value
|
# if the Depreciation Schedule is being modified after Asset Value Adjustment due to decrease in asset value
|
||||||
elif asset.flags.decrease_in_asset_value_due_to_value_adjustment:
|
elif asset.flags.decrease_in_asset_value_due_to_value_adjustment:
|
||||||
if row.daily_prorata_based:
|
if row.daily_prorata_based:
|
||||||
daily_depr_amount = (
|
amount = flt(row.value_after_depreciation) - flt(row.expected_value_after_useful_life)
|
||||||
flt(row.value_after_depreciation) - flt(row.expected_value_after_useful_life)
|
total_days = (
|
||||||
) / date_diff(
|
date_diff(
|
||||||
get_last_day(
|
get_last_day(
|
||||||
add_months(
|
add_months(
|
||||||
row.depreciation_start_date,
|
row.depreciation_start_date,
|
||||||
@@ -663,7 +663,11 @@ def get_straight_line_or_manual_depr_amount(
|
|||||||
),
|
),
|
||||||
1,
|
1,
|
||||||
),
|
),
|
||||||
) + 1
|
)
|
||||||
|
+ 1
|
||||||
|
)
|
||||||
|
|
||||||
|
daily_depr_amount = amount / total_days
|
||||||
|
|
||||||
to_date = get_last_day(
|
to_date = get_last_day(
|
||||||
add_months(row.depreciation_start_date, schedule_idx * row.frequency_of_depreciation)
|
add_months(row.depreciation_start_date, schedule_idx * row.frequency_of_depreciation)
|
||||||
|
|||||||
Reference in New Issue
Block a user