mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-20 07:22:13 +00:00
fix: added validation message for low gross purchase amount
(cherry picked from commit 8a30701893)
Co-authored-by: Khushi Rawat <142375893+khushi8112@users.noreply.github.com>
This commit is contained in:
@@ -363,6 +363,16 @@ class AssetDepreciationSchedule(Document):
|
|||||||
row.depreciation_start_date,
|
row.depreciation_start_date,
|
||||||
has_wdv_or_dd_non_yearly_pro_rata,
|
has_wdv_or_dd_non_yearly_pro_rata,
|
||||||
)
|
)
|
||||||
|
if flt(depreciation_amount, asset_doc.precision("gross_purchase_amount")) <= 0:
|
||||||
|
frappe.throw(
|
||||||
|
_(
|
||||||
|
"Gross Purchase Amount Too Low: {0} cannot be depreciated over {1} cycles with a frequency of {2} depreciations."
|
||||||
|
).format(
|
||||||
|
frappe.bold(asset_doc.gross_purchase_amount),
|
||||||
|
frappe.bold(row.total_number_of_depreciations),
|
||||||
|
frappe.bold(row.frequency_of_depreciation),
|
||||||
|
)
|
||||||
|
)
|
||||||
elif n == 0 and has_wdv_or_dd_non_yearly_pro_rata and self.opening_accumulated_depreciation:
|
elif n == 0 and has_wdv_or_dd_non_yearly_pro_rata and self.opening_accumulated_depreciation:
|
||||||
if not is_first_day_of_the_month(getdate(asset_doc.available_for_use_date)):
|
if not is_first_day_of_the_month(getdate(asset_doc.available_for_use_date)):
|
||||||
from_date = get_last_day(
|
from_date = get_last_day(
|
||||||
|
|||||||
Reference in New Issue
Block a user