financial_year flexibility #4

Closed
chiperific opened this Issue Feb 27, 2013 · 1 comment

Projects

None yet

2 participants

@chiperific

Not really a bug, but a feature request. GREAT gem, by the way. Saved me hours!

Fiscal years are often named future-tense. For example, July 2012 - June 2013 is referred to as FY 2013. Your system returns FY2012 here:

def financial_year self.month < start_month ? self.year - 1 : self.year end

I changed it to:
`def financial_year
self.month < start_month ? self.year : self.year + 1
end``

It might be nice to be able to set that as a default option.

Thanks again for a good, clean gem.

@asanghi
Owner
asanghi commented Feb 27, 2013

Cool! Sounds like a great idea. Perhaps you want to send a pull request so that it can be made configurable? Introduce a configuration class variable called use_forward_year

def financial_year
  if self.class.use_forward_year
    self.month < start_month ? self.year : self.year + 1
  else
    self.month < start_month ? self.year - 1 : self.year
  end
end
@chiperific chiperific closed this Apr 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment