Skip to content

Commit

Permalink
Merge pull request resilient-tech#1392 from anandbaburajan/asset_rate…
Browse files Browse the repository at this point in the history
…_msg
  • Loading branch information
vorasmit authored Dec 12, 2023
2 parents 5652c0f + 041b480 commit 46bc6ec
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
from frappe.utils import date_diff


def get_updated_rate_of_depreciation_for_wdv_and_dd(asset, depreciable_value, fb_row):
def get_updated_rate_of_depreciation_for_wdv_and_dd(
asset, depreciable_value, fb_row, show_msg=True
):
rate_of_depreciation = fb_row.rate_of_depreciation
# if its the first depreciation
if depreciable_value == asset.gross_purchase_amount:
Expand All @@ -16,11 +18,12 @@ def get_updated_rate_of_depreciation_for_wdv_and_dd(asset, depreciable_value, fb
)
if diff <= 180:
rate_of_depreciation = rate_of_depreciation / 2
frappe.msgprint(
_(
"As per IT Act, the rate of depreciation for the first"
" depreciation entry is reduced by 50%."
if show_msg:
frappe.msgprint(
_(
"As per IT Act, the rate of depreciation for the first"
" depreciation entry is reduced by 50%."
)
)
)

return rate_of_depreciation

0 comments on commit 46bc6ec

Please sign in to comment.