tax_jp 0.6.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/tax_jp/social_insurances/index.html.erb +13 -13
- data/data//345/205/203/345/217/267.yml +6 -4
- data/lib/tax_jp/gengou.rb +23 -15
- data/lib/tax_jp/utils.rb +5 -1
- data/lib/tax_jp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 904f7717769647f9da08993e625ac91281a7f1ff1bbe22d0874ad904f8244a10
|
4
|
+
data.tar.gz: a3acce33105643a945c4daf4f60365fdf00476edb74a76e2221a8e5cb6cbb6ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5ceecdd7705804be8ca91a32ab64bca1bd850ba252ade724a9d73236092a991a7f0a2e14d0f942a7f3d64d70515a5d8c4071813a26f256e62ecbf09ce93aeda
|
7
|
+
data.tar.gz: 4bd87db6417730cd1ea0a6baae4bcaea6aa8c33fb420d2a2913fe45ca786b5406af6206595f597e1af422f669178eee6d212150c683f879543dc7422bfbf17ac
|
@@ -30,19 +30,19 @@
|
|
30
30
|
<th class="text-center" colspan="4">厚生年金保険料(厚生年金基金加入員を除く)</th>
|
31
31
|
</tr>
|
32
32
|
<tr>
|
33
|
-
<th class="text-center">等級</th>
|
34
|
-
<th class="text-center">月額</th>
|
35
|
-
<th class="text-center">日額</th>
|
36
|
-
<th class="text-center">円以上</th>
|
37
|
-
<th class="text-center">円未満</th>
|
38
|
-
<th class="text-center">全額</th>
|
39
|
-
<th class="text-center">折半額</th>
|
40
|
-
<th class="text-center
|
41
|
-
<th class="text-center
|
42
|
-
<th class="text-center">全額</th>
|
43
|
-
<th class="text-center">折半額</th>
|
44
|
-
<th class="text-center
|
45
|
-
<th class="text-center
|
33
|
+
<th class="text-center align-middle">等級</th>
|
34
|
+
<th class="text-center align-middle">月額</th>
|
35
|
+
<th class="text-center align-middle">日額</th>
|
36
|
+
<th class="text-center align-middle">円以上</th>
|
37
|
+
<th class="text-center align-middle">円未満</th>
|
38
|
+
<th class="text-center align-middle">全額</th>
|
39
|
+
<th class="text-center align-middle">折半額</th>
|
40
|
+
<th class="text-center align-middle">全額<br>(介護保険2号)</th>
|
41
|
+
<th class="text-center align-middle">折半額<br>(介護保険2号)</th>
|
42
|
+
<th class="text-center align-middle">全額</th>
|
43
|
+
<th class="text-center align-middle">折半額</th>
|
44
|
+
<th class="text-center align-middle">全額<br>(坑内員/船員)</th>
|
45
|
+
<th class="text-center align-middle">折半額<br>(坑内員/船員)</th>
|
46
46
|
</tr>
|
47
47
|
</thead>
|
48
48
|
<tbody>
|
data/lib/tax_jp/gengou.rb
CHANGED
@@ -4,7 +4,7 @@ module TaxJp
|
|
4
4
|
class Gengou
|
5
5
|
@@_gengou = TaxJp::Utils.load_yaml('元号.yml')
|
6
6
|
|
7
|
-
def self.to_seireki(gengou,
|
7
|
+
def self.to_seireki(gengou, date_jp)
|
8
8
|
target_gengou = nil
|
9
9
|
@@_gengou.invert.keys.each do |start_gengou|
|
10
10
|
if start_gengou == gengou.to_s
|
@@ -12,32 +12,40 @@ module TaxJp
|
|
12
12
|
break
|
13
13
|
end
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
return nil unless target_gengou
|
17
|
-
|
17
|
+
|
18
18
|
start_year = @@_gengou.invert[target_gengou].to_i
|
19
19
|
return (start_year + year_jp.to_i - 1).to_s
|
20
20
|
end
|
21
21
|
|
22
|
-
def self.to_wareki(
|
23
|
-
return nil unless
|
22
|
+
def self.to_wareki(date, only_date: false, format: '%y年%m月%d日')
|
23
|
+
return nil unless date.present?
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
date = TaxJp::Utils.convert_to_date(date)
|
26
|
+
|
27
|
+
target_date = nil
|
28
|
+
@@_gengou.keys.each do |start_date|
|
29
|
+
target_date = TaxJp::Utils.convert_to_date(start_date)
|
30
|
+
break if date >= target_date
|
29
31
|
end
|
30
32
|
|
31
|
-
return nil unless
|
33
|
+
return nil unless target_date
|
32
34
|
|
33
|
-
|
34
|
-
|
35
|
+
target_date = Date.strptime(target_date)
|
36
|
+
year, month, day = *(date.split('-').map{|x| x.to_i})
|
37
|
+
year_jp = year - target_date.year + 1
|
35
38
|
|
36
|
-
|
37
|
-
|
39
|
+
ret = Date.new(year_jp, month, day)
|
40
|
+
if only_date
|
41
|
+
ret = ret.strftime(format)
|
38
42
|
else
|
39
|
-
gengou
|
43
|
+
gengou = @@_gengou[target_date]
|
44
|
+
year_jp = year_jp == 1 ? '元' : year_jp.to_s
|
45
|
+
ret = ret.strftime(format.gsub('%y', "#{gengou}#{year_jp}"))
|
40
46
|
end
|
47
|
+
|
48
|
+
ret
|
41
49
|
end
|
42
50
|
|
43
51
|
end
|
data/lib/tax_jp/utils.rb
CHANGED
@@ -42,7 +42,11 @@ module TaxJp
|
|
42
42
|
if value.is_a?(Date)
|
43
43
|
ret = value.strftime('%Y-%m-%d')
|
44
44
|
elsif value.is_a?(String)
|
45
|
-
|
45
|
+
if value =~ /[0-9]{4}-[0-9]{2}-[0-9]{2}/
|
46
|
+
ret = value
|
47
|
+
else
|
48
|
+
raise ArgumentError.new(value)
|
49
|
+
end
|
46
50
|
else
|
47
51
|
raise TypeError.new(value.class)
|
48
52
|
end
|
data/lib/tax_jp/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tax_jp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ichylinux
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-04-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bootstrap
|