Page 1 of 1

Fiscal Year ( fy ) Calculator

Posted: Mon Jul 06, 2020 4:34 pm
by Rick Lipkin
To All

Just curious if FiveWin has a FW function to calculate a Fiscal Year .. like:

dDate := ctod("06/27/2020")
nFy := Whatever_function( dDate )

nFy should = 2020

Thanks
Rick Lipkin

Re: Fiscal Year ( fy ) Calculator

Posted: Tue Jul 07, 2020 1:22 am
by nageswaragunupudi
Fiscal year is different in different countries.
In some countries like USA it is the calendar year, Year( dDate ) gives the fiscal year.
In some countries like Australia, it is from July to June and for some countries like India, it is from Apr to March. So the function has to be country-specific.

https://en.wikipedia.org/wiki/Fiscal_year

The tax year (called by different names in different countries) normally is the year next to the fiscal year.

I have this function for use in India. ( Apr to Mar )

Code: Select all

function FYE( dDate, lAsLabel )

   local y

   DEFAULT dDate := Date()

   y := YEAR( dDate ) + If( MONTH( dDate ) > 3, 1, 0 )

   if lAsLabel == .t.
      return Str( y - 1, 4 ) + "-" + StrZero( y % 100, 2 )
   endif

return y

//----------------------------------------------------------------------------//

function BOFY( dDate )
return STOD( Str( FYE( dDate ) - 1, 4 ) + "0401" )

//----------------------------------------------------------------------------//

function EOFY( dDate )
return STOD( Str( FYE( dDate ), 4 ) + "0331" )

 
This function return end of FY or first year of Tax Year.