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 +4 -4
- data/data//347/244/276/344/274/232/344/277/235/351/231/272/346/226/231//345/216/232/347/224/237/345/271/264/351/207/221.tsv +1 -1
- data/lib/tax_jp/corporate_taxes/db_builder.rb +1 -1
- data/lib/tax_jp/depreciation_rates/db_builder.rb +1 -1
- data/lib/tax_jp/social_insurance.rb +14 -14
- data/lib/tax_jp/social_insurances/db_builder.rb +4 -4
- data/lib/tax_jp/social_insurances/health_insurance.rb +12 -0
- data/lib/tax_jp/social_insurances/welfare_pension.rb +0 -3
- data/lib/tax_jp/version.rb +1 -1
- data/lib/tax_jp/withheld_taxes/monthly_db_builder.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: 07b7f56733bbf993a3a5ceac2a0005411c1244798d5d28b0b3876482d998d654
|
|
4
|
+
data.tar.gz: 6a9d6c3f4c1aa132e5f297288acaa24bdbbc32ddbd80051396afaa9e8398048f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 784e6c01a44183f175c452d478f363542bf6886fd5805eb95dc3abf038b454fb2ebde7e10f5063d38f631c1468e1a66aff3b238af43723ada20f9e0bf60c5483
|
|
7
|
+
data.tar.gz: 697ece7adafb0633ee820b2415bde627d0dc07f13dad31718bbe1ef448d095df15ba376eeb8e71abb0b5c4a37421e54673c439c1025c405a66a6c878cf4e278a
|
|
@@ -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, :
|
|
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, :
|
|
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
|
-
:
|
|
25
|
-
:
|
|
26
|
-
:
|
|
27
|
-
:
|
|
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
|
-
:
|
|
31
|
-
:
|
|
32
|
-
:
|
|
33
|
-
:
|
|
34
|
-
:
|
|
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
|
-
:
|
|
38
|
-
:
|
|
39
|
-
:
|
|
40
|
-
:
|
|
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, :
|
|
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, :
|
|
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, :
|
|
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, :
|
|
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
|
|
data/lib/tax_jp/version.rb
CHANGED
|
@@ -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, :
|
|
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.
|
|
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.
|
|
236
|
+
rubygems_version: 3.7.2
|
|
237
237
|
specification_version: 4
|
|
238
238
|
summary: 税金計算ライブラリ
|
|
239
239
|
test_files: []
|