tax_jp 1.8.3 → 1.8.4

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: 72fc45a2a224e99f88a6dc59c98effa95eceb9c97a4dc8981aec32c058af71c8
4
- data.tar.gz: 11877406d3cd4badbe9eeb77fc06bc668857fd5144da029d2b4b91cb984a0ced
3
+ metadata.gz: 07b7f56733bbf993a3a5ceac2a0005411c1244798d5d28b0b3876482d998d654
4
+ data.tar.gz: 6a9d6c3f4c1aa132e5f297288acaa24bdbbc32ddbd80051396afaa9e8398048f
5
5
  SHA512:
6
- metadata.gz: 747d67fc5180990721a19107ada934cfb7f06832f31a9dec82066d38197fa2fa91226e574d7b79faa3a78720846d259675b347bac1bf290ba1ff62dd472b1a92
7
- data.tar.gz: 1ee20839ea6ba385b099d60d6fa69a26e897e7e1a9839385f5a6326d3e28484214c742f5adefb1ffdf0cd73ac6c37c3aa1e763184f2f55a6664686b0b68d6c70
6
+ metadata.gz: 784e6c01a44183f175c452d478f363542bf6886fd5805eb95dc3abf038b454fb2ebde7e10f5063d38f631c1468e1a66aff3b238af43723ada20f9e0bf60c5483
7
+ data.tar.gz: 697ece7adafb0633ee820b2415bde627d0dc07f13dad31718bbe1ef448d095df15ba376eeb8e71abb0b5c4a37421e54673c439c1025c405a66a6c878cf4e278a
@@ -1,4 +1,4 @@
1
- 適用開始日 適用終了日 一般の被保険者(%) 坑内員・船員(%) こども・子育て拠出金(%) 子ども・子育て支援金(%)
1
+ 適用開始日 適用終了日 一般の被保険者(%) 坑内員・船員(%) 子ども・子育て拠出金(%) 子ども・子育て支援金(%)
2
2
  2006-09-01 2007-08-31 14.642 14.642 0.09 0
3
3
  2007-09-01 2008-08-31 14.996 14.996 0.13 0
4
4
  2008-09-01 2009-08-31 15.35 15.35 0.13 0
@@ -12,7 +12,7 @@ class TaxJp::CorporateTaxes::DbBuilder
12
12
  Dir.glob(File.join(TaxJp::Utils.data_dir, '法人税', '区分番号-*.tsv')).each do |filename|
13
13
  valid_from, valid_until = TaxJp::Utils.filename_to_date(filename)
14
14
 
15
- CSV.foreach(filename, :col_sep => "\t", :headers => true) do |row|
15
+ CSV.foreach(filename, col_sep: "\t", headers: true) do |row|
16
16
  next if row[0].to_s.strip.empty?
17
17
 
18
18
  values = []
@@ -11,7 +11,7 @@ class TaxJp::DepreciationRates::DbBuilder
11
11
  Dir.glob(File.join(TaxJp::Utils.data_dir, '減価償却率', '減価償却率-*.tsv')).each do |filename|
12
12
  valid_from, valid_until = TaxJp::Utils.filename_to_date(filename)
13
13
 
14
- CSV.foreach(filename, :col_sep => "\t") do |row|
14
+ CSV.foreach(filename, col_sep: "\t") do |row|
15
15
  next if row[0].to_i == 0
16
16
  db.execute(insert_sql, [valid_from, valid_until] + row)
17
17
  end
@@ -21,24 +21,24 @@ module TaxJp
21
21
 
22
22
  def initialize(row)
23
23
  @grade = TaxJp::SocialInsurances::Grade.new(
24
- :valid_from => row[0], :valid_until => row[1],
25
- :grade => row[2], :pension_grade => row[3],
26
- :monthly_standard => row[4], :daily_standard => row[5],
27
- :salary_from => row[6], :salary_to => row[7])
24
+ valid_from: row[0], valid_until: row[1],
25
+ grade: row[2], pension_grade: row[3],
26
+ monthly_standard: row[4], daily_standard: row[5],
27
+ salary_from: row[6], salary_to: row[7])
28
28
 
29
29
  @health_insurance = TaxJp::SocialInsurances::HealthInsurance.new(
30
- :grade => @grade,
31
- :valid_from => row[8], :valid_until => row[9],
32
- :prefecture => Prefecture.find_by_code(row[10]),
33
- :general => row[11], :care => row[12],
34
- :particular => row[13], :basic => row[14])
30
+ grade: @grade,
31
+ valid_from: row[8], valid_until: row[9],
32
+ prefecture: Prefecture.find_by_code(row[10]),
33
+ general: row[11], care: row[12],
34
+ particular: row[13], basic: row[14],
35
+ child_and_childcare_support: row[20])
35
36
 
36
37
  @welfare_pension = TaxJp::SocialInsurances::WelfarePension.new(
37
- :grade => @grade,
38
- :valid_from => row[15], :valid_until => row[16],
39
- :general => row[17], :particular => row[18],
40
- :child_support => row[19],
41
- :child_and_childcare_support => row[20])
38
+ grade: @grade,
39
+ valid_from: row[15], valid_until: row[16],
40
+ general: row[17], particular: row[18],
41
+ child_support: row[19])
42
42
  end
43
43
 
44
44
  def valid_from
@@ -12,14 +12,14 @@ class TaxJp::SocialInsurances::DbBuilder < TaxJp::DbBuilder
12
12
  Dir.glob(File.join(TaxJp::Utils.data_dir, '社会保険料', '等級-*.tsv')).each do |filename|
13
13
  valid_from, valid_until = filename_to_date(filename)
14
14
 
15
- CSV.foreach(filename, :col_sep => "\t") do |row|
15
+ CSV.foreach(filename, col_sep: "\t") do |row|
16
16
  next if row[0].to_i == 0 and row[1].to_i == 0
17
17
  db.execute(insert_sql_grade, [valid_from, valid_until] + row.map{|col| TaxJp::Utils.normalize_amount(col)})
18
18
  end
19
19
  end
20
20
 
21
21
  Dir.glob(File.join(TaxJp::Utils.data_dir, '社会保険料', '旧健康保険.tsv')).each do |filename|
22
- CSV.foreach(filename, :col_sep => "\t") do |row|
22
+ CSV.foreach(filename, col_sep: "\t") do |row|
23
23
  next unless row[2].to_f > 0
24
24
  values = []
25
25
  values << row[0]
@@ -36,7 +36,7 @@ class TaxJp::SocialInsurances::DbBuilder < TaxJp::DbBuilder
36
36
  Dir.glob(File.join(TaxJp::Utils.data_dir, '社会保険料', '健康保険-*.tsv')).each do |filename|
37
37
  valid_from, valid_until = filename_to_date(filename)
38
38
 
39
- CSV.foreach(filename, :col_sep => "\t") do |row|
39
+ CSV.foreach(filename, col_sep: "\t") do |row|
40
40
  next unless row[1].to_f > 0
41
41
  values = []
42
42
  values << valid_from
@@ -51,7 +51,7 @@ class TaxJp::SocialInsurances::DbBuilder < TaxJp::DbBuilder
51
51
  end
52
52
 
53
53
  Dir.glob(File.join(TaxJp::Utils.data_dir, '社会保険料', '厚生年金.tsv')).each do |filename|
54
- CSV.foreach(filename, :col_sep => "\t") do |row|
54
+ CSV.foreach(filename, col_sep: "\t") do |row|
55
55
  next unless row[2].to_f > 0
56
56
  values = []
57
57
  values << row.shift
@@ -5,6 +5,8 @@ class TaxJp::SocialInsurances::HealthInsurance
5
5
  attr_reader :prefecture
6
6
  attr_reader :general, :care
7
7
  attr_reader :particular, :basic
8
+ # 子ども・子育て支援金
9
+ attr_reader :child_and_childcare_support
8
10
 
9
11
  attr_writer :salary
10
12
 
@@ -20,6 +22,7 @@ class TaxJp::SocialInsurances::HealthInsurance
20
22
  @care = attrs[:care]
21
23
  @particular= attrs[:particular]
22
24
  @basic = attrs[:basic]
25
+ @child_and_childcare_support = attrs[:child_and_childcare_support]
23
26
  elsif attrs.is_a?(Array)
24
27
  @valid_from = attrs[0]
25
28
  @valid_until = attrs[1]
@@ -28,6 +31,7 @@ class TaxJp::SocialInsurances::HealthInsurance
28
31
  @care = attrs[4]
29
32
  @particular= attrs[5]
30
33
  @basic = attrs[6]
34
+ @child_and_childcare_support = attrs[7]
31
35
  end
32
36
  end
33
37
 
@@ -47,6 +51,14 @@ class TaxJp::SocialInsurances::HealthInsurance
47
51
  (general_amount_care / 2).floor(1)
48
52
  end
49
53
 
54
+ def child_and_childcare_support_amount
55
+ (salary * child_and_childcare_support).round(1)
56
+ end
57
+
58
+ def child_and_childcare_support_amount_half
59
+ (child_and_childcare_support_amount / 2).floor(1)
60
+ end
61
+
50
62
  def salary
51
63
  @salary || monthly_standard
52
64
  end
@@ -3,7 +3,6 @@ class TaxJp::SocialInsurances::WelfarePension
3
3
  attr_reader :valid_from, :valid_until
4
4
  attr_reader :general, :particular
5
5
  attr_reader :child_support
6
- attr_reader :child_and_childcare_support
7
6
 
8
7
  attr_accessor :grade
9
8
  attr_writer :salary
@@ -18,14 +17,12 @@ class TaxJp::SocialInsurances::WelfarePension
18
17
  @general= attrs[:general]
19
18
  @particular= attrs[:particular]
20
19
  @child_support = attrs[:child_support]
21
- @child_and_childcare_support = attrs[:child_and_childcare_support]
22
20
  elsif attrs.is_a?(Array)
23
21
  @valid_from = attrs[0]
24
22
  @valid_until = attrs[1]
25
23
  @general= attrs[2]
26
24
  @particular= attrs[3]
27
25
  @child_support = attrs[4]
28
- @child_and_childcare_support = attrs[5]
29
26
  end
30
27
  end
31
28
 
@@ -1,3 +1,3 @@
1
1
  module TaxJp
2
- VERSION = '1.8.3'
2
+ VERSION = '1.8.4'
3
3
  end
@@ -12,7 +12,7 @@ class TaxJp::WithheldTaxes::MonthlyDbBuilder < TaxJp::DbBuilder
12
12
  Dir.glob(File.join(TaxJp::Utils.data_dir, '源泉徴収税', '源泉徴収税月額-*.tsv')).each do |filename|
13
13
  valid_from, valid_until = TaxJp::Utils.filename_to_date(filename)
14
14
 
15
- CSV.foreach(filename, :col_sep => "\t") do |row|
15
+ CSV.foreach(filename, col_sep: "\t") do |row|
16
16
  next if row[0].to_i == 0 and row[1].to_i == 0
17
17
  values = row.map{|col| TaxJp::Utils.normalize_amount(col)}
18
18
  db.execute(insert_sql, [valid_from.to_s, valid_until.to_s] + values)
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.8.3
4
+ version: 1.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichylinux
@@ -233,7 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
233
233
  - !ruby/object:Gem::Version
234
234
  version: '0'
235
235
  requirements: []
236
- rubygems_version: 3.6.9
236
+ rubygems_version: 3.7.2
237
237
  specification_version: 4
238
238
  summary: 税金計算ライブラリ
239
239
  test_files: []