fiscali 2.4.0 → 2.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.markdown +39 -26
- data/lib/rising_sun/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YzliMjVhMjczMmVkNDc2ZGI4M2I1ZTZkMTQ3ZjZiY2JhMjJhZTgzYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OGNlMGI0MzJkMTRiYWRkYWVjOTQ3YWU5NmFlNmIyMjkyMzMwZGFjNg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OWEwMGNlNzFjNjA0MDAwZGQ0NDM2ZDJiNmMzYTZiN2I3ZTE5NjM4MTY2OTM4
|
10
|
+
OTRmZGVlZGE1MzNjMDE1ODgyOGEwZmQ1MThhOTZjMmU2NTlmMTM0NDMzMjYy
|
11
|
+
ZTZhN2ExZDVlM2E5MTAxMmFmN2U1MDZhNmFjNjZjZjFjY2JmMTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
M2QwNGE2Y2JkZjU0ZWMzODJhZDI0YzViMjQ5N2EwYWQyYTNmZjcwODRjODJi
|
14
|
+
MjE1NjI1Y2QzZGQ3YmFlZmVhNGMwMTg0NzNkNjJiMDJmZjVjZDBmMGY0YTU5
|
15
|
+
YTEyMGExY2Y5Y2I1NGZjYzQ3YTM5YWE5MTM3MjlkMTM3MTNjNDI=
|
data/README.markdown
CHANGED
@@ -1,55 +1,67 @@
|
|
1
1
|
# Fiscali: Fiscal Year based calculations
|
2
2
|
|
3
|
-
Fiscali provides
|
3
|
+
Fiscali provides methods on your Date and Time classes to jump around dates in your Financial Year.
|
4
4
|
|
5
|
-
|
6
|
-
* Not sure it's a point to be said, but YES, you can specify your financial year zone and if you dont know your zone, just provide the first month your financial year to the Date/Time class.
|
5
|
+
You can specify your financial year zone and if you don’t know your zone, just provide the month your financial year begins.
|
7
6
|
|
8
7
|
## Quick Links
|
9
8
|
|
10
|
-
* [Wiki](
|
11
|
-
* [Bugs](
|
12
|
-
* [Donate](
|
9
|
+
* [Wiki](https://github.com/asanghi/fiscali/wiki)
|
10
|
+
* [Bugs](https://github.com/asanghi/fiscali/issues)
|
11
|
+
* [Donate](https://pledgie.org/campaigns/5400)
|
13
12
|
|
14
13
|
## Installing
|
15
14
|
|
16
|
-
|
15
|
+
gem install fiscali
|
17
16
|
|
18
17
|
## Using in your Rails project
|
19
18
|
|
20
|
-
In Rails projects, include
|
19
|
+
In Rails projects, include Fiscali in the Gemfile, and run `bundle install` to install the gem:
|
21
20
|
|
22
|
-
gem
|
21
|
+
gem 'fiscali'
|
23
22
|
|
24
|
-
Next
|
23
|
+
Next, create an initializer for configuration Fiscali:
|
24
|
+
|
25
|
+
config/initializers/fiscali.rb
|
26
|
+
|
27
|
+
Either provide your Date/Time class your start zone:
|
25
28
|
|
26
29
|
Date.fiscal_zone = :india
|
27
|
-
Time.fiscal_zone = :india
|
28
|
-
or
|
29
|
-
Date.start_month = 4
|
30
30
|
|
31
|
-
|
31
|
+
Or if set the exact start month—for example, April:
|
32
|
+
|
33
|
+
Date.fy_start_month = 4
|
34
|
+
|
35
|
+
You can also determine the default for Year Forward by adding this to the same initializer file:
|
32
36
|
|
33
37
|
Date.use_forward_year!
|
34
38
|
Time.use_forward_year!
|
35
39
|
|
36
|
-
|
40
|
+
To revert back to the default:
|
37
41
|
|
38
42
|
Date.reset_forward_year!
|
39
43
|
Time.reset_forward_year!
|
40
44
|
|
41
|
-
Year Forward refers to the standard name for a fiscal year. For example:
|
42
|
-
|
43
|
-
* If FY 2008 spans
|
45
|
+
“Year Forward” refers to the standard name for a fiscal year. For example:
|
46
|
+
|
47
|
+
* If FY 2008 spans 2008–2009, set to false or don’t include in initializer file.
|
48
|
+
* If FY 2008 spans 2007–2008, set to true in initializer file.
|
49
|
+
|
50
|
+
Note that for every configuration you make, you will need to make it to every class (Date, Time, and DateTime) independently. For example:
|
51
|
+
|
52
|
+
Date.fiscal_zone = :india
|
53
|
+
Time.fiscal_zone = :india
|
54
|
+
DateTime.fiscal_zone = :india
|
44
55
|
|
45
56
|
### Default options
|
46
57
|
|
47
|
-
By default, the financial year start in January.
|
48
|
-
|
58
|
+
By default, the financial year start in January.
|
59
|
+
|
60
|
+
Supported zones are:
|
49
61
|
|
50
|
-
{:
|
62
|
+
{ india: 4, uk: 4, us: 10, pakistan: 7, australia: 7, ireland: 1, nz: 7, japan: 4}
|
51
63
|
|
52
|
-
By default, the
|
64
|
+
By default, the year forward is false, meaning the term FY 2008 spans 2008–2009 years.
|
53
65
|
|
54
66
|
## Date or Time Class Methods
|
55
67
|
|
@@ -84,8 +96,6 @@ By default, the Year Forward option is set to false, meaning the term FY 2008 sp
|
|
84
96
|
Date.uses_forward_year?
|
85
97
|
=> true
|
86
98
|
|
87
|
-
|
88
|
-
|
89
99
|
If you want to add your own fiscal zone
|
90
100
|
|
91
101
|
RisingSun::Fiscali::FISCAL_ZONE.merge!(:my_own_zone => 2)
|
@@ -102,15 +112,17 @@ should do the trick.
|
|
102
112
|
Indian Fiscal Year starts from 1st of April
|
103
113
|
Assume Date.today is 1st May 2009
|
104
114
|
|
105
|
-
|
106
115
|
##### financial_year -> Returns the financial year of the date/time
|
116
|
+
|
107
117
|
Date.today.financial_year
|
108
118
|
=> 2009
|
109
119
|
Date.today.beginning_of_year.financial_year
|
110
120
|
=> 2008
|
111
|
-
|
121
|
+
|
122
|
+
Since 1st Jan 2009 in India falls in the 2008-09 financial year
|
112
123
|
|
113
124
|
##### beginning_of_financial_year -> Returns the beginning of financial year
|
125
|
+
|
114
126
|
Date.today.beginning_of_financial_year
|
115
127
|
=> 1st April 2009
|
116
128
|
Date.today.beginning_of_year.beginning_of_financial_year
|
@@ -201,6 +213,7 @@ Assume Date.today is 1st May 2009
|
|
201
213
|
|
202
214
|
## Contributors
|
203
215
|
|
216
|
+
* [@moubry](https://github.com/moubry)
|
204
217
|
* [@reed](https://github.com/reed)
|
205
218
|
* [@chiperific](https://github.com/chiperific)
|
206
219
|
* [@rshallit](https://github.com/rshallit)
|
data/lib/rising_sun/version.rb
CHANGED