Fiscal Year ( fy ) Calculator

Fiscal Year ( fy ) Calculator

Postby Rick Lipkin » Mon Jul 06, 2020 4:34 pm

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
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Fiscal Year ( fy ) Calculator

Postby nageswaragunupudi » Tue Jul 07, 2020 1:22 am

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  Expand view  RUN
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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10650
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi, Silvio.Falconi and 61 guests