Skip to content

Commit

Permalink
feat: Add half-yearly asset maintenance periodicity. (backport #37006) (
Browse files Browse the repository at this point in the history
#37014)

feat: Add half-yearly asset maintenance periodicity. (#37006)

(cherry picked from commit 846ae32)

Co-authored-by: Bernd Oliver Sünderhauf <46800703+bosue@users.noreply.github.com>
  • Loading branch information
mergify[bot] and bosue authored Sep 10, 2023
1 parent 7ea53cc commit acd9c69
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions erpnext/assets/doctype/asset_maintenance/asset_maintenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,16 @@ def calculate_next_due_date(
next_due_date = add_days(start_date, 7)
if periodicity == "Monthly":
next_due_date = add_months(start_date, 1)
if periodicity == "Quarterly":
next_due_date = add_months(start_date, 3)
if periodicity == "Half-yearly":
next_due_date = add_months(start_date, 6)
if periodicity == "Yearly":
next_due_date = add_years(start_date, 1)
if periodicity == "2 Yearly":
next_due_date = add_years(start_date, 2)
if periodicity == "3 Yearly":
next_due_date = add_years(start_date, 3)
if periodicity == "Quarterly":
next_due_date = add_months(start_date, 3)
if end_date and (
(start_date and start_date >= end_date)
or (last_completion_date and last_completion_date >= end_date)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"fieldtype": "Select",
"in_list_view": 1,
"label": "Periodicity",
"options": "\nDaily\nWeekly\nMonthly\nQuarterly\nYearly\n2 Yearly\n3 Yearly",
"options": "\nDaily\nWeekly\nMonthly\nQuarterly\nHalf-yearly\nYearly\n2 Yearly\n3 Yearly",
"reqd": 1
},
{
Expand Down Expand Up @@ -153,4 +153,4 @@
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC"
}
}

0 comments on commit acd9c69

Please sign in to comment.