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

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

(cherry picked from commit 846ae32d92)

Co-authored-by: Bernd Oliver Sünderhauf <46800703+bosue@users.noreply.github.com>
This commit is contained in:
mergify[bot]
2023-09-10 17:26:41 +05:30
committed by GitHub
parent 7ea53cc316
commit acd9c69201
2 changed files with 6 additions and 4 deletions

View File

@@ -80,14 +80,16 @@ def calculate_next_due_date(
next_due_date = add_days(start_date, 7) next_due_date = add_days(start_date, 7)
if periodicity == "Monthly": if periodicity == "Monthly":
next_due_date = add_months(start_date, 1) 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": if periodicity == "Yearly":
next_due_date = add_years(start_date, 1) next_due_date = add_years(start_date, 1)
if periodicity == "2 Yearly": if periodicity == "2 Yearly":
next_due_date = add_years(start_date, 2) next_due_date = add_years(start_date, 2)
if periodicity == "3 Yearly": if periodicity == "3 Yearly":
next_due_date = add_years(start_date, 3) next_due_date = add_years(start_date, 3)
if periodicity == "Quarterly":
next_due_date = add_months(start_date, 3)
if end_date and ( if end_date and (
(start_date and start_date >= end_date) (start_date and start_date >= end_date)
or (last_completion_date and last_completion_date >= end_date) or (last_completion_date and last_completion_date >= end_date)

View File

@@ -71,7 +71,7 @@
"fieldtype": "Select", "fieldtype": "Select",
"in_list_view": 1, "in_list_view": 1,
"label": "Periodicity", "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 "reqd": 1
}, },
{ {