luca-jp 0.1.2 → 0.1.7
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.rb +8 -0
- data/lib/luca/jp/aoiro.rb +174 -43
- data/lib/luca/jp/chihouzei.rb +71 -13
- data/lib/luca/jp/common.rb +64 -8
- data/lib/luca/jp/it_part.rb +4 -1
- data/lib/luca/jp/sonshitsu.rb +102 -0
- data/lib/luca/jp/syouhizei.rb +6 -5
- data/lib/luca/jp/templates/beppyo1.xml.erb +3 -1
- data/lib/luca/jp/templates/beppyo4.xml.erb +34 -12
- data/lib/luca/jp/templates/beppyo51.xml.erb +14 -7
- data/lib/luca/jp/templates/beppyo52.xml.erb +50 -13
- data/lib/luca/jp/templates/beppyo7.xml.erb +31 -0
- data/lib/luca/jp/templates/el-no6-9.xml.erb +51 -0
- data/lib/luca/jp/templates/el-no6.xml.erb +16 -24
- data/lib/luca/jp/templates/eltax-userinf.xml.erb +20 -0
- data/lib/luca/jp/templates/fuhyo53.xml.erb +1 -1
- data/lib/luca/jp/templates/syouhizei-shinkoku-kanni.xml.erb +3 -1
- data/lib/luca/jp/util.rb +21 -1
- data/lib/luca/jp/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4040cfe74aa1a54345ead8ecae4ef23bfb7afcb45add127ae244c955caddf4b7
|
4
|
+
data.tar.gz: d11e300d1a69fef846ffebdf58179f4c85206329b8f950baa2332e39416416e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 724fe70197721883fe486b603ef6e9239a6da2c813165d5322a45ee927bead70d7fe54085fc4ab3d7ecf63886b72f01acc261e2a9be1eb6a10009cb474b17d1e
|
7
|
+
data.tar.gz: 46bc67bcbf9bc7935d31fa10a31da6692138705933c0b90d57b415344278b53b942a24abc92eeaeeb8ed1753a79470b15133bbbf32a07c55c57a33ec5aac8d64
|
data/lib/luca/jp.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'luca/jp/version'
|
4
|
+
require 'luca_support/config'
|
4
5
|
|
5
6
|
module Luca
|
6
7
|
module Jp
|
@@ -10,6 +11,13 @@ module Luca
|
|
10
11
|
autoload :Chihouzei, 'luca/jp/chihouzei'
|
11
12
|
autoload :Common, 'luca/jp/common'
|
12
13
|
autoload :ItPart, 'luca/jp/it_part'
|
14
|
+
autoload :Sonshitsu, 'luca/jp/sonshitsu'
|
13
15
|
autoload :Util, 'luca/jp/util'
|
14
16
|
end
|
17
|
+
|
18
|
+
EX_CONF = begin
|
19
|
+
YAML.load_file(Pathname(LucaSupport::PJDIR) / 'config-lucajp.yml')
|
20
|
+
rescue Errno::ENOENT
|
21
|
+
nil
|
22
|
+
end
|
15
23
|
end
|
data/lib/luca/jp/aoiro.rb
CHANGED
@@ -24,8 +24,9 @@ module Luca
|
|
24
24
|
set_pl(4)
|
25
25
|
set_bs(4)
|
26
26
|
@issue_date = Date.today
|
27
|
-
@company = CGI.escapeHTML(
|
27
|
+
@company = CGI.escapeHTML(config.dig('company', 'name'))
|
28
28
|
@software = 'LucaJp'
|
29
|
+
|
29
30
|
@税額 = 税額計算
|
30
31
|
@確定法人税額 = @税額.dig(:houjin, :kokuzei)
|
31
32
|
@法人税額 = 中小企業の軽減税額 + 一般区分の税額
|
@@ -50,18 +51,24 @@ module Luca
|
|
50
51
|
@procedure_code = 'RHO0012'
|
51
52
|
@procedure_name = '内国法人の確定申告(青色)'
|
52
53
|
@version = '20.0.2'
|
53
|
-
|
54
|
-
|
54
|
+
@都道府県民税法人税割中間納付 = prepaid_tax('1859')
|
55
|
+
@都道府県民税均等割中間納付 = prepaid_tax('185A')
|
56
|
+
@都道府県民税中間納付 = @都道府県民税法人税割中間納付 + @都道府県民税均等割中間納付
|
57
|
+
@市民税法人税割中間納付 = prepaid_tax('185D')
|
58
|
+
@市民税均等割中間納付 = prepaid_tax('185E')
|
59
|
+
@市民税中間納付 = @市民税法人税割中間納付 + @市民税均等割中間納付
|
55
60
|
@法人税期中増, @法人税期中減 = 未納法人税期中増減
|
56
61
|
@都道府県民税期中増, @都道府県民税期中減 = 未納都道府県民税期中増減
|
57
62
|
@市民税期中増, @市民税期中減 = 未納市民税期中増減
|
58
63
|
@事業税期中増, @事業税期中減 = 未納事業税期中増減
|
64
|
+
@事業税中間納付 = prepaid_tax('1854') + prepaid_tax('1855') + prepaid_tax('1856') + prepaid_tax('1857') + prepaid_tax('1858')
|
59
65
|
@納税充当金期中増, @納税充当金期中減 = 納税充当金期中増減
|
66
|
+
@翌期還付法人税 = 中間還付税額(@確定法人税額 + @確定地方法人税額, @法人税中間納付 + @地方法人税中間納付)
|
60
67
|
@概況売上 = gaikyo('A0')
|
61
|
-
@form_sec = ['HOA112', 'HOA116', 'HOA201', 'HOA420', 'HOA511', 'HOA522', 'HOE200',
|
68
|
+
@form_sec = ['HOA112', 'HOA116', 'HOA201', 'HOA420', 'HOA511', 'HOA522', 別表七フォーム, 'HOE200', 適用額明細フォーム, 'HOI010', 'HOI100', 'HOI141', 'HOK010'].compact.map{ |c| form_rdf(c) }.join('')
|
62
69
|
#@extra_form_sec = ['HOI040', 'HOI060', 'HOI090', 'HOI110']
|
63
70
|
@it = it_part
|
64
|
-
@form_data = [別表一, 別表一次葉, 別表二, 別表四簡易, 別表五一, 別表五二, 別表十五, 適用額明細, 預貯金内訳, 仮受金内訳, 役員報酬内訳, 概況説明].join("\n")
|
71
|
+
@form_data = [別表一, 別表一次葉, 別表二, 別表四簡易, 別表五一, 別表五二, 別表七, 別表十五, 適用額明細, 預貯金内訳, 仮受金内訳, 役員報酬内訳, 概況説明].compact.join("\n")
|
65
72
|
render_erb(search_template('aoiro.xtx.erb'))
|
66
73
|
end
|
67
74
|
end
|
@@ -81,7 +88,7 @@ module Luca
|
|
81
88
|
else
|
82
89
|
item['credit'] << { 'label' => '未払法人税', 'amount' => dat[:kokuzei][:zeigaku] - dat[:kokuzei][:chukan] }
|
83
90
|
end
|
84
|
-
item['debit'] << { 'label' => '法人税、住民税及び事業税', 'amount' => dat[:kokuzei][:zeigaku] }
|
91
|
+
item['debit'] << { 'label' => '法人税、住民税及び事業税', 'amount' => dat[:kokuzei][:zeigaku] } if dat[:kokuzei][:zeigaku] > 0
|
85
92
|
if dat[:chihou][:chukan] > 0
|
86
93
|
item['credit'] << { 'label' => '仮払法人税(地方)', 'amount' => dat[:chihou][:chukan] }
|
87
94
|
end
|
@@ -90,7 +97,7 @@ module Luca
|
|
90
97
|
else
|
91
98
|
item['credit'] << { 'label' => '未払法人税', 'amount' => dat[:chihou][:zeigaku] - dat[:chihou][:chukan] }
|
92
99
|
end
|
93
|
-
item['debit'] << { 'label' => '法人税、住民税及び事業税', 'amount' => dat[:chihou][:zeigaku] }
|
100
|
+
item['debit'] << { 'label' => '法人税、住民税及び事業税', 'amount' => dat[:chihou][:zeigaku] } if dat[:chihou][:zeigaku] > 0
|
94
101
|
item['x-editor'] = 'LucaJp'
|
95
102
|
res << item
|
96
103
|
puts JSON.dump(res)
|
@@ -114,8 +121,17 @@ module Luca
|
|
114
121
|
@当期純損益 = readable(@pl_data.dig('HA'))
|
115
122
|
@法人税等 = readable(@pl_data.dig('H0'))
|
116
123
|
_, @納付事業税 = 未納事業税期中増減
|
117
|
-
|
118
|
-
|
124
|
+
@別表四調整所得 = @当期純損益 + @法人税等 - @納付事業税
|
125
|
+
|
126
|
+
@当期還付法人税 = refund_tax('1502')
|
127
|
+
@当期還付都道府県住民税 = refund_tax('1503')
|
128
|
+
@翌期還付都道府県住民税 = 中間還付税額(@税額.dig(:kenmin, :kintou), @都道府県民税均等割中間納付) + 中間還付税額(@税額.dig(:kenmin, :houjinzei), @都道府県民税法人税割中間納付)
|
129
|
+
@当期還付市民税 = refund_tax('1505')
|
130
|
+
@翌期還付市民税 = 中間還付税額(@税額.dig(:shimin, :kintou), @市民税均等割中間納付) + 中間還付税額(@税額.dig(:shimin, :houjinzei), @市民税法人税割中間納付)
|
131
|
+
@当期還付事業税 = 還付事業税
|
132
|
+
@事業税期首残高 = 期首未納事業税 > 0 ? 期首未納事業税 : (@当期還付事業税 * -1)
|
133
|
+
@翌期還付事業税 = 中間還付税額(確定事業税, @事業税中間納付)
|
134
|
+
@仮払税金 = @翌期還付法人税 + @翌期還付都道府県住民税 + @翌期還付事業税 + @翌期還付市民税
|
119
135
|
|
120
136
|
render_erb(search_template('beppyo4.xml.erb'))
|
121
137
|
end
|
@@ -125,10 +141,26 @@ module Luca
|
|
125
141
|
end
|
126
142
|
|
127
143
|
def 別表五二
|
144
|
+
@消費税中間納付額 = 消費税中間納付額 + 地方消費税中間納付額
|
145
|
+
@当期還付消費税 = refund_tax('1501')
|
146
|
+
@消費税期首残高 = 期首未納消費税 > 0 ? 期首未納消費税 : (@当期還付消費税 * -1)
|
147
|
+
@翌期還付消費税 = 中間還付税額(@消費税期中増, @消費税中間納付額)
|
128
148
|
@その他事業税 = 租税公課
|
129
149
|
render_erb(search_template('beppyo52.xml.erb'))
|
130
150
|
end
|
131
151
|
|
152
|
+
def 別表七フォーム
|
153
|
+
return nil if @繰越損失管理.records.length == 0
|
154
|
+
|
155
|
+
'HOB710'
|
156
|
+
end
|
157
|
+
|
158
|
+
def 別表七
|
159
|
+
return nil if @繰越損失管理.records.length == 0
|
160
|
+
|
161
|
+
render_erb(search_template('beppyo7.xml.erb'))
|
162
|
+
end
|
163
|
+
|
132
164
|
def 別表十五
|
133
165
|
@交際費 = readable(@pl_data.dig('C1B') || 0)
|
134
166
|
@限度額 = @交際費 < 4_000_000 ? @交際費 : 4_000_000
|
@@ -141,7 +173,7 @@ module Luca
|
|
141
173
|
next unless /^110[0-9A-Z]/.match(k)
|
142
174
|
next unless readable(v || 0) > 0
|
143
175
|
|
144
|
-
h[
|
176
|
+
h[@@dict.dig(k)[:label]] = readable(v)
|
145
177
|
end
|
146
178
|
render_erb(search_template('yokin-meisai.xml.erb'))
|
147
179
|
end
|
@@ -158,7 +190,15 @@ module Luca
|
|
158
190
|
render_erb(search_template('yakuin-meisai.xml.erb'))
|
159
191
|
end
|
160
192
|
|
193
|
+
def 適用額明細フォーム
|
194
|
+
return nil if @確定法人税額 == 0
|
195
|
+
|
196
|
+
'HOE990'
|
197
|
+
end
|
198
|
+
|
161
199
|
def 適用額明細
|
200
|
+
return nil if @確定法人税額 == 0
|
201
|
+
|
162
202
|
render_erb(search_template('tekiyougaku.xml.erb'))
|
163
203
|
end
|
164
204
|
|
@@ -212,13 +252,72 @@ module Luca
|
|
212
252
|
end
|
213
253
|
|
214
254
|
def 租税公課
|
215
|
-
readable(LucaBook::State.gross(@start_date.year, @start_date.month, @end_date.year, @end_date.month, code: 'C1I')[:debit]) || 0
|
255
|
+
readable(LucaBook::State.gross(@start_date.year, @start_date.month, @end_date.year, @end_date.month, code: 'C1I')[:debit]['C1I']) || 0
|
256
|
+
end
|
257
|
+
|
258
|
+
def 別表四還付法人税等金額
|
259
|
+
refund_tax()
|
216
260
|
end
|
217
261
|
|
218
262
|
def 別表四還付事業税
|
219
|
-
return nil if
|
263
|
+
return nil if @当期還付事業税 == 0
|
220
264
|
|
221
|
-
"<ARC00220><ARC00230>仮払事業税消却(未収計上した還付事業税)</ARC00230>#{render_attr('ARC00240',
|
265
|
+
"<ARC00220><ARC00230>仮払事業税消却(未収計上した還付事業税)</ARC00230>#{render_attr('ARC00240', @当期還付事業税)}#{render_attr('ARC00250', @当期還付事業税)}</ARC00220>\n"
|
266
|
+
end
|
267
|
+
|
268
|
+
def 別表五一仮払税金
|
269
|
+
未収仮払税金 = [@start_balance['1502'], @start_balance['1503'], @start_balance['1504'], @start_balance['1505']].compact.sum
|
270
|
+
還付税金 = [@当期還付法人税, @当期還付都道府県住民税, @当期還付事業税, @当期還付市民税].compact.sum
|
271
|
+
return '' if 未収仮払税金 == 0 && 還付税金 == 0 && @仮払税金 == 0
|
272
|
+
|
273
|
+
%Q(<ICB00140>
|
274
|
+
#{render_attr('ICB00150', '仮払税金')}
|
275
|
+
#{render_attr('ICB00160', 未収仮払税金 * -1)}
|
276
|
+
<ICB00170>
|
277
|
+
#{render_attr('ICB00190', 還付税金 * -1)}
|
278
|
+
#{render_attr('ICB00200', @仮払税金 * -1)}
|
279
|
+
</ICB00170>
|
280
|
+
#{render_attr('ICB00210', @仮払税金 * -1)}
|
281
|
+
</ICB00140>)
|
282
|
+
end
|
283
|
+
|
284
|
+
def 別表五一還付法人税
|
285
|
+
return '' if (@start_balance['1502']||0) == 0 && @翌期還付法人税 == 0
|
286
|
+
|
287
|
+
%Q(<ICB00220>
|
288
|
+
#{render_attr('ICB00230', @start_balance['1502'] || 0)}
|
289
|
+
<ICB00240>
|
290
|
+
#{render_attr('ICB00250', @当期還付法人税)}
|
291
|
+
#{render_attr('ICB00260', @翌期還付法人税)}
|
292
|
+
</ICB00240>
|
293
|
+
#{render_attr('ICB00270', @翌期還付法人税)}
|
294
|
+
</ICB00220>)
|
295
|
+
end
|
296
|
+
|
297
|
+
def 別表五一還付都道府県住民税
|
298
|
+
return '' if (@start_balance['1503']||0) == 0 && @翌期還付都道府県住民税 == 0
|
299
|
+
|
300
|
+
%Q(<ICB00280>
|
301
|
+
#{render_attr('ICB00290', @start_balance['1503'] || 0)}
|
302
|
+
<ICB00300>
|
303
|
+
#{render_attr('ICB00310', @当期還付都道府県住民税)}
|
304
|
+
#{render_attr('ICB00320', @翌期還付都道府県住民税)}
|
305
|
+
</ICB00300>
|
306
|
+
#{render_attr('ICB00330', @翌期還付都道府県住民税)}
|
307
|
+
</ICB00280>)
|
308
|
+
end
|
309
|
+
|
310
|
+
def 別表五一還付市民税
|
311
|
+
return '' if (@start_balance['1505']||0) == 0 && @翌期還付市民税 == 0
|
312
|
+
|
313
|
+
%Q(<ICB00340>
|
314
|
+
#{render_attr('ICB00350', @start_balance['1505'] || 0)}
|
315
|
+
<ICB00360>
|
316
|
+
#{render_attr('ICB00370', @当期還付市民税)}
|
317
|
+
#{render_attr('ICB00380', @翌期還付市民税)}
|
318
|
+
</ICB00360>
|
319
|
+
#{render_attr('ICB00390', @翌期還付市民税)}
|
320
|
+
</ICB00340>)
|
222
321
|
end
|
223
322
|
|
224
323
|
def 期首繰越損益
|
@@ -233,16 +332,11 @@ module Luca
|
|
233
332
|
readable(@start_balance.dig('515')) || 0
|
234
333
|
end
|
235
334
|
|
236
|
-
def 期末納税充当金
|
237
|
-
readable(@bs_data.dig('515')) || 0
|
238
|
-
end
|
239
|
-
|
240
335
|
def 納税充当金期中増減
|
241
|
-
r =
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
]
|
336
|
+
r = debit_amount('515', @start_date.year, @start_date.month, @end_date.year, @end_date.month)
|
337
|
+
納付 = 納付税額(@確定法人税額 + @確定地方法人税額, @法人税中間納付 + @地方法人税中間納付) + 期末未納都道府県民税 + 期末未納市民税 + 納付税額(確定事業税, @事業税中間納付)
|
338
|
+
|
339
|
+
[納付, readable(r)]
|
246
340
|
end
|
247
341
|
|
248
342
|
def 期首未納法人税
|
@@ -250,12 +344,12 @@ module Luca
|
|
250
344
|
end
|
251
345
|
|
252
346
|
def 期末未納法人税
|
253
|
-
|
347
|
+
納付税額(@確定法人税額 + @確定地方法人税額, @法人税中間納付 + @地方法人税中間納付)
|
254
348
|
end
|
255
349
|
|
256
350
|
def 未納法人税期中増減
|
257
|
-
r =
|
258
|
-
[
|
351
|
+
r = debit_amount('5151', @start_date.year, @start_date.month, @end_date.year, @end_date.month)
|
352
|
+
[(@確定法人税額 + @確定地方法人税額), readable(r)]
|
259
353
|
end
|
260
354
|
|
261
355
|
# 中間納付した金額のうち税額とならず、還付されるべき額
|
@@ -279,20 +373,21 @@ module Luca
|
|
279
373
|
end
|
280
374
|
|
281
375
|
def 期末未納都道府県民税
|
282
|
-
|
376
|
+
納付税額(@税額.dig(:kenmin, :kintou), @都道府県民税均等割中間納付) + 納付税額(@税額.dig(:kenmin, :houjinzei), @都道府県民税法人税割中間納付)
|
283
377
|
end
|
284
378
|
|
285
379
|
def 未納都道府県民税期中増減
|
286
|
-
r =
|
287
|
-
[
|
380
|
+
r = debit_amount('5153', @start_date.year, @start_date.month, @end_date.year, @end_date.month)
|
381
|
+
[確定都道府県住民税, readable(r)]
|
288
382
|
end
|
289
383
|
|
290
384
|
def 都道府県民税仮払納付
|
291
385
|
[(@都道府県民税中間納付 - 確定都道府県住民税), 0].max
|
386
|
+
中間還付税額(@税額.dig(:kenmin, :kintou), @都道府県民税均等割中間納付) + 中間還付税額(@税額.dig(:kenmin, :houjinzei), @都道府県民税法人税割中間納付)
|
292
387
|
end
|
293
388
|
|
294
389
|
def 都道府県民税損金納付
|
295
|
-
[
|
390
|
+
[@都道府県民税均等割中間納付, @税額.dig(:kenmin, :kintou)].min + [@都道府県民税法人税割中間納付, @税額.dig(:kenmin, :houjinzei)].min
|
296
391
|
end
|
297
392
|
|
298
393
|
def 確定市民税
|
@@ -304,20 +399,28 @@ module Luca
|
|
304
399
|
end
|
305
400
|
|
306
401
|
def 期末未納市民税
|
307
|
-
|
402
|
+
納付税額(@税額.dig(:shimin, :kintou), @市民税均等割中間納付) + 納付税額(@税額.dig(:shimin, :houjinzei), @市民税法人税割中間納付)
|
308
403
|
end
|
309
404
|
|
310
405
|
def 未納市民税期中増減
|
311
|
-
r =
|
312
|
-
[
|
406
|
+
r = debit_amount('5154', @start_date.year, @start_date.month, @end_date.year, @end_date.month)
|
407
|
+
[確定市民税, readable(r)]
|
313
408
|
end
|
314
409
|
|
315
410
|
def 市民税仮払納付
|
316
|
-
|
411
|
+
中間還付税額(@税額.dig(:shimin, :kintou), @市民税均等割中間納付) + 中間還付税額(@税額.dig(:shimin, :houjinzei), @市民税法人税割中間納付)
|
317
412
|
end
|
318
413
|
|
319
414
|
def 市民税損金納付
|
320
|
-
[
|
415
|
+
[@市民税均等割中間納付, @税額.dig(:shimin, :kintou)].min + [@市民税法人税割中間納付, @税額.dig(:shimin, :houjinzei)].min
|
416
|
+
end
|
417
|
+
|
418
|
+
def 確定事業税
|
419
|
+
@税額.dig(:kenmin, :shotoku) + @税額.dig(:kenmin, :tokubetsu)
|
420
|
+
end
|
421
|
+
|
422
|
+
def 事業税損金納付
|
423
|
+
[@事業税中間納付, 確定事業税].min
|
321
424
|
end
|
322
425
|
|
323
426
|
def 別表五一期首差引金額
|
@@ -325,15 +428,42 @@ module Luca
|
|
325
428
|
end
|
326
429
|
|
327
430
|
def 別表五一期末差引金額
|
328
|
-
期末繰越損益 +
|
431
|
+
期末繰越損益 + @納税充当金期中増 - 期末未納法人税 - 期末未納都道府県民税 - 期末未納市民税 - @翌期還付事業税
|
329
432
|
end
|
330
433
|
|
331
434
|
def 別表五一期中減差引金額
|
332
|
-
期首繰越損益 + @納税充当金期中減 - @法人税期中減 - @都道府県民税期中減 - @市民税期中減
|
435
|
+
期首繰越損益 + @納税充当金期中減 - @法人税期中減 - @都道府県民税期中減 - @市民税期中減 - @翌期還付法人税 - @翌期還付都道府県住民税 - @翌期還付市民税
|
333
436
|
end
|
334
437
|
|
335
438
|
def 別表五一期中増差引金額
|
336
|
-
期末繰越損益 +
|
439
|
+
期末繰越損益 + 納付税額(確定事業税, @事業税中間納付) - @法人税中間納付 - @地方法人税中間納付 - @都道府県民税中間納付 - @市民税中間納付 - @翌期還付事業税
|
440
|
+
end
|
441
|
+
|
442
|
+
def 期末未収税金(code)
|
443
|
+
readable((@bs_data[code] || 0) * -1)
|
444
|
+
end
|
445
|
+
|
446
|
+
def 別表七各期青色損失
|
447
|
+
tags = @繰越損失管理.records
|
448
|
+
.filter { |record| record['start_date'] > @end_date.prev_year(10) && record['end_date'] < @start_date }
|
449
|
+
.map do |record|
|
450
|
+
deduction = record['decrease']&.filter{ |r| r['date'] >= @start_date }&.dig(0, 'val') || 0
|
451
|
+
next if deduction == 0 && record['amount'] == 0
|
452
|
+
|
453
|
+
%Q(<MCB00110>
|
454
|
+
<MCB00120>
|
455
|
+
#{render_attr('MCB00130', etax_date(record['start_date']))}
|
456
|
+
#{render_attr('MCB00140', etax_date(record['end_date']))}
|
457
|
+
</MCB00120>
|
458
|
+
<MCB00150>
|
459
|
+
<MCB00160><kubun_CD>1</kubun_CD></MCB00160>
|
460
|
+
</MCB00150>
|
461
|
+
#{render_attr('MCB00190', deduction + record['amount'])}
|
462
|
+
#{render_attr('MCB00200', deduction)}
|
463
|
+
#{render_attr('MCB00210', record['amount'])}
|
464
|
+
</MCB00110)
|
465
|
+
end
|
466
|
+
tags.compact.join("\n")
|
337
467
|
end
|
338
468
|
|
339
469
|
def 期首資本金
|
@@ -361,8 +491,9 @@ module Luca
|
|
361
491
|
end
|
362
492
|
|
363
493
|
def 未納消費税期中増減
|
364
|
-
|
365
|
-
|
494
|
+
increase = debit_amount('C1I1', @start_date.year, @start_date.month, @end_date.year, @end_date.month)
|
495
|
+
r = debit_amount('516', @start_date.year, @start_date.month, @end_date.year, @end_date.month)
|
496
|
+
[readable(increase), readable(r)]
|
366
497
|
end
|
367
498
|
|
368
499
|
def 概況月(idx)
|
@@ -387,13 +518,13 @@ module Luca
|
|
387
518
|
|
388
519
|
def 概況月源泉徴収(idx)
|
389
520
|
target = @start_date.next_month(idx)
|
390
|
-
readable(LucaBook::State.gross(target.year, target.month, code: '5191')[:credit] || 0)
|
391
|
-
+ readable(LucaBook::State.gross(target.year, target.month, code: '5193')[:credit] || 0)
|
521
|
+
readable(LucaBook::State.gross(target.year, target.month, code: '5191')[:credit]['5191'] || 0)
|
522
|
+
+ readable(LucaBook::State.gross(target.year, target.month, code: '5193')[:credit]['5193'] || 0)
|
392
523
|
end
|
393
524
|
|
394
525
|
def 概況源泉徴収
|
395
|
-
readable(LucaBook::State.gross(@start_date.year, @start_date.month, @end_date.year, @end_date.month, code: '5191')[:credit] || 0)
|
396
|
-
+ readable(LucaBook::State.gross(@start_date.year, @start_date.month, @end_date.year, @end_date.month, code: '5193')[:credit] || 0)
|
526
|
+
readable(LucaBook::State.gross(@start_date.year, @start_date.month, @end_date.year, @end_date.month, code: '5191')[:credit]['5191'] || 0)
|
527
|
+
+ readable(LucaBook::State.gross(@start_date.year, @start_date.month, @end_date.year, @end_date.month, code: '5193')[:credit]['5193'] || 0)
|
397
528
|
end
|
398
529
|
|
399
530
|
def gaikyo(code)
|
data/lib/luca/jp/chihouzei.rb
CHANGED
@@ -22,10 +22,10 @@ module Luca
|
|
22
22
|
set_pl(4)
|
23
23
|
set_bs(4)
|
24
24
|
@issue_date = Date.today
|
25
|
-
@company = CGI.escapeHTML(
|
25
|
+
@company = CGI.escapeHTML(config.dig('company', 'name'))
|
26
26
|
@software = 'LucaJp'
|
27
|
-
@jimusho_code =
|
28
|
-
@jimusho_name = '
|
27
|
+
@jimusho_code = eltax_config('jimusho_code')
|
28
|
+
@jimusho_name = eltax_config('jimusho_name')
|
29
29
|
|
30
30
|
@税額 = 税額計算
|
31
31
|
@均等割 = @税額.dig(:kenmin, :kintou)
|
@@ -62,9 +62,9 @@ module Luca
|
|
62
62
|
else
|
63
63
|
@procedure_code = 'R0102100'
|
64
64
|
@procedure_name = '法人都道府県民税・事業税・特別法人事業税又は地方法人特別税 確定申告'
|
65
|
-
@form_sec = ['R0102AA190', 'R0102AG120'].map{ |c| form_attr(c) }.join('')
|
66
|
-
@user_inf = render_erb(search_template('
|
67
|
-
@form_data = [第六号,
|
65
|
+
@form_sec = ['R0102AA190', 'R0102AG120', 別表九フォーム].compact.map{ |c| form_attr(c) }.join('')
|
66
|
+
@user_inf = render_erb(search_template('eltax-userinf.xml.erb'))
|
67
|
+
@form_data = [第六号, 別表四三, 別表九].compact.join("\n")
|
68
68
|
render_erb(search_template('eltax.xml.erb'))
|
69
69
|
end
|
70
70
|
end
|
@@ -81,22 +81,22 @@ module Luca
|
|
81
81
|
item['credit'] << { 'label' => karibarai_label(k), 'amount' => dat[:chukan] }
|
82
82
|
end
|
83
83
|
if dat[:chukan] > dat[:zeigaku]
|
84
|
-
item['debit'] << { 'label' => '
|
84
|
+
item['debit'] << { 'label' => '未収地方事業税', 'amount' => dat[:chukan] - dat[:zeigaku] }
|
85
85
|
else
|
86
86
|
item['credit'] << { 'label' => '未払地方事業税', 'amount' => dat[:zeigaku] - dat[:chukan] }
|
87
87
|
end
|
88
|
-
item['debit'] << { 'label' => '法人税、住民税及び事業税', 'amount' => dat[:zeigaku] }
|
88
|
+
item['debit'] << { 'label' => '法人税、住民税及び事業税', 'amount' => dat[:zeigaku] } if dat[:zeigaku] > 0
|
89
89
|
end
|
90
90
|
records[:juminzei].each do |k, dat|
|
91
91
|
if dat[:chukan] > 0
|
92
92
|
item['credit'] << { 'label' => karibarai_label(k), 'amount' => dat[:chukan] }
|
93
93
|
end
|
94
94
|
if dat[:chukan] > dat[:zeigaku]
|
95
|
-
item['debit'] << { 'label' => '
|
95
|
+
item['debit'] << { 'label' => '未収都道府県住民税', 'amount' => dat[:chukan] - dat[:zeigaku] }
|
96
96
|
else
|
97
97
|
item['credit'] << { 'label' => '未払都道府県民税', 'amount' => dat[:zeigaku] - dat[:chukan] }
|
98
98
|
end
|
99
|
-
item['debit'] << { 'label' => '法人税、住民税及び事業税', 'amount' => dat[:zeigaku] }
|
99
|
+
item['debit'] << { 'label' => '法人税、住民税及び事業税', 'amount' => dat[:zeigaku] } if dat[:zeigaku] > 0
|
100
100
|
end
|
101
101
|
item['x-editor'] = 'LucaJp'
|
102
102
|
res << item
|
@@ -109,10 +109,22 @@ module Luca
|
|
109
109
|
end
|
110
110
|
|
111
111
|
def 別表四三
|
112
|
-
@office_23ku =
|
112
|
+
@office_23ku = config.dig('jp', 'eltax', 'office_23ku')
|
113
113
|
render_erb(search_template('el-no6-43.xml.erb'))
|
114
114
|
end
|
115
115
|
|
116
|
+
def 別表九フォーム
|
117
|
+
return nil if @繰越損失管理.records.length == 0
|
118
|
+
|
119
|
+
'R0102AM190'
|
120
|
+
end
|
121
|
+
|
122
|
+
def 別表九
|
123
|
+
return nil if @繰越損失管理.records.length == 0
|
124
|
+
|
125
|
+
render_erb(search_template('el-no6-9.xml.erb'))
|
126
|
+
end
|
127
|
+
|
116
128
|
private
|
117
129
|
|
118
130
|
def 法人税割課税標準
|
@@ -124,8 +136,54 @@ module Luca
|
|
124
136
|
@所得割中間納付
|
125
137
|
end
|
126
138
|
|
139
|
+
# TODO: 損失の区分
|
140
|
+
#
|
141
|
+
def 別表九各期青色損失
|
142
|
+
tags = @繰越損失管理.records
|
143
|
+
.filter { |record| record['start_date'] > @end_date.prev_year(10) && record['end_date'] < @start_date }
|
144
|
+
.map do |record|
|
145
|
+
deduction = record['decrease']&.filter{ |r| r['date'] >= @start_date }&.dig(0, 'val') || 0
|
146
|
+
next if deduction == 0 && record['amount'] == 0
|
147
|
+
|
148
|
+
%Q(<AMB00200>
|
149
|
+
<AMB00210>#{etax_date(@start_date)}</AMB00210>
|
150
|
+
<AMB00220>#{etax_date(@end_date)}</AMB00220>
|
151
|
+
<AMB00225 />
|
152
|
+
#{render_attr('AMB00230', deduction + record['amount'])}
|
153
|
+
#{render_attr('AMB00240', deduction)}
|
154
|
+
#{render_attr('AMB00250', record['amount'])}
|
155
|
+
</AMB00200>)
|
156
|
+
end
|
157
|
+
return tags.compact.join("\n") if tags.length > 0
|
158
|
+
|
159
|
+
%Q(<AMB00200>
|
160
|
+
<AMB00210><gen:era /><gen:yy /><gen:mm /><gen:dd /></AMB00210>
|
161
|
+
<AMB00220><gen:era /><gen:yy /><gen:mm /><gen:dd /></AMB00220>
|
162
|
+
<AMB00225 />
|
163
|
+
<AMB00230 />
|
164
|
+
<AMB00240 />
|
165
|
+
<AMB00250 />
|
166
|
+
</AMB00200>)
|
167
|
+
end
|
168
|
+
|
169
|
+
def eltax_kouza
|
170
|
+
items = it_part_config('kanpu_kinyukikan').split('-')
|
171
|
+
%Q(<gen:kubun_CD />
|
172
|
+
<gen:kinyukikan_NM>#{items[0]}</gen:kinyukikan_NM>
|
173
|
+
<gen:shiten_NM>#{items[1]}</gen:shiten_NM>
|
174
|
+
<gen:kinyukikan_CD />
|
175
|
+
<gen:shiten_CD />
|
176
|
+
<gen:yokin>1</gen:yokin>
|
177
|
+
<gen:koza>#{items[3]}</gen:koza>)
|
178
|
+
end
|
179
|
+
|
127
180
|
def form_attr(code)
|
128
|
-
|
181
|
+
name = {
|
182
|
+
'R0102AA' => '中間・確定申告書',
|
183
|
+
'R0102AG' => '均等割額の計算に関する明細書',
|
184
|
+
'R0102AM' => '欠損金額等及び災害損失金の控除明細書'
|
185
|
+
}[code[0,7]]
|
186
|
+
"<FORM_ATTR><FORM_ID>#{code}</FORM_ID><FORM_NAME>#{name}</FORM_NAME><FORM_FILE_NAME></FORM_FILE_NAME><FORM_XSL_NAME></FORM_XSL_NAME></FORM_ATTR>"
|
129
187
|
end
|
130
188
|
|
131
189
|
def karibarai_label(key)
|
@@ -140,7 +198,7 @@ module Luca
|
|
140
198
|
'仮払地方税資本割'
|
141
199
|
when :fukakachi
|
142
200
|
'仮払地方税付加価値割'
|
143
|
-
when :
|
201
|
+
when :houjinzei
|
144
202
|
'仮払地方税法人税割'
|
145
203
|
when :kinto
|
146
204
|
'仮払地方税均等割'
|