mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-18 01:36:55 +00:00
fix: pro-rata amount for straight line method
This commit is contained in:
@@ -638,32 +638,36 @@ 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(
|
|
||||||
add_months(
|
|
||||||
row.depreciation_start_date,
|
|
||||||
flt(row.total_number_of_depreciations - asset.number_of_depreciations_booked - 1)
|
|
||||||
* row.frequency_of_depreciation,
|
|
||||||
)
|
|
||||||
),
|
|
||||||
add_days(
|
|
||||||
get_last_day(
|
get_last_day(
|
||||||
add_months(
|
add_months(
|
||||||
row.depreciation_start_date,
|
row.depreciation_start_date,
|
||||||
flt(
|
flt(row.total_number_of_depreciations - asset.number_of_depreciations_booked - 1)
|
||||||
row.total_number_of_depreciations
|
|
||||||
- asset.number_of_depreciations_booked
|
|
||||||
- number_of_pending_depreciations
|
|
||||||
- 1
|
|
||||||
)
|
|
||||||
* row.frequency_of_depreciation,
|
* row.frequency_of_depreciation,
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
1,
|
add_days(
|
||||||
),
|
get_last_day(
|
||||||
) + 1
|
add_months(
|
||||||
|
row.depreciation_start_date,
|
||||||
|
flt(
|
||||||
|
row.total_number_of_depreciations
|
||||||
|
- asset.number_of_depreciations_booked
|
||||||
|
- number_of_pending_depreciations
|
||||||
|
- 1
|
||||||
|
)
|
||||||
|
* row.frequency_of_depreciation,
|
||||||
|
)
|
||||||
|
),
|
||||||
|
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