Announcement

Collapse
No announcement yet.

Apply calendar to a date for assigned activity

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Apply calendar to a date for assigned activity

    Code:
    public LocalTimestamp getNextAvailableDateForActivity(LocalTimestamp currentTime, String activityGid, String calendarGid, T2SharedConnection connection)
        throws GLException
        {
         LocalTimestamp deliveryTime = currentTime;
            WorkPeriodSchedule cal = WorkPeriodSchedule.get(calendarGid, connection);
            LocalTimestamp localCurrentTime = currentTime;
            CalendarResult calendarResult = cal.nextAvailableWorkPeriod(localCurrentTime, activityGid, 0, false);
            if(calendarResult != null)
            {
             if(currentTime.getUTCTime() < calendarResult.adjustedTargetDate.getUTCTime())
              deliveryTime = calendarResult.adjustedTargetDate;
            }
            return deliveryTime;
        }
    We noted that RIQ [find rates] will not consider the calendar setting on location. So I just apply the calendar setting to the result.

    Use below code to call the function:
    deliveryTime = this.getNextAvailableDateForActivity(deliveryTime, "RECEIVE", locationRoleProfile.getCalendarGid(), new T2SharedConnection(DataFunction.DIRECT_ADMIN));
    Vincent Van
    OTM Customization Service
    [email protected]
Working...
X