lucasalary-jp 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c7fff7c7b40c95899b960a3c507508cfd073514123ca0e6c0ab6cf2a6a47c7c
4
- data.tar.gz: c2e35dcf8879de84427e7a26e46e5c67f6b8281cb4ac121adeebd536887f16dc
3
+ metadata.gz: 79df374d28e6787c5ddee481b510da82ba86ded7467f01792b46b265187cd4cb
4
+ data.tar.gz: 9c7d6ce6d23d90f6e7f7926905170bf31faf33322887a9c052ca6895d523c3d3
5
5
  SHA512:
6
- metadata.gz: 259a1429a5bf2e542213aaf6f9f83ac9628b77d7fc7b51537c52017b25cb43258eee3131b5e6e5e9f15a407f3ba10b046cee64313a1a660848ea812e013017a6
7
- data.tar.gz: 5225c85430a43e60516f40b5be8582448b501df056351e7b303809d1fa90b0d1d5a0d295af8cfa8846ffdc2822282d36c3f50770640cf2ae474dac8422fa5dd9
6
+ metadata.gz: 3ecd8d4e8201ed5065350af75317660d21dfdc4ae8c51aac82c4a8023c572c88cf3672a38a9b927c068a86953aca8862fe2510aeaf852cb0746dcfece47f799f
7
+ data.tar.gz: 23317f9bf049e2f270cae00554c3da16b152bf83a216932c06cebb4ec22cb6643045d644766ca9d8423e7be3e022850d4492afda08bb3b62c9ef10260d0b18c0
@@ -31,14 +31,14 @@ class LucaSalary::Jp < LucaSalary::Base
31
31
  end
32
32
  end
33
33
 
34
- def self.year_total(payment)
34
+ def self.year_total(payment, date)
35
35
  payment.tap do |p|
36
- p['911'] = basic_deduction(p['1'])
36
+ p['911'] = JpNationalTax::IncomeTax.basic_deduction(p['1'], date)
37
37
  p['916'] = partner_deduction(p['1'])
38
38
  p['912'] = (p['201'] || 0) + (p['202'] || 0)
39
- p['901'] = year_salary(p['1'])
39
+ p['901'] = JpNationalTax::IncomeTax.year_salary_taxable(p['1'], date)
40
40
  p['941'] = p['901'] - p['911'] - p['912'] - p['916']
41
- p['961'] = year_tax(p['941'])
41
+ p['961'] = JpNationalTax::IncomeTax.year_tax(p['941'], date)
42
42
  diff = p['961'] - p['203']
43
43
  if diff.positive?
44
44
  p['3A1'] = diff
@@ -48,74 +48,6 @@ class LucaSalary::Jp < LucaSalary::Base
48
48
  end
49
49
  end
50
50
 
51
- def self.year_salary(income)
52
- rounded = if income < 1_619_000
53
- income
54
- elsif income < 1_620_000
55
- income - ((income - 1_619_000) % 1_000)
56
- elsif income < 1_624_000
57
- income - ((income - 1_620_000) % 2_000)
58
- elsif income < 1_624_000
59
- income - ((income - 1_624_000) % 4_000)
60
- else
61
- income
62
- end
63
- if rounded < 551_000
64
- 0
65
- elsif rounded < 1_619_000
66
- rounded - 550_000
67
- elsif rounded < 1_620_000
68
- rounded * 0.6 + 97_600
69
- elsif rounded < 1_622_000
70
- rounded * 0.6 + 98_000
71
- elsif rounded < 1_624_000
72
- rounded * 0.6 + 98_800
73
- elsif rounded < 1_628_000
74
- rounded * 0.6 + 99_600
75
- elsif rounded < 1_800_000
76
- rounded * 0.6 + 100_000
77
- elsif rounded < 3_600_000
78
- rounded * 0.7 - 80_000
79
- elsif rounded < 6_600_000
80
- rounded * 0.8 - 440_000
81
- elsif rounded < 8_500_000
82
- rounded * 0.9 - 1_100_000
83
- else
84
- rounded - 1_950_000
85
- end
86
- end
87
-
88
- def self.year_tax(income)
89
- tax = if income < 1_950_000
90
- income * 0.05
91
- elsif income <= 3_300_000
92
- income * 0.1 - 97_500
93
- elsif income <= 6_950_000
94
- income * 0.2 - 427_500
95
- elsif income <= 9_000_000
96
- income * 0.23 - 636_000
97
- elsif income <= 18_000_000
98
- income * 0.33 - 1_536_000
99
- elsif income <= 18_050_000
100
- income * 0.4 - 2_796_000
101
- else
102
- raise "no target"
103
- end
104
- (tax / 1000).floor * 1000
105
- end
106
-
107
- def self.basic_deduction(income)
108
- if income <= 24_000_000
109
- 480_000
110
- elsif income <= 24_500_000
111
- 320_000
112
- elsif income <= 25_000_000
113
- 160_000
114
- else
115
- 0
116
- end
117
- end
118
-
119
51
  def self.partner_deduction(income)
120
52
  if income <= 9_000_000
121
53
  380_000
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LucaSalaryJp
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lucasalary-jp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chuma Takahiro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-30 00:00:00.000000000 Z
11
+ date: 2021-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lucasalary
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  - !ruby/object:Gem::Version
108
108
  version: '0'
109
109
  requirements: []
110
- rubygems_version: 3.1.2
110
+ rubygems_version: 3.2.3
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: LucaSalary calculation molule for Japan