luca-jp 0.9.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/luca-jp +39 -12
- data/lib/luca/jp/aoiro.rb +11 -12
- data/lib/luca/jp/chihouzei.rb +46 -22
- data/lib/luca/jp/common.rb +67 -19
- data/lib/luca/jp/templates/el-no20.xml.erb +143 -0
- data/lib/luca/jp/templates/el-no6.xml.erb +6 -6
- data/lib/luca/jp/util.rb +3 -3
- data/lib/luca/jp/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14025702bd2ec1fc0f9758ae982c09b437af41b531834d71de1b6b881cdc1e76
|
4
|
+
data.tar.gz: 8c265c52dd25ea94c4dff01886f0afcc6dd187612b0e61856eab8c50c520ed2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea5d03e02adeae4b9257a055fe528a77cd2dcc2627df0379d063e9e88ae55b8f03ad8298dcd78334522d490c600d75012b8ad5b2d74c56b07e1b2a24bc06cf80
|
7
|
+
data.tar.gz: 989dd502799f53c48ba1655518b4def4b15e0737f5e8ec5fd9169bbf18e18022950c1409e9ea95b25db6c2bf4d9351beb37ad0a24dd65b7713ac3e6c0194617e
|
data/exe/luca-jp
CHANGED
@@ -6,29 +6,29 @@ require 'luca/jp'
|
|
6
6
|
class LucaCmd
|
7
7
|
def self.syouhizei(args, params)
|
8
8
|
if params[:export]
|
9
|
-
Luca::Jp::Syouhizei.range(*args).export_json
|
9
|
+
Luca::Jp::Syouhizei.range(*auto_range(args, params)).export_json
|
10
10
|
else
|
11
|
-
puts Luca::Jp::Syouhizei.range(*args).kani
|
11
|
+
puts Luca::Jp::Syouhizei.range(*auto_range(args, params)).kani
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.houjinzei(args, params)
|
16
16
|
if params[:export]
|
17
|
-
Luca::Jp::Aoiro.range(*args).export_json
|
17
|
+
Luca::Jp::Aoiro.range(*auto_range(args, params)).export_json
|
18
18
|
else
|
19
|
-
puts Luca::Jp::Aoiro.range(*args).kani
|
19
|
+
puts Luca::Jp::Aoiro.range(*auto_range(args, params)).kani
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
def self.chihouzei(args, params)
|
24
24
|
if params[:export]
|
25
25
|
accounts = Luca::Jp::Util.eltax_config('reports').map do |report|
|
26
|
-
Luca::Jp::Chihouzei.range(*args).export_json(report)
|
26
|
+
Luca::Jp::Chihouzei.range(*auto_range(args, params)).export_json(report)
|
27
27
|
end
|
28
28
|
puts JSON.dump(accounts)
|
29
29
|
else
|
30
30
|
Luca::Jp::Util.eltax_config('reports').each do |report|
|
31
|
-
File.open("chihouzei-#{report['jichitai_code']}#{report['jimusho_code']}.xml", 'w') { |f| f.puts(Luca::Jp::Chihouzei.range(*args).kani(report))}
|
31
|
+
File.open("chihouzei-#{report['jichitai_code']}#{report['jimusho_code']}.xml", 'w') { |f| f.puts(Luca::Jp::Chihouzei.range(*auto_range(args, params)).kani(report))}
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
@@ -37,30 +37,48 @@ class LucaCmd
|
|
37
37
|
date = "#{args[0]}-#{args[1]}-1"
|
38
38
|
Luca::Jp::Urikake.new(date).report(params[:total])
|
39
39
|
end
|
40
|
+
|
41
|
+
def self.auto_range(args, params)
|
42
|
+
case args.length
|
43
|
+
when 4
|
44
|
+
args
|
45
|
+
when 2
|
46
|
+
date = Date.new(args[0].to_i, args[1].to_i)
|
47
|
+
r = LucaBook::Util.current_fy(date, to: date)
|
48
|
+
[r[0].year, r[0].month, r[1].year, r[1].month]
|
49
|
+
when 0
|
50
|
+
date = params[:lastyear] ? Date.today.prev_year : Date.today
|
51
|
+
r = LucaBook::Util.current_fy(date)
|
52
|
+
[r[0].year, r[0].month, r[1].year, r[1].month]
|
53
|
+
end
|
54
|
+
end
|
40
55
|
end
|
41
56
|
|
42
57
|
cmd = ARGV.shift
|
43
58
|
params = {}
|
44
59
|
|
45
60
|
case cmd
|
46
|
-
when /hou?jinzei/
|
61
|
+
when 'h', /hou?jinzei/
|
47
62
|
OptionParser.new do |opt|
|
48
|
-
opt.banner = 'Usage: luca-jp houjinzei [options] yyyy mm yyyy mm'
|
63
|
+
opt.banner = 'Usage: luca-jp h|houjinzei [options] [yyyy mm yyyy mm]'
|
49
64
|
opt.on('--export', 'export json') { |_v| params[:export] = true }
|
65
|
+
opt.on('--lastyear', 'report on last Financial year') { |_v| params[:lastyear] = true }
|
50
66
|
args = opt.parse!(ARGV)
|
51
67
|
LucaCmd.houjinzei(args, params)
|
52
68
|
end
|
53
|
-
when /s[yh]ou?hizei/
|
69
|
+
when 's', /s[yh]ou?hizei/
|
54
70
|
OptionParser.new do |opt|
|
55
|
-
opt.banner = 'Usage: luca-jp syouhizei [options] yyyy mm yyyy mm'
|
71
|
+
opt.banner = 'Usage: luca-jp s|syouhizei [options] [yyyy mm yyyy mm]'
|
56
72
|
opt.on('--export', 'export json') { |_v| params[:export] = true }
|
73
|
+
opt.on('--lastyear', 'report on last Financial year') { |_v| params[:lastyear] = true }
|
57
74
|
args = opt.parse!(ARGV)
|
58
75
|
LucaCmd.syouhizei(args, params)
|
59
76
|
end
|
60
|
-
when /chihou?zei/
|
77
|
+
when 'c', /chihou?zei/
|
61
78
|
OptionParser.new do |opt|
|
62
|
-
opt.banner = 'Usage: luca-jp chihouzei [options] yyyy mm yyyy mm'
|
79
|
+
opt.banner = 'Usage: luca-jp c|chihouzei [options] [yyyy mm yyyy mm]'
|
63
80
|
opt.on('--export', 'export json') { |_v| params[:export] = true }
|
81
|
+
opt.on('--lastyear', 'report on last Financial year') { |_v| params[:lastyear] = true }
|
64
82
|
args = opt.parse!(ARGV)
|
65
83
|
LucaCmd.chihouzei(args, params)
|
66
84
|
end
|
@@ -71,4 +89,13 @@ when /urikake/
|
|
71
89
|
args = opt.parse!(ARGV)
|
72
90
|
LucaCmd.urikake(args, params)
|
73
91
|
end
|
92
|
+
else
|
93
|
+
puts 'Proper subcommand needed.'
|
94
|
+
puts
|
95
|
+
puts 'Usage: luca-jp <subcommand>'
|
96
|
+
puts ' h[oujinzei]: 法人税の計算'
|
97
|
+
puts ' s[youhizei]: 消費税の計算'
|
98
|
+
puts ' c[hihouzei]: 地方税の計算'
|
99
|
+
puts ' urikake: 勘定科目内訳明細書の売掛金リスト(CSV)'
|
100
|
+
exit 1
|
74
101
|
end
|
data/lib/luca/jp/aoiro.rb
CHANGED
@@ -141,9 +141,9 @@ module Luca
|
|
141
141
|
|
142
142
|
@当期還付法人税 = refund_tax('1502')
|
143
143
|
@当期還付都道府県住民税 = refund_tax('1503')
|
144
|
-
@翌期還付都道府県住民税 =
|
144
|
+
@翌期還付都道府県住民税 = readable(@bs_data['1503'])
|
145
145
|
@当期還付市民税 = refund_tax('1505')
|
146
|
-
@翌期還付市民税 =
|
146
|
+
@翌期還付市民税 = readable(@bs_data['1505']) || 0
|
147
147
|
@事業税期首残高 = 期首未納事業税 > 0 ? 期首未納事業税 : (@当期還付事業税 * -1)
|
148
148
|
@仮払税金 = @翌期還付法人税 + @翌期還付都道府県住民税 + @翌期還付事業税 + @翌期還付市民税
|
149
149
|
|
@@ -467,7 +467,7 @@ module Luca
|
|
467
467
|
end
|
468
468
|
|
469
469
|
def 確定都道府県住民税
|
470
|
-
|
470
|
+
readable(@pl_data['H112']) || 0
|
471
471
|
end
|
472
472
|
|
473
473
|
def 期首未納都道府県民税
|
@@ -475,7 +475,7 @@ module Luca
|
|
475
475
|
end
|
476
476
|
|
477
477
|
def 期末未納都道府県民税
|
478
|
-
|
478
|
+
readable(@bs_data['5153']) || 0
|
479
479
|
end
|
480
480
|
|
481
481
|
def 未納都道府県民税期中増減
|
@@ -484,16 +484,15 @@ module Luca
|
|
484
484
|
end
|
485
485
|
|
486
486
|
def 都道府県民税仮払納付
|
487
|
-
[
|
488
|
-
中間還付税額(@税額.dig(:kenmin, :kintou), @都道府県民税均等割中間納付) + 中間還付税額(@税額.dig(:kenmin, :houjinzei), @都道府県民税法人税割中間納付)
|
487
|
+
readable(@bs_data['1503']) || 0
|
489
488
|
end
|
490
489
|
|
491
490
|
def 都道府県民税損金納付
|
492
|
-
[
|
491
|
+
[@都道府県民税均等割中間納付 + @都道府県民税法人税割中間納付, readable(@pl_data['H112'])||0].min
|
493
492
|
end
|
494
493
|
|
495
494
|
def 確定市民税
|
496
|
-
|
495
|
+
readable(@pl_data['H113']) || 0
|
497
496
|
end
|
498
497
|
|
499
498
|
def 期首未納市民税
|
@@ -501,7 +500,7 @@ module Luca
|
|
501
500
|
end
|
502
501
|
|
503
502
|
def 期末未納市民税
|
504
|
-
|
503
|
+
readable(@bs_data['5154']) || 0
|
505
504
|
end
|
506
505
|
|
507
506
|
def 未納市民税期中増減
|
@@ -510,15 +509,15 @@ module Luca
|
|
510
509
|
end
|
511
510
|
|
512
511
|
def 市民税仮払納付
|
513
|
-
|
512
|
+
readable(@bs_data['1505']) || 0
|
514
513
|
end
|
515
514
|
|
516
515
|
def 市民税損金納付
|
517
|
-
[
|
516
|
+
[@市民税均等割中間納付 + @市民税法人税割中間納付, readable(@pl_data['H113'])||0].min
|
518
517
|
end
|
519
518
|
|
520
519
|
def 確定事業税
|
521
|
-
|
520
|
+
readable(@pl_data['H114']) || 0
|
522
521
|
end
|
523
522
|
|
524
523
|
def 事業税損金納付
|
data/lib/luca/jp/chihouzei.rb
CHANGED
@@ -23,19 +23,28 @@ module Luca
|
|
23
23
|
set_bs(4)
|
24
24
|
@issue_date = Date.today
|
25
25
|
@software = 'LucaJp'
|
26
|
+
@jimusho_name = report_cfg['jimusho_name']
|
26
27
|
@report_category = report_cfg['type']
|
27
28
|
@employee = report_cfg['employee'] || 1
|
29
|
+
@office_count = report_cfg['office_count'] || 1
|
30
|
+
# 自治体ごとの税率カスタマイズ
|
31
|
+
@houjinzeiwari_rate = report_cfg['houjinzeiwari']
|
32
|
+
@shotoku399 = report_cfg['shotoku399']
|
33
|
+
@shotoku401 = report_cfg['shotoku401']
|
34
|
+
@shotoku801 = report_cfg['shotoku801']
|
28
35
|
|
29
36
|
@税額 = 税額計算
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
37
|
+
jichitai = @report_category == 'city' ? :shimin : :kenmin
|
38
|
+
@均等割 = report_cfg['kintouwari'] || @税額.dig(jichitai, :kintou)
|
39
|
+
@確定法人税割 = @税額.dig(jichitai, :houjinzei)
|
40
|
+
@地方特別法人事業税中間納付 = prepaid_tax('1854', @jimusho_name)
|
41
|
+
@所得割中間納付 = prepaid_tax('1855', @jimusho_name)
|
42
|
+
@法人税割中間納付 = prepaid_tax('1859', @jimusho_name)
|
43
|
+
@均等割中間納付 = prepaid_tax('185A', @jimusho_name)
|
36
44
|
@所得割 = @税額.dig(:kenmin, :shotoku)
|
37
45
|
if export
|
38
46
|
{
|
47
|
+
customer: @jimusho_name,
|
39
48
|
jigyouzei: {
|
40
49
|
shotoku: {
|
41
50
|
zeigaku: @所得割,
|
@@ -62,10 +71,10 @@ module Luca
|
|
62
71
|
@form_vers = proc_version
|
63
72
|
@jichitai_code = report_cfg['jichitai_code']
|
64
73
|
@jimusho_code = report_cfg['jimusho_code']
|
65
|
-
@jimusho_name = report_cfg['jimusho_name']
|
66
74
|
@kanri_bango = report_cfg['x_houjin_bango']
|
67
75
|
@app_version = report_cfg['app_version']
|
68
76
|
@address = report_cfg['address'] || it_part_config('nozeisha_adr')
|
77
|
+
@jigyosho_name = report_cfg['name'] || '本店'
|
69
78
|
@procedure_code = 'R0102100'
|
70
79
|
@procedure_name = '法人都道府県民税・事業税・特別法人事業税又は地方法人特別税 確定申告'
|
71
80
|
@form_sec = case @report_category
|
@@ -76,7 +85,7 @@ module Luca
|
|
76
85
|
["R0102AA#{@form_vers['R0102AA']}", "R0102AG120", 別表九フォーム]
|
77
86
|
.compact.map{ |c| form_attr(c) }.join('')
|
78
87
|
when 'city'
|
79
|
-
|
88
|
+
["R0504AA180"].compact.map{ |c| form_attr(c) }.join('')
|
80
89
|
end
|
81
90
|
@user_inf = render_erb(search_template('eltax-userinf.xml.erb'))
|
82
91
|
@form_data = case @report_category
|
@@ -85,7 +94,7 @@ module Luca
|
|
85
94
|
when '23ku'
|
86
95
|
[第六号, 別表四三, 別表九].compact.join("\n")
|
87
96
|
when 'city'
|
88
|
-
|
97
|
+
[第二十号].compact.join("\n")
|
89
98
|
end
|
90
99
|
render_erb(search_template('eltax.xml.erb'))
|
91
100
|
end
|
@@ -93,32 +102,36 @@ module Luca
|
|
93
102
|
|
94
103
|
def export_json(report_cfg)
|
95
104
|
records = kani(report_cfg, export: true)
|
105
|
+
label = @report_category == 'city' ? '市町村住民税' : '都道府県住民税'
|
96
106
|
{}.tap do |item|
|
97
107
|
item['date'] = @end_date
|
98
108
|
item['debit'] = []
|
99
109
|
item['credit'] = []
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
110
|
+
unless @report_category == 'city'
|
111
|
+
records[:jigyouzei].each do |k, dat|
|
112
|
+
if dat[:chukan] > 0
|
113
|
+
item['credit'] << { 'label' => karibarai_label(k), 'amount' => dat[:chukan] }
|
114
|
+
end
|
115
|
+
if dat[:chukan] > dat[:zeigaku]
|
116
|
+
item['debit'] << { 'label' => '未収地方事業税', 'amount' => dat[:chukan] - dat[:zeigaku] }
|
117
|
+
else
|
118
|
+
item['credit'] << { 'label' => '未払地方事業税', 'amount' => dat[:zeigaku] - dat[:chukan] }
|
119
|
+
end
|
120
|
+
item['debit'] << { 'label' => '地方事業税', 'amount' => dat[:zeigaku] } if dat[:zeigaku] > 0
|
108
121
|
end
|
109
|
-
item['debit'] << { 'label' => '法人税、住民税及び事業税', 'amount' => dat[:zeigaku] } if dat[:zeigaku] > 0
|
110
122
|
end
|
111
123
|
records[:juminzei].each do |k, dat|
|
112
124
|
if dat[:chukan] > 0
|
113
125
|
item['credit'] << { 'label' => karibarai_label(k), 'amount' => dat[:chukan] }
|
114
126
|
end
|
115
127
|
if dat[:chukan] > dat[:zeigaku]
|
116
|
-
item['debit'] << { 'label' =>
|
128
|
+
item['debit'] << { 'label' => "未収#{label}", 'amount' => dat[:chukan] - dat[:zeigaku] }
|
117
129
|
else
|
118
|
-
item['credit'] << { 'label' =>
|
130
|
+
item['credit'] << { 'label' => "未払#{label}", 'amount' => dat[:zeigaku] - dat[:chukan] }
|
119
131
|
end
|
120
|
-
item['debit'] << { 'label' =>
|
132
|
+
item['debit'] << { 'label' => label, 'amount' => dat[:zeigaku] } if dat[:zeigaku] > 0
|
121
133
|
end
|
134
|
+
item['x-customer'] = records[:customer] unless records[:customer].nil?
|
122
135
|
item['x-editor'] = 'LucaJp'
|
123
136
|
end
|
124
137
|
end
|
@@ -134,6 +147,11 @@ module Luca
|
|
134
147
|
render_erb(search_template('el-no6-43.xml.erb'))
|
135
148
|
end
|
136
149
|
|
150
|
+
def 第二十号
|
151
|
+
@資本金準備金 = readable(['911', '9131'].map { |cd| @bs_data.dig(cd) }.compact.sum)
|
152
|
+
render_erb(search_template('el-no20.xml.erb'))
|
153
|
+
end
|
154
|
+
|
137
155
|
def 別表九フォーム
|
138
156
|
return nil if @繰越損失管理.records.length == 0
|
139
157
|
|
@@ -149,7 +167,13 @@ module Luca
|
|
149
167
|
private
|
150
168
|
|
151
169
|
def 法人税割課税標準
|
152
|
-
(
|
170
|
+
case Luca::Jp::Util.eltax_config('reports')
|
171
|
+
.filter { |r| レポート種別.include?(r['type']) }.length
|
172
|
+
when 0, 1
|
173
|
+
(@税額.dig(:houjin, :kokuzei) / 1000).floor * 1000
|
174
|
+
else
|
175
|
+
従業員数による分割課税標準 @税額.dig(:houjin, :kokuzei)
|
176
|
+
end
|
153
177
|
end
|
154
178
|
|
155
179
|
def 事業税中間納付
|
data/lib/luca/jp/common.rb
CHANGED
@@ -19,9 +19,9 @@ module Luca
|
|
19
19
|
tax[:houjin][:chihou] = (地方法人税 / 100).floor * 100
|
20
20
|
|
21
21
|
tax[:kenmin][:houjinzei], tax[:shimin][:houjinzei] = 法人税割(法人税額)
|
22
|
-
tax[:kenmin][:kintou], tax[:shimin][:kintou] = 均等割
|
22
|
+
tax[:kenmin][:kintou], tax[:shimin][:kintou] = 均等割 if @report_category
|
23
23
|
tax[:kenmin][:shotoku] = 所得割400万以下(所得) + 所得割800万以下(所得) + 所得割800万超(所得)
|
24
|
-
tax[:kenmin][:tokubetsu] =
|
24
|
+
tax[:kenmin][:tokubetsu] = 特別法人事業税(tax[:kenmin][:shotoku])
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -139,14 +139,16 @@ module Luca
|
|
139
139
|
else
|
140
140
|
法人税割課税標準
|
141
141
|
end
|
142
|
-
|
142
|
+
県税率, 市税率 = 法人税割税率(課税標準)
|
143
143
|
[
|
144
|
-
(課税標準 *
|
145
|
-
(課税標準 *
|
144
|
+
(課税標準 * 県税率 / 100 / 100).floor * 100,
|
145
|
+
(課税標準 * 市税率 / 100 / 100).floor * 100
|
146
146
|
]
|
147
147
|
end
|
148
148
|
|
149
149
|
def 法人税割税率(法人税 = nil)
|
150
|
+
return [@houjinzeiwari_rate.to_f, @houjinzeiwari_rate.to_f] if @houjinzeiwari_rate
|
151
|
+
|
150
152
|
課税標準 = if 法人税
|
151
153
|
(法人税 / 1000).floor * 1000
|
152
154
|
else
|
@@ -169,14 +171,17 @@ module Luca
|
|
169
171
|
所得 ||= 所得金額
|
170
172
|
return 0 if 所得 < 0
|
171
173
|
|
172
|
-
if 所得 >= 4_000_000
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
174
|
+
total = if 所得 >= 4_000_000
|
175
|
+
4_000_000
|
176
|
+
else
|
177
|
+
(所得 / 1000).floor * 1000
|
178
|
+
end
|
179
|
+
事業税の分割課税標準(total)
|
177
180
|
end
|
178
181
|
|
179
182
|
def 所得割税率400万以下(所得 = nil)
|
183
|
+
return @shotyoku399.to_f if @shotoku399
|
184
|
+
|
180
185
|
所得 ||= 所得金額
|
181
186
|
if 期末資本金 > 100_000_000 || 所得 > 25_000_000
|
182
187
|
軽減税率不適用法人 ? 7.48 : 3.75
|
@@ -194,16 +199,19 @@ module Luca
|
|
194
199
|
所得 ||= 所得金額
|
195
200
|
return 0 if 所得 < 0
|
196
201
|
|
197
|
-
if 所得 <= 4_000_000
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
202
|
+
total = if 所得 <= 4_000_000
|
203
|
+
0
|
204
|
+
elsif 所得 >= 8_000_000
|
205
|
+
4_000_000
|
206
|
+
else
|
207
|
+
((所得 - 4_000_000) / 1000).floor * 1000
|
208
|
+
end
|
209
|
+
事業税の分割課税標準(total)
|
204
210
|
end
|
205
211
|
|
206
212
|
def 所得割税率800万以下(所得 = nil)
|
213
|
+
return @shotyoku401.to_f if @shotoku401
|
214
|
+
|
207
215
|
所得 ||= 所得金額
|
208
216
|
if 期末資本金 > 100_000_000 || 所得 > 25_000_000
|
209
217
|
軽減税率不適用法人 ? 7.48 : 5.665
|
@@ -221,14 +229,17 @@ module Luca
|
|
221
229
|
所得 ||= 所得金額
|
222
230
|
return 0 if 所得 < 0
|
223
231
|
|
224
|
-
if 所得 <= 8_000_000
|
232
|
+
total = if 所得 <= 8_000_000
|
225
233
|
0
|
226
234
|
else
|
227
235
|
((所得 - 8_000_000) / 1000).floor * 1000
|
228
236
|
end
|
237
|
+
事業税の分割課税標準(total)
|
229
238
|
end
|
230
239
|
|
231
240
|
def 所得割税率800万超(所得 = nil)
|
241
|
+
return @shotyoku801.to_f if @shotoku801
|
242
|
+
|
232
243
|
所得 ||= 所得金額
|
233
244
|
if 期末資本金 > 100_000_000 || 所得 > 25_000_000
|
234
245
|
7.48
|
@@ -238,7 +249,7 @@ module Luca
|
|
238
249
|
end
|
239
250
|
|
240
251
|
# 100円未満切り捨て
|
241
|
-
def
|
252
|
+
def 特別法人事業税(事業税)
|
242
253
|
((事業税 * 37 / 100) / 100).floor * 100
|
243
254
|
end
|
244
255
|
|
@@ -302,6 +313,43 @@ module Luca
|
|
302
313
|
def 期末資本金
|
303
314
|
readable(@bs_data.dig('911'))
|
304
315
|
end
|
316
|
+
|
317
|
+
# -----------------------------------------------------
|
318
|
+
# :section: 複数自治体間の分割計算
|
319
|
+
# -----------------------------------------------------
|
320
|
+
def 事業税の分割課税標準(課税標準)
|
321
|
+
case Luca::Jp::Util.eltax_config('reports')
|
322
|
+
.filter { |r| レポート種別.include?(r['type']) }.length
|
323
|
+
when 0, 1
|
324
|
+
課税標準
|
325
|
+
else
|
326
|
+
half = (課税標準 / 2 / 1000).floor * 1000
|
327
|
+
[
|
328
|
+
事業所数による分割課税標準(half),
|
329
|
+
従業員数による分割課税標準(half)
|
330
|
+
].sum
|
331
|
+
end
|
332
|
+
end
|
333
|
+
|
334
|
+
def 従業員数による分割課税標準(課税標準)
|
335
|
+
分割基準の総数 = Luca::Jp::Util.eltax_config('reports')
|
336
|
+
.filter { |r| レポート種別.include?(r['type']) }
|
337
|
+
.map { |r| (r['employee'] || 1).to_i }.sum
|
338
|
+
((課税標準.to_f / 分割基準の総数).floor(分割基準の総数.to_s.length) * @employee / 1000)
|
339
|
+
.floor * 1000
|
340
|
+
end
|
341
|
+
|
342
|
+
def 事業所数による分割課税標準(課税標準)
|
343
|
+
分割基準の総数 = Luca::Jp::Util.eltax_config('reports')
|
344
|
+
.filter { |r| レポート種別.include?(r['type']) }
|
345
|
+
.map { |r| (r['office_count'] || 1).to_i }.sum
|
346
|
+
((課税標準.to_f / 分割基準の総数).floor(分割基準の総数.to_s.length) * @office_count / 1000)
|
347
|
+
.floor * 1000
|
348
|
+
end
|
349
|
+
|
350
|
+
def レポート種別
|
351
|
+
@report_category == 'city' ? ['city', '23ku'] : ['prefecture', '23ku']
|
352
|
+
end
|
305
353
|
end
|
306
354
|
end
|
307
355
|
end
|
@@ -0,0 +1,143 @@
|
|
1
|
+
<R0504AA180 xmlns="http://eltax.jp/HOJIN_DOFUKEN" vr="180" page="" seiseiSoft="<%= @software %>" seiseiVr="1" seiseiDay="<%= Date.today.strftime('%Y%m%d') %>" seiseiNM="<%= it_part_config('nozeisha_nm') %>" koshinSoft="" koshinVr="" koshinDay="" koshinNM="" taari="">
|
2
|
+
<AAA00100 idref="SEIRI_NUM" />
|
3
|
+
<AAA00200 idref="JIMUSHO_NUM"></AAA00200>
|
4
|
+
<AAA00300 idref="HOJIN_NUM"></AAA00300>
|
5
|
+
<AAA00400 />
|
6
|
+
<AAA00500 idref="HOJIN_NUMBER"></AAA00500>
|
7
|
+
<AAA00700 idref="RPT_DATE">
|
8
|
+
<gen:era></gen:era>
|
9
|
+
<gen:yy></gen:yy>
|
10
|
+
<gen:mm></gen:mm>
|
11
|
+
<gen:dd></gen:dd>
|
12
|
+
</AAA00700>
|
13
|
+
<AAA00800>
|
14
|
+
<gen:era><%= gengou(@issue_date) %></gen:era>
|
15
|
+
<gen:yy><%= wareki(@issue_date) %></gen:yy>
|
16
|
+
<gen:mm><%= @issue_date.month %></gen:mm>
|
17
|
+
<gen:dd><%= @issue_date.day %></gen:dd>
|
18
|
+
</AAA00800>
|
19
|
+
<AAA00900 idref="ORG1_NAME"></AAA00900>
|
20
|
+
<AAA_HONTEN_ZIP idref="HONTEN_ZIP"></AAA_HONTEN_ZIP>
|
21
|
+
<AAA_HONTEN_ADDR idref="HONTEN_ADDR"></AAA_HONTEN_ADDR>
|
22
|
+
<AAA_HONTEN_TEL_NUM idref="HONTEN_TEL"></AAA_HONTEN_TEL_NUM>
|
23
|
+
<AAA_ZIP />
|
24
|
+
<AAA_ADDR />
|
25
|
+
<AAA_TEL_NUM />
|
26
|
+
<AAA_KANA idref="KANA"></AAA_KANA>
|
27
|
+
<AAA_NAME idref="NAME"></AAA_NAME>
|
28
|
+
<AAA_DAIHYO_KANA idref="DAIHYO_KANA"></AAA_DAIHYO_KANA>
|
29
|
+
<AAA_DAIHYO_NAME idref="DAIHYO_NAME"></AAA_DAIHYO_NAME>
|
30
|
+
<AAA01000>
|
31
|
+
<gen:era />
|
32
|
+
<gen:yy />
|
33
|
+
<gen:mm />
|
34
|
+
<gen:dd />
|
35
|
+
<gen:yyyymmdd />
|
36
|
+
</AAA01000>
|
37
|
+
<AAA01100 />
|
38
|
+
<AAA01200 />
|
39
|
+
<AAA_JIGYO_NAME idref="JIGYO_NAME"></AAA_JIGYO_NAME>
|
40
|
+
<AAA_SHIHON idref="SHIHON"></AAA_SHIHON>
|
41
|
+
<AAA_SHIHON2><%= 資本金等の額 %></AAA_SHIHON2>
|
42
|
+
<AAA_SHIHON3><%= @資本金準備金 %></AAA_SHIHON3>
|
43
|
+
<AAA_SHIHON4><%= 地方税資本金等の額 %></AAA_SHIHON4>
|
44
|
+
<AAA_KEIRI_KANA></AAA_KEIRI_KANA>
|
45
|
+
<AAA_KEIRI_NAME></AAA_KEIRI_NAME>
|
46
|
+
<AAA_JIGYO_SDATE idref="SDATE">
|
47
|
+
<gen:era></gen:era>
|
48
|
+
<gen:yy></gen:yy>
|
49
|
+
<gen:mm></gen:mm>
|
50
|
+
<gen:dd></gen:dd>
|
51
|
+
<gen:yyyymmdd></gen:yyyymmdd>
|
52
|
+
</AAA_JIGYO_SDATE>
|
53
|
+
<AAA_JIGYO_EDATE idref="EDATE">
|
54
|
+
<gen:era></gen:era>
|
55
|
+
<gen:yy></gen:yy>
|
56
|
+
<gen:mm></gen:mm>
|
57
|
+
<gen:dd></gen:dd>
|
58
|
+
<gen:yyyymmdd></gen:yyyymmdd>
|
59
|
+
</AAA_JIGYO_EDATE>
|
60
|
+
<AAA_RPT_KBN idref="RPT_NAME">確定</AAA_RPT_KBN>
|
61
|
+
<AAA01300 />
|
62
|
+
<AAB00100 />
|
63
|
+
<AAB00110><%= @税額.dig(:houjin, :kokuzei) %></AAB00110>
|
64
|
+
<AAB00200 />
|
65
|
+
<AAB00400 />
|
66
|
+
<AAB00500 />
|
67
|
+
<AAB00600><%= 法人税割課税標準 %></AAB00600>
|
68
|
+
<AAB00610><%= 法人税割税率[1] %></AAB00610>
|
69
|
+
<AAB00620><%= 法人税割[1] %></AAB00620>
|
70
|
+
<AAB00700 />
|
71
|
+
<AAB00710 />
|
72
|
+
<AAB00720 />
|
73
|
+
<AAB00730 />
|
74
|
+
<AAB00750 />
|
75
|
+
<AAB00800 />
|
76
|
+
<AAB00900 />
|
77
|
+
<AAB01000><%= 法人税割[1] %></AAB01000>
|
78
|
+
<AAB01100><%= @法人税割中間納付 %></AAB01100>
|
79
|
+
<AAB01200 />
|
80
|
+
<AAB01300><%= @確定法人税割 - @法人税割中間納付 %></AAB01300>
|
81
|
+
<AAB01400>12</AAB01400>
|
82
|
+
<AAB01410><%= @均等割 %></AAB01410>
|
83
|
+
<AAB01420><%= @均等割 %></AAB01420>
|
84
|
+
<AAB01500><%= @均等割中間納付 %></AAB01500>
|
85
|
+
<AAB01600><%= @均等割 - @均等割中間納付 %></AAB01600>
|
86
|
+
<AAB01700><%= 納付税額(@確定法人税割, @法人税割中間納付) + 納付税額(@均等割, @均等割中間納付) %></AAB01700>
|
87
|
+
<AAB01800 />
|
88
|
+
<AAB01900><%= 納付税額(@確定法人税割, @法人税割中間納付) + 納付税額(@均等割, @均等割中間納付) %></AAB01900>
|
89
|
+
<AAC00100>
|
90
|
+
<AAC00200><%= @jigyosho_name %></AAC00200>
|
91
|
+
<AAC00300><%= @address %></AAC00300>
|
92
|
+
<AAC00400><%= @employee %></AAC00400>
|
93
|
+
<AAC00500><%= @employee %></AAC00500>
|
94
|
+
</AAC00100>
|
95
|
+
<AAC00600><%# 全従業者数 %></AAC00600>
|
96
|
+
<AAC00700><%= @employee %></AAC00700>
|
97
|
+
<AAC00800><%= @employee %></AAC00800>
|
98
|
+
<AAD00100>
|
99
|
+
<AAD00200 />
|
100
|
+
<AAD00300 />
|
101
|
+
<AAD00400 />
|
102
|
+
<AAD00500 />
|
103
|
+
<AAD00600 />
|
104
|
+
</AAD00100>
|
105
|
+
<AAE00100>
|
106
|
+
<gen:era />
|
107
|
+
<gen:yy />
|
108
|
+
<gen:mm />
|
109
|
+
<gen:dd />
|
110
|
+
</AAE00100>
|
111
|
+
<AAE01000>
|
112
|
+
<gen:era />
|
113
|
+
<gen:yy />
|
114
|
+
<gen:mm />
|
115
|
+
<gen:dd />
|
116
|
+
</AAE01000>
|
117
|
+
<AAE01100>
|
118
|
+
<gen:era />
|
119
|
+
<gen:yy />
|
120
|
+
<gen:mm />
|
121
|
+
<gen:dd />
|
122
|
+
</AAE01100>
|
123
|
+
<AAE00200>1</AAE00200><%# 青色申告 %>
|
124
|
+
<AAE00300><%= @税額.dig(:houjin, :kokuzei) > 200000 ? 1 : 2 %></AAE00300>
|
125
|
+
<AAE00400>
|
126
|
+
<gen:era />
|
127
|
+
<gen:yy />
|
128
|
+
<gen:mm />
|
129
|
+
<gen:dd />
|
130
|
+
</AAE00400>
|
131
|
+
<AAE00500>
|
132
|
+
<gen:era />
|
133
|
+
<gen:yy />
|
134
|
+
<gen:mm />
|
135
|
+
<gen:dd />
|
136
|
+
</AAE00500>
|
137
|
+
<AAE00600>2</AAE00600>
|
138
|
+
<AAE00700><%= eltax_kouza %></AAE00700>
|
139
|
+
<AAE00800><%= 中間還付税額(@確定法人税割, @法人税割中間納付) %></AAE00800>
|
140
|
+
<AAE00900 />
|
141
|
+
<AAJ_DAIRI_NAME></AAJ_DAIRI_NAME>
|
142
|
+
<AAJ_DAIRI_TEL_NUM></AAJ_DAIRI_TEL_NUM>
|
143
|
+
</R0504AA180>
|
@@ -136,18 +136,18 @@
|
|
136
136
|
<AAE01500><%= @所得割 - 事業税中間納付 %></AAE01500>
|
137
137
|
<%= render_attr('AAK00100', @所得割) %>
|
138
138
|
<%= render_attr('AAK00200', 37) %>
|
139
|
-
<%= render_attr('AAK00300',
|
139
|
+
<%= render_attr('AAK00300', 特別法人事業税(@所得割)) %>
|
140
140
|
<AAK00400 />
|
141
141
|
<AAK00500 />
|
142
142
|
<AAK00600 />
|
143
|
-
<%= render_attr('AAK00700',
|
143
|
+
<%= render_attr('AAK00700', 特別法人事業税(@所得割)) %>
|
144
144
|
<AAK00800 />
|
145
|
-
<%= render_attr('AAK00850',
|
145
|
+
<%= render_attr('AAK00850', 特別法人事業税(@所得割)) %>
|
146
146
|
<%= render_attr('AAK00900', @地方特別法人事業税中間納付) %>
|
147
147
|
<AAK01000 />
|
148
|
-
<AAK01100><%=
|
148
|
+
<AAK01100><%= 特別法人事業税(@所得割) - @地方特別法人事業税中間納付 %></AAK01100>
|
149
149
|
<AAK01200 />
|
150
|
-
<AAK01300><%=
|
150
|
+
<AAK01300><%= 特別法人事業税(@所得割) - @地方特別法人事業税中間納付 %></AAK01300>
|
151
151
|
<%= render_attr('AAF00100', 当期所得金額) %>
|
152
152
|
<AAF00200 />
|
153
153
|
<AAF00300 />
|
@@ -157,7 +157,7 @@
|
|
157
157
|
<%= render_attr('AAF00700', @繰越損失管理.deduction) %>
|
158
158
|
<%= render_attr('AAG00100', 所得金額) %>
|
159
159
|
<AAH00100 />
|
160
|
-
<AAH00200><%= 中間還付税額(@確定法人税割, @法人税割中間納付) + 中間還付税額(@所得割, 事業税中間納付) + 中間還付税額(
|
160
|
+
<AAH00200><%= 中間還付税額(@確定法人税割, @法人税割中間納付) + 中間還付税額(@所得割, 事業税中間納付) + 中間還付税額(特別法人事業税(@所得割), @地方特別法人事業税中間納付) %></AAH00200>
|
161
161
|
<AAH00400><%= eltax_kouza %></AAH00400>
|
162
162
|
<AAI00100>
|
163
163
|
<gen:era />
|
data/lib/luca/jp/util.rb
CHANGED
@@ -21,10 +21,10 @@ module Luca
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
def prepaid_tax(code)
|
25
|
-
#LucaSupport::Code.readable(@bs_data.dig(code) || 0)
|
24
|
+
def prepaid_tax(code, customer = nil)
|
26
25
|
search_end = @end_date.prev_month # exclude year end adjustment
|
27
|
-
|
26
|
+
header = { customer: customer } unless customer.nil?
|
27
|
+
amount, _ = self.class.net(@start_date.year, @start_date.month, search_end.year, search_end.month, code: code, header: header)
|
28
28
|
LucaSupport::Code.readable(amount[code] || 0)
|
29
29
|
end
|
30
30
|
|
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.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chuma Takahiro
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-27 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: '0'
|
19
|
+
version: '0.4'
|
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: '0'
|
26
|
+
version: '0.4'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,6 +98,7 @@ files:
|
|
98
98
|
- lib/luca/jp/templates/beppyo7.xml.erb
|
99
99
|
- lib/luca/jp/templates/chidai-meisai.xml.erb
|
100
100
|
- lib/luca/jp/templates/consumption.xtx.erb
|
101
|
+
- lib/luca/jp/templates/el-no20.xml.erb
|
101
102
|
- lib/luca/jp/templates/el-no6-43.xml.erb
|
102
103
|
- lib/luca/jp/templates/el-no6-9.xml.erb
|
103
104
|
- lib/luca/jp/templates/el-no6.xml.erb
|