project QadFinancials > class BReportPeriod > method GetDate

function returns date

Description

This method will be called by DataNewMultipleCopyPeriodYear. It will check for the leap year and return the corresponding date value. If it is s leap year, the date is 29; Or it is 28.


Parameters


itDateinputdateThe origin date
iiOldYearinputintegerThe existing year
iiNewYearinputintegerThe new year to be created


Internal usage


QadFinancials
method BReportPeriod.DataNewMultipleCopyPeriodYear


program code (program7/breportperiod.p)

if day (itDate)   = 29 and
   month (itDate) = 2
then assign viYear = year (itDate) + iiNewYear - iiOldYear
            viDay  = if viYear modulo 4    = 0 and
                        viYear modulo 100 <> 0 or
                        viYear modulo 400  = 0
                     then 29
                     else 28
            vtDate = date (month (itDate),
                           viDay,
                           viYear).
else assign vtDate = date (month (itDate),
                           day (itDate),
                           year (itDate) + iiNewYear - iiOldYear).

return vtDate.