Apr 13, 2016

Due date 구하기

TransDate due(TransDate _transDate,
              PaymDayId _paymDayId = '',
              boolean _calledFromAOS = false)
{
    TransDate   dueDate;
    PaymDayId   paymDayId;
    ;
    switch(this.PaymMethod)
    {
        case NetCurrent::Net :
            dueDate = _transDate;
            break;
        case NetCurrent::CurrentMth :
            dueDate = endmth(_transDate);
            break;
        case NetCurrent::CurrentQuart :
            dueDate = dateEndQtr(_transDate);
            break;
        case NetCurrent::CurrentYear :
            dueDate = nextYr(_transDate - dayOfYr(_transDate));
            break;
        case NetCurrent::CurrentWeek :
            if(_calledFromAOS)
            {
                dueDate = ProjParameters::dateEndOfWeekOnAOS(_transDate);
            }
            else
            {
                dueDate = dateEndWk(_transDate);
            }
            break;
        default :
            dueDate =_transDate;
            break;
    }
    if (this.NumOfMonths)
    {
        dueDate = dateMthFwd(dueDate, this.NumOfMonths);
        if (this.PaymMethod >= NetCurrent::CurrentMth &&
            this.PaymMethod <= NetCurrent::CurrentYear)
        {
            dueDate = endmth(dueDate);
        }
    }
    dueDate = dueDate + this.NumOfDays;
    paymDayId = _paymDayId;
    if (!paymDayId)
    {
        paymDayId = this.PaymDayId;
    }
    dueDate = PaymDay::roundOffDate(dueDate, paymDayId);
    return dueDate;
}

No comments:

Post a Comment