luca-jp 0.20.2 → 0.20.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: a73bee2f25ed4af12e32ccc92d1c0ab5348c2bcac591c8a7607b0fb9a053c7c8
4
- data.tar.gz: f955ad158c4d83234e838411f9de681318a13dbba546f1b0fe79d6e0cba3cb98
3
+ metadata.gz: ea7c42dee2cf6b8002de5606bf2056714154a68bd4212762580029644f2f6607
4
+ data.tar.gz: f759cb53bf48adfe8148eb5f68f6f95a71c8b2decc103d63cfb6e4dce3fac2c9
5
5
  SHA512:
6
- metadata.gz: 7521797d4b074badbbc3e2c7f6a8e4a9469acb05df1e7a1acacef7e3570fbadbbcf167ce109de06171eb0c18d3a519907a9c233fb3c90a98611e9bd045c65aee
7
- data.tar.gz: 2aca672676e1fafe39865b4724ff259b99c191cfb049a99bcdc364d7ace00ba85724ad7931d95db4602a0b7fbe80af55f102a6b88f7fcd4c79776f735702ebf9
6
+ metadata.gz: 3a5e412b5cb291bd2be9e39350385969e7ad6bb9f13b8f67c62b52bdc23a5f8aa226eee59cba6684d9d787bb0e6dff14b6b711113f9e5d2291d2e467419f7c7e
7
+ data.tar.gz: 92333c73665f5e7a06a6830a4e79f4cf67ee82b3f04f715efcd1136fe66ebdb3daee355693ceecfec1199b6f8c763ecd95c5af9d2907b0a6aefdfaf2ad10236e
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Luca
4
4
  module Jp
5
- VERSION = '0.20.2'
5
+ VERSION = '0.20.4'
6
6
  end
7
7
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LucaSalaryJp
4
- VERSION = '0.1.5'
4
+ VERSION = '0.2.1'
5
5
  end
@@ -39,14 +39,16 @@ class LucaSalary::Jp < LucaSalary::Base
39
39
  def self.year_total(profile, payment, date)
40
40
  raise '年末調整の対象となりません' if payment['1'] == 0
41
41
 
42
+ 給与等の金額 = JpNationalTax::IncomeTax.year_salary_taxable(payment['1'], date)
42
43
  payment.tap do |p|
43
- p['911'] = JpNationalTax::IncomeTax.basic_deduction(p['1'], date)
44
- p['916'] = 配偶者控除の金額(p['1'], profile['spouse'], date)
45
- p['917'] = 配偶者特別控除の金額(p['1'], profile['spouse'], date)
44
+ p['901'] = 給与等の金額
45
+ p['911'] = JpNationalTax::IncomeTax.basic_deduction(給与等の金額, date)
46
+ p['916'] = 配偶者控除の金額(給与等の金額, profile['spouse'], date)
47
+ p['917'] = 配偶者特別控除の金額(給与等の金額, profile['spouse'], date)
46
48
  p['918'] = 扶養控除の金額(profile['family'], date)
47
49
  p['912'] = ['201', '202', '204', '205'].map{ |cd| p[cd] }.compact.sum
48
- p['901'] = JpNationalTax::IncomeTax.year_salary_taxable(p['1'], date)
49
- p['941'] = p['901'] - ['911', '912', '916', '917', '918'].map{ |cd| p[cd] }.compact.sum
50
+ 課税給与所得金額 = 給与等の金額 - ['911', '912', '916', '917', '918'].map{ |cd| p[cd] }.compact.sum
51
+ p['941'] = (課税給与所得金額 / 1000).floor * 1000
50
52
  p['961'] = JpNationalTax::IncomeTax.year_tax(p['941'], date)
51
53
  diff = p['961'] - p['203']
52
54
  if diff.positive?
@@ -63,68 +65,23 @@ class LucaSalary::Jp < LucaSalary::Base
63
65
  end
64
66
  end
65
67
 
66
- def self.配偶者控除の金額(income, spouse, date)
67
- puts spouse
68
+ def self.配偶者控除の金額(salary, spouse, date)
68
69
  return nil if spouse.nil?
69
70
 
70
- puts spouse
71
71
  spouse_salary = JpNationalTax::IncomeTax.year_salary_taxable(spouse['income'][date.year.to_s] || 0, date)
72
- return 0 if spouse_salary > 480_000
73
-
74
- salary = JpNationalTax::IncomeTax.year_salary_taxable(income || 0, date)
75
- birth_date = spouse['birth_date'] || date
76
- if salary <= 9_000_000
77
- birth_date <= date.prev_year(70) ? 480_000 : 380_000
78
- elsif salary <= 9_500_000
79
- birth_date <= date.prev_year(70) ? 320_000 : 260_000
80
- elsif salary <= 10_000_000
81
- birth_date <= date.prev_year(70) ? 160_000 : 130_000
82
- else
83
- 0
84
- end
72
+ return 0 if spouse_salary > 580_000
73
+
74
+ JpNationalTax::IncomeTax.spouse_deduction(salary, spouse_salary, date, spouse['birth_date'])
85
75
  end
86
76
 
87
- def self.配偶者特別控除の金額(income, spouse, date)
77
+ def self.配偶者特別控除の金額(salary, spouse, date)
88
78
  return nil if spouse.nil?
89
-
90
- salary = JpNationalTax::IncomeTax.year_salary_taxable(income || 0, date)
91
79
  return 0 if salary > 10_000_000
92
80
 
93
81
  spouse_salary = JpNationalTax::IncomeTax.year_salary_taxable(spouse['income'][date.year.to_s] || 0, date)
94
- return 0 if spouse_salary <= 480_000
95
- return 0 if spouse_salary > 1_330_000
96
-
97
- if salary <= 9_000_000
98
- return 380_000 if spouse_salary <= 950_000
99
- return 360_000 if spouse_salary <= 1_000_000
100
- return 310_000 if spouse_salary <= 1_050_000
101
- return 260_000 if spouse_salary <= 1_100_000
102
- return 210_000 if spouse_salary <= 1_150_000
103
- return 160_000 if spouse_salary <= 1_200_000
104
- return 110_000 if spouse_salary <= 1_250_000
105
- return 60_000 if spouse_salary <= 1_300_000
106
- return 30_000
107
- elsif salary <= 9_500_000
108
- return 260_000 if spouse_salary <= 950_000
109
- return 240_000 if spouse_salary <= 1_000_000
110
- return 210_000 if spouse_salary <= 1_050_000
111
- return 180_000 if spouse_salary <= 1_100_000
112
- return 140_000 if spouse_salary <= 1_150_000
113
- return 110_000 if spouse_salary <= 1_200_000
114
- return 80_000 if spouse_salary <= 1_250_000
115
- return 40_000 if spouse_salary <= 1_300_000
116
- return 20_000
117
- else
118
- return 130_000 if spouse_salary <= 950_000
119
- return 120_000 if spouse_salary <= 1_000_000
120
- return 110_000 if spouse_salary <= 1_050_000
121
- return 90_000 if spouse_salary <= 1_100_000
122
- return 70_000 if spouse_salary <= 1_150_000
123
- return 60_000 if spouse_salary <= 1_200_000
124
- return 40_000 if spouse_salary <= 1_250_000
125
- return 20_000 if spouse_salary <= 1_300_000
126
- return 10_000
127
- end
82
+ return 0 if spouse_salary <= 580_000
83
+
84
+ JpNationalTax::IncomeTax.spouse_deduction(salary, spouse_salary, date, spouse['birth_date'])
128
85
  end
129
86
 
130
87
  def self.扶養控除の金額(family, date)
@@ -137,15 +94,8 @@ class LucaSalary::Jp < LucaSalary::Base
137
94
  birth_date = person['birth_date']
138
95
  return 0 if birth_date.nil?
139
96
 
140
- if birth_date > date.prev_year(16)
141
- 0
142
- elsif birth_date <= date.prev_year(70)
143
- person['live_with'] ? 580_000 : 480_000 # 老人扶養親族
144
- elsif birth_date <= date.prev_year(19) and birth_date > date.prev_year(23)
145
- 630_000 # 特定扶養親族
146
- else
147
- 380_000
148
- end
97
+ salary = JpNationalTax::IncomeTax.year_salary_taxable(person.dig('income', date.year.to_s) || 0, date)
98
+ JpNationalTax::IncomeTax.family_deduction(birth_date, date, salary, live_with: person['live_with'])
149
99
  end
150
100
 
151
101
  def self.扶養控除対象者の数(family, date)
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.2
4
+ version: 0.20.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chuma Takahiro
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-04-23 00:00:00.000000000 Z
11
+ date: 2026-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lucabook
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 0.1.3
75
+ version: 0.3.1
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 0.1.3
82
+ version: 0.3.1
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -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.10
211
+ rubygems_version: 3.4.20
212
212
  signing_key:
213
213
  specification_version: 4
214
214
  summary: JP tax extension for Luca