All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edits.seer.internal.rules.RecurrenceDate1stEdit.xml Maven / Gradle / Ivy

There is a newer version: 024-13
Show newest version
        <rule id="RecurrenceDate1stEdit" name="Recurrence Date--1st (COC)" tag="N0063" java-path="lines.line" category="inter-field" depends="Day_Recurrence_Date_1st,Month_Recurrence_Date_1st,Year_Recurrence_Date_1st">
            <expression><![CDATA[Integer year = Functions.asInt(line.recurrenceDate1stYear)
Integer month = Functions.asInt(line.recurrenceDate1stMonth)
Integer day = Functions.asInt(line.recurrenceDate1stDay)

Integer yearCur  = Functions.getCurrentYear()
Integer monthCur = Functions.getCurrentMonth()
Integer dayCur = Functions.getCurrentDay()

if (line.recurrenceDate1stYear == null)
   return (line.recurrenceDate1stMonth == null && line.recurrenceDate1stDay == null)

if ((line.recurrenceDate1stMonth == null && line.recurrenceDate1stDay != null) || (month > 12 || (line.recurrenceDate1stMonth != null && month < 1)))
   return false

if (!Functions.between(year, 1930, yearCur))
    return false

if (line.recurrenceDate1stMonth == null) //by now year fits and day is null if month is null
    return true

if (year == yearCur && month > monthCur)
    return false

if (line.recurrenceDate1stDay == null) //by now year and month fit
    return true

if (year == yearCur && month == monthCur && day > dayCur)
    return false

Calendar cal = new GregorianCalendar(year, month - 1, 1)
return cal != null && day <= cal.getActualMaximum(Calendar.DAY_OF_MONTH)]]></expression>
            <message>Recurrence Date--1st is not valid.</message>
            <description><![CDATA[This edit is skipped if Recurrence Date--1st is empty.

The Recurrence Date--1st checks are performed in this order:

A) If the year is blank, month and day must also be blank.

B) Year of Recurrence Date--1st must be between 1930 and the current system year.

C) If the month is blank, the day must be blank.

D) If day of Recurrence Date--1st is blank, the year of Recurrence Date--1st and month of Recurrence Date--1st can not be greater than the current system year/month.

E) If day is known, then entire Recurrence Date--1st is verified. The date must be a valid date (leap years checked) and must be less than or equal to the current system date.]]></description>
            <history>
                <event version="SE21-021-01" user="kirbyk" date="2021-01-15" ref="68551">Edit created.</event>
                <event version="SE21-021-03" user="kirbyk" date="2021-03-09" ref="68568">Edit name changed.</event>
                <event version="SE22-022-05" user="kirbyk" date="2022-05-17" ref="68995">Replaced non-ASCII characters in message and description.</event>
                <event version="SE22-022-13" user="kirbyk" date="2022-10-18" ref="69045">Fixing edit behavior for future dates.</event>
            </history>
        </rule>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy