project QadFinancials > class BFixedAssetDepreciation > method CalcLastDateOfAccYear

function returns date

Description

Returns the last date of an accounting year


Parameters


iiAccYearinputintegerAccounting Year
oiReturnStatusoutputinteger


Internal usage


QadFinancials
method BFixedAssetDepreciation.APIDepreciationSimul
method BFixedAssetDepreciation.DepreciationMain


program code (program5/bfixedassetdepreciation.p)

/*AccYear is mandatory*/
if iiAccYear = 0 or
   iiAccYear = ?
then return ?.

<Q-1 run PeriodByYearType (last) (Read) (NoCache)
          (input viCompanyId, (CompanyId)
           input iiAccYear, (PeriodYear)
           input {&PERIODTYPECODE-NORMAL}, (PeriodTypeCode)
           output dataset tqPeriodByYearType) in BPeriod >
find first tqPeriodByYearType no-error.
if available tqPeriodByYearType
then return tqPeriodByYearType.ttPeriodEndDate.
else return ?.