luca-jp 0.20.1 → 0.20.3
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/lib/luca/jp/version.rb +1 -1
- data/lib/luca_salary/jp/insurance.rb +5 -2
- data/lib/luca_salary/jp/version.rb +1 -1
- data/lib/luca_salary/jp.rb +30 -7
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 827562f80bb3c45d9b0058ba94e99c08e537c6e05288d695970b2b25420abf6d
|
|
4
|
+
data.tar.gz: c7b1dc9f95b4d5a0a0430a312d32eb17e679e8ca0e9a7679f0b28fb8d754b7fd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d48e2910162d833838b007ba484490f24db49b8ad22917cea36eb76abfa59366db5df2f674a17f80c602d12278b3cc02b2ed03c8b4856e1ca7f2caafa7ac265f
|
|
7
|
+
data.tar.gz: 2d14ba140686ec2957cd0d8b09e887aa9cc7dfc4816c4e9a9ebeeb9b96f43975576e5ab4d96d350c5efad30068495fef1ed5ed27533db29fb88f6b2f4127039e
|
data/lib/luca/jp/version.rb
CHANGED
|
@@ -23,8 +23,11 @@ class InsuranceJP < LucaRecord::Base
|
|
|
23
23
|
load_data(File.open(file_path))
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
def health_insurance_salary(rank)
|
|
27
|
-
|
|
26
|
+
def health_insurance_salary(rank, elder)
|
|
27
|
+
return nil if elder.nil?
|
|
28
|
+
|
|
29
|
+
category = elder ? 'insurance_elder_salary' : 'insurance_younger_salary'
|
|
30
|
+
round6(select_health_insurance(rank).dig(category))
|
|
28
31
|
end
|
|
29
32
|
|
|
30
33
|
def pension_salary(rank)
|
data/lib/luca_salary/jp.rb
CHANGED
|
@@ -21,7 +21,10 @@ class LucaSalary::Jp < LucaSalary::Base
|
|
|
21
21
|
扶養控除 = self.class.扶養控除対象者の数(profile['family'], Date.new(date.year, 12, 31))
|
|
22
22
|
{}.tap do |h|
|
|
23
23
|
select_code(profile, '1').each { |k, v| h[k] = v }
|
|
24
|
-
h['201'] = @insurance.health_insurance_salary(
|
|
24
|
+
h['201'] = @insurance.health_insurance_salary(
|
|
25
|
+
insurance_rank(profile),
|
|
26
|
+
介護保険?(profile['birth_date'])
|
|
27
|
+
)
|
|
25
28
|
h['202'] = @insurance.pension_salary(pension_rank(profile))
|
|
26
29
|
tax_base = self.class.sum_code(h, '1', income_tax_exception) - h['201'] - h['202']
|
|
27
30
|
h['203'] = JpNationalTax::IncomeTax.calc_kouran(tax_base, Date.today, 配偶者控除, 扶養控除)
|
|
@@ -29,21 +32,23 @@ class LucaSalary::Jp < LucaSalary::Base
|
|
|
29
32
|
select_code(profile, '3').each { |k, v| h[k] = v }
|
|
30
33
|
select_code(profile, '4').each { |k, v| h[k] = v }
|
|
31
34
|
h.merge!(amount_by_code(h))
|
|
32
|
-
h['id'] = profile.
|
|
35
|
+
h['id'] = profile.fetch('id')
|
|
33
36
|
end
|
|
34
37
|
end
|
|
35
38
|
|
|
36
39
|
def self.year_total(profile, payment, date)
|
|
37
40
|
raise '年末調整の対象となりません' if payment['1'] == 0
|
|
38
41
|
|
|
42
|
+
給与等の金額 = JpNationalTax::IncomeTax.year_salary_taxable(payment['1'], date)
|
|
39
43
|
payment.tap do |p|
|
|
40
|
-
p['
|
|
44
|
+
p['901'] = 給与等の金額
|
|
45
|
+
p['911'] = JpNationalTax::IncomeTax.basic_deduction(給与等の金額, date)
|
|
41
46
|
p['916'] = 配偶者控除の金額(p['1'], profile['spouse'], date)
|
|
42
47
|
p['917'] = 配偶者特別控除の金額(p['1'], profile['spouse'], date)
|
|
43
48
|
p['918'] = 扶養控除の金額(profile['family'], date)
|
|
44
49
|
p['912'] = ['201', '202', '204', '205'].map{ |cd| p[cd] }.compact.sum
|
|
45
|
-
|
|
46
|
-
p['941'] =
|
|
50
|
+
課税給与所得金額 = 給与等の金額 - ['911', '912', '916', '917', '918'].map{ |cd| p[cd] }.compact.sum
|
|
51
|
+
p['941'] = (課税給与所得金額 / 1000).floor * 1000
|
|
47
52
|
p['961'] = JpNationalTax::IncomeTax.year_tax(p['941'], date)
|
|
48
53
|
diff = p['961'] - p['203']
|
|
49
54
|
if diff.positive?
|
|
@@ -149,14 +154,32 @@ class LucaSalary::Jp < LucaSalary::Base
|
|
|
149
154
|
family.map { |person| 各家族の扶養控除の額(person, date) > 0 ? 1 : 0 }.sum
|
|
150
155
|
end
|
|
151
156
|
|
|
152
|
-
|
|
153
|
-
|
|
157
|
+
private
|
|
158
|
+
|
|
159
|
+
# 満40歳に達したときより徴収が始まり、満65歳に達したときより徴収されなくなる
|
|
160
|
+
#
|
|
161
|
+
def 介護保険?(birth_date)
|
|
162
|
+
return nil if birth_date.nil?
|
|
163
|
+
|
|
164
|
+
due_init = birth_date.next_year(40).prev_day
|
|
165
|
+
return false if @date.year < due_init.year
|
|
166
|
+
return false if @date.year == due_init.year && @date.month < due_init.month
|
|
167
|
+
|
|
168
|
+
due_last = birth_date.next_year(65).prev_day
|
|
169
|
+
return false if @date.year > due_last.year
|
|
170
|
+
return false if @date.year == due_last.year && @date.month >= due_last.month
|
|
171
|
+
|
|
172
|
+
true
|
|
154
173
|
end
|
|
155
174
|
|
|
156
175
|
def insurance_rank(dat)
|
|
157
176
|
dat.dig('insurance', 'rank')
|
|
158
177
|
end
|
|
159
178
|
|
|
179
|
+
def income_tax_exception
|
|
180
|
+
%w[116 118 119 11A 11B]
|
|
181
|
+
end
|
|
182
|
+
|
|
160
183
|
def pension_rank(dat)
|
|
161
184
|
dat.dig('pension', 'rank')
|
|
162
185
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: luca-jp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.20.
|
|
4
|
+
version: 0.20.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chuma Takahiro
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-01-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: lucabook
|
|
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
208
208
|
- !ruby/object:Gem::Version
|
|
209
209
|
version: '0'
|
|
210
210
|
requirements: []
|
|
211
|
-
rubygems_version: 3.4.
|
|
211
|
+
rubygems_version: 3.4.20
|
|
212
212
|
signing_key:
|
|
213
213
|
specification_version: 4
|
|
214
214
|
summary: JP tax extension for Luca
|