luca-jp 0.17.0 → 0.17.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/luca/jp/aoiro.rb +106 -20
- data/lib/luca/jp/common.rb +10 -4
- data/lib/luca/jp/templates/beppyo1.xml.erb +11 -2
- data/lib/luca/jp/templates/beppyo4.xml.erb +24 -19
- data/lib/luca/jp/util.rb +2 -2
- data/lib/luca/jp/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37f8b7dcf7b6a6a2f5d5ae058b87bbf7435de5b14f5d7a67ada3076a6a2f2455
|
4
|
+
data.tar.gz: 9a4178240a2afc5f19684e7789bda38c55c658bacb8967a9dfe8a05839841143
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95b9c21014bb450d76ad79e53c3968d3cb443276e645529ab60f774a32dc53caf39121082321bfdcf5f6616f87ebe8ff694e4c17ccf8a6844b83fdb39f3afb47
|
7
|
+
data.tar.gz: af47a5f2ec8e797d1b2150cf99c418bd486d4b905aa2a3de7982c6f54521e72ee2e2b9ba0ea0d241942884ca2c604a7969f23f2984905caf26eaec359842bba0
|
data/lib/luca/jp/aoiro.rb
CHANGED
@@ -36,14 +36,32 @@ module Luca
|
|
36
36
|
@地方法人税額 = 地方法人税額(@地方法人税課税標準)
|
37
37
|
@確定地方法人税額 = @税額.dig(:houjin, :chihou)
|
38
38
|
|
39
|
+
@所得税等の仮払額 = prepaid_tax('185F')
|
40
|
+
@所得税等の税額控除額 = [
|
41
|
+
@所得税等の仮払額,
|
42
|
+
@所得税等の損金不算入額
|
43
|
+
].compact.sum
|
39
44
|
@法人税中間納付 = prepaid_tax('1851')
|
40
45
|
@地方法人税中間納付 = prepaid_tax('1852')
|
46
|
+
@所得税等の還付額 = [@所得税等の税額控除額 - @確定法人税額, 0].max
|
47
|
+
@差引所得に対する法人税額 = [@確定法人税額 - @所得税等の税額控除額, 0].max
|
48
|
+
@法人税中間納付の還付額 = [@法人税中間納付 - @差引所得に対する法人税額, 0].max
|
49
|
+
@法人税未払 = [@差引所得に対する法人税額 - @法人税中間納付, 0].max
|
41
50
|
|
42
51
|
if export
|
43
52
|
{
|
44
53
|
kokuzei: {
|
45
54
|
zeigaku: @確定法人税額,
|
46
|
-
|
55
|
+
shotoku: {
|
56
|
+
karibarai: @所得税等の仮払額,
|
57
|
+
kanpu: @所得税等の還付額,
|
58
|
+
modori: [@所得税等の還付額 - @所得税等の仮払額, 0].max
|
59
|
+
},
|
60
|
+
chukan: {
|
61
|
+
karibarai: @法人税中間納付,
|
62
|
+
kanpu: @法人税中間納付の還付額
|
63
|
+
},
|
64
|
+
mibarai: @法人税未払
|
47
65
|
},
|
48
66
|
chihou: {
|
49
67
|
zeigaku: @確定地方法人税額,
|
@@ -87,20 +105,48 @@ module Luca
|
|
87
105
|
|
88
106
|
def export_json(ext_config: nil, raw: false)
|
89
107
|
dat = kani(export: true, ext_config: ext_config)
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
108
|
+
item = {
|
109
|
+
'date' => @end_date,
|
110
|
+
'debit' => [],
|
111
|
+
'credit' => [],
|
112
|
+
'x-editor' => 'LucaJp'
|
113
|
+
}
|
114
|
+
item['debit'] << { 'label' => '法人税、住民税及び事業税', 'amount' => dat[:kokuzei][:zeigaku] }
|
115
|
+
確定仕訳所得税(item, dat)
|
116
|
+
確定仕訳国税(item, dat)
|
117
|
+
item['debit'] << { 'label' => '法人税、住民税及び事業税', 'amount' => dat[:chihou][:zeigaku] } if dat[:chihou][:zeigaku] > 0
|
118
|
+
確定仕訳地方税(item, dat)
|
119
|
+
res = [item]
|
120
|
+
|
121
|
+
raw ? res : JSON.dump(res)
|
122
|
+
end
|
123
|
+
|
124
|
+
def 確定仕訳所得税(item, dat)
|
125
|
+
if dat.dig(:kokuzei, :shotoku, :karibarai) > 0
|
126
|
+
item['credit'] << { 'label' => '仮払所得税', 'amount' => dat[:kokuzei][:shotoku][:karibarai] }
|
97
127
|
end
|
98
|
-
if dat[:kokuzei][:
|
99
|
-
item['debit'] << { 'label' => '未収法人税', 'amount' => dat[:kokuzei][:
|
100
|
-
else
|
101
|
-
item['credit'] << { 'label' => '未払法人税', 'amount' => dat[:kokuzei][:zeigaku] - dat[:kokuzei][:chukan] }
|
128
|
+
if dat[:kokuzei][:shotoku][:kanpu] > 0
|
129
|
+
item['debit'] << { 'label' => '未収法人税', 'amount' => dat[:kokuzei][:shotoku][:kanpu] }
|
102
130
|
end
|
103
|
-
|
131
|
+
if dat[:kokuzei][:shotoku][:modori] > 0
|
132
|
+
# TODO: 損金経理する所得税の補助科目追加
|
133
|
+
item['credit'] << { 'label' => '法人税、住民税及び事業税', 'amount' => dat[:kokuzei][:shotoku][:modori] }
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
def 確定仕訳国税(item, dat)
|
138
|
+
if dat.dig(:kokuzei, :chukan, :karibarai) > 0
|
139
|
+
item['credit'] << { 'label' => '仮払法人税', 'amount' => dat[:kokuzei][:chukan][:karibarai] }
|
140
|
+
end
|
141
|
+
if dat.dig(:kokuzei, :chukan, :kanpu) > 0
|
142
|
+
item['debit'] << { 'label' => '未収法人税', 'amount' => dat[:kokuzei][:chukan][:kanpu] }
|
143
|
+
end
|
144
|
+
if dat[:kokuzei][:mibarai] > 0
|
145
|
+
item['credit'] << { 'label' => '未払法人税', 'amount' => dat[:kokuzei][:mibarai] }
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
def 確定仕訳地方税(item, dat)
|
104
150
|
if dat[:chihou][:chukan] > 0
|
105
151
|
item['credit'] << { 'label' => '仮払法人税(地方)', 'amount' => dat[:chihou][:chukan] }
|
106
152
|
end
|
@@ -109,11 +155,6 @@ module Luca
|
|
109
155
|
else
|
110
156
|
item['credit'] << { 'label' => '未払法人税', 'amount' => dat[:chihou][:zeigaku] - dat[:chihou][:chukan] }
|
111
157
|
end
|
112
|
-
item['debit'] << { 'label' => '法人税、住民税及び事業税', 'amount' => dat[:chihou][:zeigaku] } if dat[:chihou][:zeigaku] > 0
|
113
|
-
item['x-editor'] = 'LucaJp'
|
114
|
-
res << item
|
115
|
-
|
116
|
-
raw ? res : JSON.dump(res)
|
117
158
|
end
|
118
159
|
|
119
160
|
def 別表一
|
@@ -183,8 +224,6 @@ module Luca
|
|
183
224
|
@受取配当金の益金不算入額,
|
184
225
|
@受贈益の益金不算入額,
|
185
226
|
].compact.sum
|
186
|
-
@別表四調整所得留保 = @当期純損益 + @損金不算入額留保 - @益金不算入額留保
|
187
|
-
@別表四調整所得社外流出 = @当期純損益 + @損金不算入額社外流出 - @益金不算入額社外流出
|
188
227
|
# TODO: 寄付金、所得税額控除、外国法人税の損金不算入調整
|
189
228
|
|
190
229
|
render_erb(search_template('beppyo4.xml.erb'))
|
@@ -411,6 +450,53 @@ module Luca
|
|
411
450
|
false
|
412
451
|
end
|
413
452
|
|
453
|
+
# 加算・減算欄の調整
|
454
|
+
def 別表四調整所得仮計
|
455
|
+
損金不算入額仮計 = [
|
456
|
+
@減価償却の償却超過額,
|
457
|
+
@役員給与の損金不算入額,
|
458
|
+
@交際費等の損金不算入額,
|
459
|
+
@当期還付事業税
|
460
|
+
].compact.sum
|
461
|
+
|
462
|
+
益金不算入額仮計 = [
|
463
|
+
@納付事業税,
|
464
|
+
@事業税中間納付,
|
465
|
+
@減価償却超過額の当期認容額,
|
466
|
+
@受取配当金の益金不算入額,
|
467
|
+
@受贈益の益金不算入額,
|
468
|
+
].compact.sum
|
469
|
+
|
470
|
+
@税引前損益 + 損金不算入額仮計 - 益金不算入額仮計
|
471
|
+
end
|
472
|
+
|
473
|
+
def 別表四調整所得仮計留保
|
474
|
+
@当期純損益 + @損金不算入額留保 - @益金不算入額留保
|
475
|
+
end
|
476
|
+
|
477
|
+
def 別表四調整所得仮計社外流出
|
478
|
+
@当期純損益 + @損金不算入額社外流出 - @益金不算入額社外流出
|
479
|
+
end
|
480
|
+
|
481
|
+
# 損金経理した税額控除対象額の調整
|
482
|
+
def 別表四調整所得合計
|
483
|
+
[
|
484
|
+
別表四調整所得仮計,
|
485
|
+
@所得税等の損金不算入額,
|
486
|
+
].compact.sum
|
487
|
+
end
|
488
|
+
|
489
|
+
def 別表四調整所得合計留保
|
490
|
+
別表四調整所得仮計留保
|
491
|
+
end
|
492
|
+
|
493
|
+
def 別表四調整所得合計社外流出
|
494
|
+
[
|
495
|
+
別表四調整所得仮計社外流出,
|
496
|
+
@所得税等の損金不算入額,
|
497
|
+
].compact.sum
|
498
|
+
end
|
499
|
+
|
414
500
|
def 別表四還付法人税等金額
|
415
501
|
refund_tax()
|
416
502
|
end
|
data/lib/luca/jp/common.rb
CHANGED
@@ -82,6 +82,8 @@ module Luca
|
|
82
82
|
@減価償却の償却超過額 = ext_config.dig('損金不算入', '減価償却')
|
83
83
|
@役員給与の損金不算入額 = ext_config.dig('損金不算入', '役員給与')
|
84
84
|
@交際費等の損金不算入額 = ext_config.dig('損金不算入', '交際費')
|
85
|
+
# 損金不算入額は損金経理したもの、税額控除額は仮払経理したもの
|
86
|
+
@所得税等の損金不算入額 = ext_config.dig('損金不算入', '所得税')
|
85
87
|
@減価償却超過額の当期認容額 = ext_config.dig('益金不算入', '減価償却')
|
86
88
|
@受取配当金の益金不算入額 = ext_config.dig('益金不算入', '受取配当金')
|
87
89
|
@受贈益の益金不算入額 = ext_config.dig('益金不算入', '受贈益')
|
@@ -92,6 +94,7 @@ module Luca
|
|
92
94
|
@減価償却の償却超過額,
|
93
95
|
@役員給与の損金不算入額,
|
94
96
|
@交際費等の損金不算入額,
|
97
|
+
@所得税等の損金不算入額,
|
95
98
|
@当期還付事業税
|
96
99
|
].compact.sum
|
97
100
|
|
@@ -107,6 +110,11 @@ module Luca
|
|
107
110
|
].compact.sum
|
108
111
|
|
109
112
|
@別表四調整所得 = @税引前損益 + @損金不算入額税額未確定 - @益金不算入額税額未確定
|
113
|
+
# 税引前損益に含まれない税額控除対象所得税の認識
|
114
|
+
@所得税等の損金不算入額 = [
|
115
|
+
@所得税等の損金不算入額,
|
116
|
+
prepaid_tax('H115')
|
117
|
+
].compact.sum
|
110
118
|
end
|
111
119
|
|
112
120
|
# -----------------------------------------------------
|
@@ -114,9 +122,7 @@ module Luca
|
|
114
122
|
# -----------------------------------------------------
|
115
123
|
|
116
124
|
def 期首繰越損失
|
117
|
-
@繰越損失管理.
|
118
|
-
.filter { |record| record['start_date'] > @end_date.prev_year(10) && record['end_date'] < @start_date }
|
119
|
-
.inject(0) { |sum, record| sum + (record['amount'] || 0) }
|
125
|
+
翌期繰越損失 + @繰越損失管理.deduction
|
120
126
|
end
|
121
127
|
|
122
128
|
def 当期控除計
|
@@ -126,7 +132,7 @@ module Luca
|
|
126
132
|
def 翌期繰越損失
|
127
133
|
@繰越損失管理.records
|
128
134
|
.filter { |record| record['start_date'] > @end_date.prev_year(10) && record['end_date'] < @start_date }
|
129
|
-
.inject(0) { |sum, record| sum
|
135
|
+
.inject(0) { |sum, record| [sum, record['amount']].compact.sum }
|
130
136
|
end
|
131
137
|
|
132
138
|
def 当期繰越損失
|
@@ -43,10 +43,19 @@
|
|
43
43
|
<BGB00120>
|
44
44
|
<%= render_attr('BGB00150', @法人税額) %>
|
45
45
|
</BGB00120>
|
46
|
-
<%= render_attr('
|
46
|
+
<%= render_attr('BGB00180', [@確定法人税額, @所得税等の税額控除額].min) %>
|
47
|
+
<%= render_attr('BGB00190', @差引所得に対する法人税額) %>
|
47
48
|
<%= render_attr('BGB00200', @法人税中間納付) %>
|
48
|
-
<%= render_attr('BGB00210',
|
49
|
+
<%= render_attr('BGB00210', @法人税未払) %>
|
50
|
+
<BGB00220>
|
51
|
+
<%= render_attr('BGB00230', @所得税等の税額控除額) %>
|
52
|
+
<%# BGB00240 外国税額 %>
|
53
|
+
<%= render_attr('BGB00250', @所得税等の税額控除額) %>
|
54
|
+
<%= render_attr('BGB00260', @所得税等の税額控除額 - @所得税等の還付額) %>
|
55
|
+
<%= render_attr('BGB00270', @所得税等の還付額) %>
|
56
|
+
</BGB00220>
|
49
57
|
<BGB00320>
|
58
|
+
<%= render_attr('BGB00330', @所得税等の還付額) %>
|
50
59
|
<%= render_attr('BGB00340', 中間還付税額(@確定法人税額, @法人税中間納付)) %>
|
51
60
|
<BGB00380>
|
52
61
|
<%= render_attr('BGB00400', 中間還付税額(@確定法人税額, @法人税中間納付)) %>
|
@@ -101,52 +101,57 @@
|
|
101
101
|
</ARD00280>
|
102
102
|
</ARD00000>
|
103
103
|
<ARE00000>
|
104
|
-
<%= render_attr('ARE00010',
|
105
|
-
<%= render_attr('ARE00020',
|
104
|
+
<%= render_attr('ARE00010', 別表四調整所得仮計) %>
|
105
|
+
<%= render_attr('ARE00020', 別表四調整所得仮計留保) %>
|
106
106
|
<ARE00030>
|
107
|
-
<%= render_attr('ARE00050',
|
107
|
+
<%= render_attr('ARE00050', 別表四調整所得仮計社外流出) %>
|
108
108
|
</ARE00030>
|
109
109
|
</ARE00000>
|
110
110
|
<ARZ10000>
|
111
|
-
<%= render_attr('ARZ10010',
|
112
|
-
<%= render_attr('ARZ10020',
|
111
|
+
<%= render_attr('ARZ10010', 別表四調整所得仮計) %>
|
112
|
+
<%= render_attr('ARZ10020', 別表四調整所得仮計留保) %>
|
113
113
|
<ARZ10030>
|
114
|
-
<%= render_attr('ARZ10050',
|
114
|
+
<%= render_attr('ARZ10050', 別表四調整所得仮計社外流出) %>
|
115
115
|
</ARZ10030>
|
116
116
|
</ARZ10000>
|
117
117
|
<%# ARF00000 寄附金の損金不算入額 %>
|
118
|
-
|
118
|
+
<% if @所得税等の損金不算入額 %>
|
119
|
+
<ARI00000>
|
120
|
+
<%= render_attr('ARI00010', @所得税等の損金不算入額) %>
|
121
|
+
<%= render_attr('ARI00020', @所得税等の損金不算入額) %>
|
122
|
+
</ARI00000>
|
123
|
+
<% end %>
|
119
124
|
<%# ARJ00000 税額控除の対象となる外国法人税の額 %>
|
120
125
|
<ARK00000>
|
121
|
-
<%= render_attr('ARK00010',
|
122
|
-
<%= render_attr('ARK00020',
|
126
|
+
<%= render_attr('ARK00010', 別表四調整所得合計) %>
|
127
|
+
<%= render_attr('ARK00020', 別表四調整所得合計留保) %>
|
123
128
|
<ARK00030>
|
124
|
-
<%= render_attr('ARK00050',
|
129
|
+
<%= render_attr('ARK00050', 別表四調整所得合計社外流出) %>
|
125
130
|
</ARK00030>
|
126
131
|
</ARK00000>
|
127
132
|
<ARM00000>
|
128
|
-
<%= render_attr('ARM00010',
|
129
|
-
<%= render_attr('ARM00020',
|
133
|
+
<%= render_attr('ARM00010', 別表四調整所得合計) %>
|
134
|
+
<%= render_attr('ARM00020', 別表四調整所得合計留保) %>
|
130
135
|
<ARM00030>
|
131
|
-
<%= render_attr('ARM00050',
|
136
|
+
<%= render_attr('ARM00050', 別表四調整所得合計社外流出) %>
|
132
137
|
</ARM00030>
|
133
138
|
</ARM00000>
|
134
139
|
<%# ARN10010 中間申告における繰戻しによる還付に係る災害損失欠損金額の益金算入額 %>
|
135
140
|
<%# ARR00000 非適格合併又は残余財産の全部分配等による移転資産等の譲渡利益額又は譲渡損失額 %>
|
136
141
|
<ARS00000>
|
137
142
|
<%= render_attr('ARS00010', @別表四調整所得) %>
|
138
|
-
<%= render_attr('ARS00020',
|
143
|
+
<%= render_attr('ARS00020', 別表四調整所得合計留保) %>
|
139
144
|
<ARS00030>
|
140
|
-
<%= render_attr('ARS00050',
|
145
|
+
<%= render_attr('ARS00050', 別表四調整所得合計社外流出) %>
|
141
146
|
</ARS00030>
|
142
147
|
</ARS00000>
|
143
148
|
<%# ARS10000 更生欠損金又は民事再生等評価換えが行われる場合の再生等欠損金の損金算入額 %>
|
144
149
|
<%# ARS20000 通算対象欠損金額の損金算入額又は通算対象所得金額の益金算入額 %>
|
145
150
|
<ARS50000>
|
146
151
|
<%= render_attr('ARS50010', @別表四調整所得) %>
|
147
|
-
<%= render_attr('ARS50020',
|
152
|
+
<%= render_attr('ARS50020', 別表四調整所得合計留保) %>
|
148
153
|
<ARS50030>
|
149
|
-
<%= render_attr('ARS50050',
|
154
|
+
<%= render_attr('ARS50050', 別表四調整所得合計社外流出) %>
|
150
155
|
</ARS50030>
|
151
156
|
</ARS50000>
|
152
157
|
<ART00000>
|
@@ -157,9 +162,9 @@
|
|
157
162
|
<%# ARX00000 残余財産の確定の日の属する事業年度に係る事業税及び特別法人事業税の損金算入額 %>
|
158
163
|
<ARV00000>
|
159
164
|
<%= render_attr('ARV00010', @別表四調整所得 - @繰越損失管理.deduction) %>
|
160
|
-
<%= render_attr('ARV00020',
|
165
|
+
<%= render_attr('ARV00020', 別表四調整所得合計留保) %>
|
161
166
|
<ARV00030>
|
162
|
-
<%= render_attr('ARV00050',
|
167
|
+
<%= render_attr('ARV00050', 別表四調整所得合計社外流出 - @繰越損失管理.deduction) %>
|
163
168
|
</ARV00030>
|
164
169
|
</ARV00000>
|
165
170
|
</HOA420>
|
data/lib/luca/jp/util.rb
CHANGED
@@ -24,10 +24,10 @@ module Luca
|
|
24
24
|
# TODO: customerオプションを適切に扱うには
|
25
25
|
# 納付時にx-customerを付加していないケースの考慮が必要
|
26
26
|
def prepaid_tax(code, customer = nil)
|
27
|
-
search_end = @end_date.
|
27
|
+
search_end = @end_date.prev_day # exclude year end adjustment
|
28
28
|
# header = { customer: customer } unless customer.nil?
|
29
29
|
header = nil
|
30
|
-
amount, _ = self.class.net(@start_date.year, @start_date.month,
|
30
|
+
amount, _ = self.class.net(@start_date.year, @start_date.month, date_range: @start_date..search_end, code: code, header: header)
|
31
31
|
LucaSupport::Code.readable(amount[code] || 0)
|
32
32
|
end
|
33
33
|
|
data/lib/luca/jp/version.rb
CHANGED
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.17.
|
4
|
+
version: 0.17.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chuma Takahiro
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lucabook
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.5.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.5.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: lucasalary
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|