project QadFinancials > class BPeriod > method GetDate

function returns date

Description

Returns the corresponding date for the new period.


Parameters


itDateinputdateThe old date
iiOldYearinputintegerThe old year
iiNewYearinputintegerThe new year


Internal usage


QadFinancials
method BPeriod.DataNewMultipleCopyPeriodYear


program code (program1/bperiod.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.