tax_jp 1.6.1 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fce79ce7e44efa084898646850b5b90168a22aeaf05be65f7ec41ec69a693bde
4
- data.tar.gz: 28fc65153035ef5f6a784605c3c2e7ec5575661eb5554fc799b971ab0bc1c499
3
+ metadata.gz: 93d3c203c41f2603be4231f313512ef53412b8252863aaa59b854e0a1ba180f9
4
+ data.tar.gz: 3f3106ff02f8c2e3da29af49e9dc967fd855837c848fbd1c3bbf6015eb410796
5
5
  SHA512:
6
- metadata.gz: 36187ad9ad15949a9e723667661e020c15ffef54ee522ae5b814b7b07211dee9e0c7fc1b1e4854fb94fa9a79d44aad890c19112b68e1f8db06aa9e5cba8c1bf5
7
- data.tar.gz: 1af165283f7235729e0597ae0f2bd4fb031e83c5ee784ce42c9e93a407f69fe1c7a232e405bd33bace03af17de57f4698d4ee3e41e31359a73f62fca4ce9ead1
6
+ metadata.gz: 7acb715b9415ba368bf708853712ec10942ba87e473cf00384138ba8c3c25d4583be941a1826e0bbb59f86c4530ed5f35c6e9228032fe8d6b97d0c99b0bb5173
7
+ data.tar.gz: 5969c613c9e1588800c1d71eff5a473922641de6095b440d3241a4ef3492d54fe13c68fe9b48280a03f5f585be9450af7446a94426ef2247f3410df4941d1fd1
@@ -44,16 +44,16 @@
44
44
  to = wt.__send__("dependent_#{i}_salary_to")
45
45
  infinite = to == TaxJp::INTEGER_MAX
46
46
  %>
47
- <td class="text-end"><%= from == TaxJp::INTEGER_MAX ? '-' : from.to_s(:delimited) %></td>
48
- <td class="<%= infinite ? 'text-center' : 'text-end' %>"><%= infinite ? '-' : to.to_s(:delimited) %></td>
47
+ <td class="text-end"><%= from == TaxJp::INTEGER_MAX ? '-' : from.to_fs(:delimited) %></td>
48
+ <td class="<%= infinite ? 'text-center' : 'text-end' %>"><%= infinite ? '-' : to.to_fs(:delimited) %></td>
49
49
  <% end %>
50
50
  <%
51
51
  from = wt.sub_salary_from
52
52
  to = wt.sub_salary_to
53
53
  infinite = to == TaxJp::INTEGER_MAX
54
54
  %>
55
- <td class="text-end"><%= from.to_s(:delimited) unless from == 0 && to == 0 %></td>
56
- <td class="<%= infinite ? 'text-center' : 'text-end' %>"><%= infinite ? '-' : to.to_s(:delimited) unless from == 0 && to == 0 %></td>
55
+ <td class="text-end"><%= from.to_fs(:delimited) unless from == 0 && to == 0 %></td>
56
+ <td class="<%= infinite ? 'text-center' : 'text-end' %>"><%= infinite ? '-' : to.to_fs(:delimited) unless from == 0 && to == 0 %></td>
57
57
  </tr>
58
58
  <% end %>
59
59
  </tbody>
@@ -56,14 +56,14 @@
56
56
  <td class="text-center"><%= si.grade.grade %></td>
57
57
  <% end %>
58
58
 
59
- <td class="text-end"><%= si.grade.monthly_standard.to_s(:delimited) %></td>
60
- <td class="text-end"><%= si.grade.daily_standard.to_s(:delimited) %></td>
61
- <td class="text-end"><%= si.grade.salary_from.to_s(:delimited) %></td>
62
- <td class="text-end"><%= si.grade.salary_to.to_s(:delimited) if si.grade.salary_to < TaxJp::INTEGER_MAX %></td>
63
- <td class="text-end"><%= si.health_insurance.general_amount.to_s(:delimited) %></td>
64
- <td class="text-end"><%= si.health_insurance.general_amount_half.to_s(:delimited) %></td>
65
- <td class="text-end"><%= si.health_insurance.general_amount_care.to_s(:delimited) %></td>
66
- <td class="text-end"><%= si.health_insurance.general_amount_care_half.to_s(:delimited) %></td>
59
+ <td class="text-end"><%= si.grade.monthly_standard.to_fs(:delimited) %></td>
60
+ <td class="text-end"><%= si.grade.daily_standard.to_fs(:delimited) %></td>
61
+ <td class="text-end"><%= si.grade.salary_from.to_fs(:delimited) %></td>
62
+ <td class="text-end"><%= si.grade.salary_to.to_fs(:delimited) if si.grade.salary_to < TaxJp::INTEGER_MAX %></td>
63
+ <td class="text-end"><%= si.health_insurance.general_amount.to_fs(:delimited) %></td>
64
+ <td class="text-end"><%= si.health_insurance.general_amount_half.to_fs(:delimited) %></td>
65
+ <td class="text-end"><%= si.health_insurance.general_amount_care.to_fs(:delimited) %></td>
66
+ <td class="text-end"><%= si.health_insurance.general_amount_care_half.to_fs(:delimited) %></td>
67
67
 
68
68
  <% if [0, TaxJp::INTEGER_MAX].exclude?(si.grade.pension_grade) %>
69
69
  <td class="text-end"><%= number_to_currency(si.welfare_pension.general_amount, unit: '', precision: 2) if si.welfare_pension.general_amount > 0 %></td>
@@ -29,11 +29,11 @@
29
29
  <% @withheld_taxes.each do |wt| %>
30
30
  <% if wt.extra_rate > 0 or wt.sub_extra_rate > 0 %>
31
31
  <tr>
32
- <td class="text-center" colspan="2"><%= wt.salary_range_from.to_s(:delimited) %></td>
32
+ <td class="text-center" colspan="2"><%= wt.salary_range_from.to_fs(:delimited) %></td>
33
33
  <% 8.times do |i| %>
34
- <td class="text-end"><%= wt.__send__("dependent_#{i}").to_s(:delimited) %></td>
34
+ <td class="text-end"><%= wt.__send__("dependent_#{i}").to_fs(:delimited) %></td>
35
35
  <% end %>
36
- <td class="text-end"><%= wt.sub_salary.to_s(:delimited) %></td>
36
+ <td class="text-end"><%= wt.sub_salary.to_fs(:delimited) %></td>
37
37
  </tr>
38
38
  <tr>
39
39
  <td colspan="2"></td>
@@ -42,14 +42,14 @@
42
42
  </tr>
43
43
  <% else %>
44
44
  <tr>
45
- <td class="text-center"><%= wt.salary_range_from.to_s(:delimited) %></td>
45
+ <td class="text-center"><%= wt.salary_range_from.to_fs(:delimited) %></td>
46
46
  <td class="text-center">
47
- <%= wt.salary_range_to == TaxJp::INTEGER_MAX ? '-' : wt.salary_range_to.to_s(:delimited) %>
47
+ <%= wt.salary_range_to == TaxJp::INTEGER_MAX ? '-' : wt.salary_range_to.to_fs(:delimited) %>
48
48
  </td>
49
49
  <% 8.times do |i| %>
50
- <td class="text-end"><%= wt.__send__("dependent_#{i}").to_s(:delimited) %></td>
50
+ <td class="text-end"><%= wt.__send__("dependent_#{i}").to_fs(:delimited) %></td>
51
51
  <% end %>
52
- <td class="text-end"><%= wt.sub_salary.to_s(:delimited) %></td>
52
+ <td class="text-end"><%= wt.sub_salary.to_fs(:delimited) %></td>
53
53
  </tr>
54
54
  <% end %>
55
55
  <% end %>
@@ -9,7 +9,7 @@ class TaxJp::DepreciationRates::DbBuilder
9
9
  def run(options = {})
10
10
  with_database(options) do |db|
11
11
  Dir.glob(File.join(TaxJp::Utils.data_dir, '減価償却率', '減価償却率-*.tsv')).each do |filename|
12
- valid_from, valid_until = filename_to_date(filename)
12
+ valid_from, valid_until = TaxJp::Utils.filename_to_date(filename)
13
13
 
14
14
  CSV.foreach(filename, :col_sep => "\t") do |row|
15
15
  next if row[0].to_i == 0
@@ -48,11 +48,4 @@ class TaxJp::DepreciationRates::DbBuilder
48
48
  ret
49
49
  end
50
50
 
51
- def filename_to_date(filename)
52
- title, valid_from, valid_until = File.basename(filename).split('.').first.split('-')
53
- valid_from = Date.strptime(valid_from, '%Y%m%d')
54
- valid_until = Date.strptime(valid_until, '%Y%m%d')
55
- [valid_from.strftime('%Y-%m-%d'), valid_until.strftime('%Y-%m-%d')]
56
- end
57
-
58
51
  end
@@ -1,3 +1,3 @@
1
1
  module TaxJp
2
- VERSION = '1.6.1'
2
+ VERSION = '1.7.0'
3
3
  end
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: 1.6.1
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichylinux
@@ -64,7 +64,7 @@ dependencies:
64
64
  requirements:
65
65
  - - ">="
66
66
  - !ruby/object:Gem::Version
67
- version: '6.1'
67
+ version: '7.0'
68
68
  - - "<"
69
69
  - !ruby/object:Gem::Version
70
70
  version: '8.0'
@@ -74,7 +74,7 @@ dependencies:
74
74
  requirements:
75
75
  - - ">="
76
76
  - !ruby/object:Gem::Version
77
- version: '6.1'
77
+ version: '7.0'
78
78
  - - "<"
79
79
  - !ruby/object:Gem::Version
80
80
  version: '8.0'
@@ -250,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
250
250
  - !ruby/object:Gem::Version
251
251
  version: '0'
252
252
  requirements: []
253
- rubygems_version: 3.7.2
253
+ rubygems_version: 3.6.9
254
254
  specification_version: 4
255
255
  summary: 税金計算ライブラリ
256
256
  test_files: []