luca-jp 0.1.0 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/exe/luca-jp +57 -0
  3. data/lib/luca/jp.rb +13 -0
  4. data/lib/luca/jp/aoiro.rb +470 -0
  5. data/lib/luca/jp/chihouzei.rb +197 -0
  6. data/lib/luca/jp/common.rb +216 -0
  7. data/lib/luca/jp/it_part.rb +99 -0
  8. data/lib/luca/jp/sonshitsu.rb +102 -0
  9. data/lib/luca/jp/syouhizei.rb +120 -12
  10. data/lib/luca/jp/templates/aoiro.xtx.erb +21 -0
  11. data/lib/luca/jp/templates/beppyo1-next.xml.erb +31 -0
  12. data/lib/luca/jp/templates/beppyo1.xml.erb +71 -0
  13. data/lib/luca/jp/templates/beppyo15.xml.erb +30 -0
  14. data/lib/luca/jp/templates/beppyo2.xml.erb +9 -0
  15. data/lib/luca/jp/templates/beppyo4.xml.erb +84 -0
  16. data/lib/luca/jp/templates/beppyo51.xml.erb +85 -0
  17. data/lib/luca/jp/templates/beppyo52.xml.erb +241 -0
  18. data/lib/luca/jp/templates/beppyo7.xml.erb +31 -0
  19. data/lib/luca/jp/templates/consumption.xtx.erb +21 -0
  20. data/lib/luca/jp/templates/el-no6-43.xml.erb +178 -0
  21. data/lib/luca/jp/templates/el-no6-9.xml.erb +51 -0
  22. data/lib/luca/jp/templates/el-no6.xml.erb +206 -0
  23. data/lib/luca/jp/templates/eltax.xml.erb +117 -0
  24. data/lib/luca/jp/templates/fuhyo43.xml.erb +37 -0
  25. data/lib/luca/jp/templates/fuhyo53.xml.erb +24 -0
  26. data/lib/luca/jp/templates/gaikyo.xml.erb +89 -0
  27. data/lib/luca/jp/templates/kariuke-meisai.xml.erb +37 -0
  28. data/lib/luca/jp/templates/syouhizei-shinkoku-kanni.xml.erb +95 -0
  29. data/lib/luca/jp/templates/tekiyougaku.xml.erb +35 -0
  30. data/lib/luca/jp/templates/yakuin-meisai.xml.erb +13 -0
  31. data/lib/luca/jp/templates/yokin-meisai.xml.erb +13 -0
  32. data/lib/luca/jp/util.rb +69 -0
  33. data/lib/luca/jp/version.rb +1 -1
  34. metadata +30 -2
@@ -0,0 +1,102 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'date'
4
+ require 'pathname'
5
+ require 'yaml'
6
+ require 'luca_book'
7
+ require 'luca_support/config'
8
+
9
+ module Luca
10
+ module Jp
11
+ # 青色申告に基く繰越損失の計算
12
+ #
13
+ class Sonshitsu
14
+ # 当期控除額
15
+ attr_reader :deduction
16
+ # 控除後所得
17
+ attr_reader :profit
18
+ # 各期繰越損失
19
+ attr_reader :records
20
+
21
+ def initialize(records, date)
22
+ @records = records
23
+ @report_date = date
24
+ net_amount
25
+ @deduction = 0
26
+ @profit = 0
27
+ end
28
+
29
+ # sonshitsu format is as bellows:
30
+ #
31
+ # - start_date: 2020-01-01
32
+ # end_date: 2020-12-31
33
+ # increase: 1000000
34
+ # - start_date: 2021-01-01
35
+ # end_date: 2021-12-31
36
+ # decrease: 800000
37
+ #
38
+ def self.load(this_year)
39
+ records = if File.exist?(record_file)
40
+ YAML.load_file(record_file)
41
+ .filter { |record| record['start_date'] > this_year.prev_year(11) && record['end_date'] < this_year }
42
+ .sort { |a, b| a['start_date'] <=> b['start_date'] }
43
+ else
44
+ []
45
+ end
46
+ new(records, this_year)
47
+ end
48
+
49
+ def save
50
+ File.open(self.class.record_file, 'w') { |f| f.puts YAML.dump(@records)}
51
+ self
52
+ end
53
+
54
+ def update(profit_or_loss)
55
+ return self if profit_or_loss == 0
56
+
57
+ if profit_or_loss < 0
58
+ start_date, end_date = LucaBook::Util.current_fy(@report_date)
59
+ @records << {
60
+ 'start_date' => start_date,
61
+ 'end_date' => end_date,
62
+ 'increase' => profit_or_loss.abs
63
+ }
64
+ @profit = profit_or_loss
65
+ return self
66
+ end
67
+
68
+ @records.each do |record|
69
+ next if profit_or_loss <= 0
70
+ next if record['amount'] <= 0
71
+
72
+ decrease_amount = [record['amount'], profit_or_loss].min
73
+ record['decrease'] ||= []
74
+ record['decrease'] << { 'date' => @report_date, 'val' => decrease_amount }
75
+ record['amount'] -= decrease_amount
76
+ profit_or_loss -= decrease_amount
77
+ @deduction += decrease_amount
78
+ end
79
+ @profit = profit_or_loss
80
+ self
81
+ end
82
+
83
+ def net_amount
84
+ @records.each do |record|
85
+ record['amount'] = record['increase'] - past_decreased(record['decrease'])
86
+ record['decrease'] = record['decrease']&.reject { |decrease_record| decrease_record['date'] > @report_date.prev_year }
87
+ end
88
+ end
89
+
90
+ def past_decreased(decrease_records)
91
+ return 0 if decrease_records.nil?
92
+
93
+ decrease_records.filter { |record| record['date'] <= @report_date.prev_year }
94
+ .map { |record| record['val'] }.sum || 0
95
+ end
96
+
97
+ def self.record_file
98
+ Pathname(LucaSupport::PJDIR) / 'data' / 'balance' / 'sonshitsu.yml'
99
+ end
100
+ end
101
+ end
102
+ end
@@ -1,31 +1,113 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'json'
4
+ require 'cgi/escape'
3
5
  require 'luca_book'
4
6
  require 'luca_support'
5
7
  require 'luca_record/dict'
6
8
  require 'luca_support/config'
9
+ require 'luca/jp/util'
7
10
 
8
11
  module Luca
9
12
  module Jp
10
- class Syouhizei
11
- def initialize(from_year, from_month, to_year = from_year, to_month = from_month)
12
- @dict = LucaRecord::Dict.load('base.tsv')
13
- @state = LucaBook::State.range(from_year, from_month, to_year, to_month)
14
- end
13
+ class Syouhizei < LucaBook::State
14
+ include LucaSupport::View
15
+ include Luca::Jp::ItPart
16
+ include Luca::Jp::Util
17
+
18
+ @dirname = 'journals'
19
+ @record_type = 'raw'
15
20
 
16
21
  # TODO: 軽減税率売上の識別
17
22
  #
18
- def kani
19
- 税率 = 10 # percent
20
- @state.pl
21
- sales = @state.pl_data.dig('A0')
22
- tax_amount = sales * 10 / 100
23
- みなし仕入額 = tax_amount * みなし仕入率(LucaSupport::CONFIG.dig('jp', 'syouhizei_kubun')) / 100
24
- 税額 = LucaSupport::Code.readable(tax_amount - みなし仕入額)
23
+ def kani(export: false)
24
+ set_pl(4)
25
+ set_bs(4)
26
+ @issue_date = Date.today
27
+ @company = CGI.escapeHTML(config.dig('company', 'name'))
28
+ @software = 'LucaJp'
29
+ 税率 = BigDecimal('7.8') # percent
30
+ 地方税率 = BigDecimal('2.2')
31
+
32
+ @sales = @pl_data.dig('A0') * 100 / (100 + 税率 + 地方税率).floor
33
+ @tax_amount = (課税標準額(@sales) * 税率 / 100).floor
34
+ @みなし仕入税額 = (@tax_amount * みなし仕入率(config.dig('jp', 'syouhizei_kubun')) / 100).floor
35
+ @税額 = LucaSupport::Code.readable(((@tax_amount - @みなし仕入税額) / 100).floor * 100)
36
+ @譲渡割額 = (@税額 * 地方税率 / (税率*100)).floor * 100
37
+ @中間納付額 = prepaid_tax('185B')
38
+ @地方税中間納付額 = prepaid_tax('185C')
39
+
40
+ if export
41
+ {
42
+ kokuzei: {
43
+ zeigaku: @税額,
44
+ chukan: @中間納付額
45
+ },
46
+ chihou: {
47
+ zeigaku: @譲渡割額,
48
+ chukan: @地方税中間納付額
49
+ }
50
+ }
51
+ else
52
+ @procedure_code = 'RSH0040'
53
+ @procedure_name = '消費税及び地方消費税申告(簡易課税・法人)'
54
+ @version = '20.0.0'
55
+ @form_sec = ['SHA020', 'SHB047', 'SHB067'].map{ |c| form_rdf(c) }.join('')
56
+ @it = it_part
57
+ @form_data = [申告書簡易課税, 付表四の三, 付表五の三].join("\n")
58
+ render_erb(search_template('consumption.xtx.erb'))
59
+ end
60
+ end
61
+
62
+ def 申告書簡易課税
63
+ render_erb(search_template('syouhizei-shinkoku-kanni.xml.erb'))
64
+ end
65
+
66
+ def 付表四の三
67
+ render_erb(search_template('fuhyo43.xml.erb'))
68
+ end
69
+
70
+ def 付表五の三
71
+ render_erb(search_template('fuhyo53.xml.erb'))
72
+ end
73
+
74
+ def export_json
75
+ dat = kani(export: true)
76
+ [].tap do |res|
77
+ item = {}
78
+ item['date'] = @end_date
79
+ item['debit'] = []
80
+ item['credit'] = []
81
+ if dat[:kokuzei][:chukan] > 0
82
+ item['credit'] << { 'label' => '仮払消費税', 'amount' => dat[:kokuzei][:chukan] }
83
+ end
84
+ if dat[:kokuzei][:chukan] > dat[:kokuzei][:zeigaku]
85
+ item['debit'] << { 'label' => '未収消費税等', 'amount' => dat[:kokuzei][:chukan] - dat[:kokuzei][:zeigaku] }
86
+ else
87
+ item['credit'] << { 'label' => '未払消費税等', 'amount' => dat[:kokuzei][:zeigaku] - dat[:kokuzei][:chukan] }
88
+ end
89
+ item['debit'] << { 'label' => '消費税', 'amount' => dat[:kokuzei][:zeigaku] }
90
+ if dat[:chihou][:chukan] > 0
91
+ item['credit'] << { 'label' => '仮払地方消費税', 'amount' => dat[:chihou][:chukan] }
92
+ end
93
+ if dat[:chihou][:chukan] > dat[:chihou][:zeigaku]
94
+ item['debit'] << { 'label' => '未収消費税等', 'amount' => dat[:chihou][:chukan] - dat[:chihou][:zeigaku] }
95
+ else
96
+ item['credit'] << { 'label' => '未払消費税等', 'amount' => dat[:chihou][:zeigaku] - dat[:chihou][:chukan] }
97
+ end
98
+ item['debit'] << { 'label' => '消費税', 'amount' => dat[:chihou][:zeigaku] }
99
+ item['x-editor'] = 'LucaJp'
100
+ res << item
101
+ puts JSON.dump(res)
102
+ end
25
103
  end
26
104
 
27
105
  private
28
106
 
107
+ def 課税標準額(課税資産の譲渡等の対価の額)
108
+ (課税資産の譲渡等の対価の額 / 1000).floor * 1000
109
+ end
110
+
29
111
  def みなし仕入率(事業区分)
30
112
  {
31
113
  1 => 90,
@@ -36,6 +118,32 @@ module Luca
36
118
  6 => 40
37
119
  }[事業区分]
38
120
  end
121
+
122
+ def 事業区分
123
+ tags = case config.dig('jp', 'syouhizei_kubun')
124
+ when 1
125
+ ['ABL00030', 'ABL00040', 'ABL00050']
126
+ when 2
127
+ ['ABL00060', 'ABL00070', 'ABL00080']
128
+ when 3
129
+ ['ABL00090', 'ABL00100', 'ABL00110']
130
+ when 4
131
+ ['ABL00120', 'ABL00130', 'ABL00140']
132
+ when 5
133
+ ['ABL00150', 'ABL00160', 'ABL00170']
134
+ when 6
135
+ ['ABL00180', 'ABL00190', 'ABL00200']
136
+ else
137
+ return nil
138
+ end
139
+ amount = render_attr(tags[1], LucaSupport::Code.readable(@sales))
140
+ share = render_attr(tags[2], '100.0')
141
+ render_attr(tags[0], [amount, share].join(''))
142
+ end
143
+
144
+ def lib_path
145
+ __dir__
146
+ end
39
147
  end
40
148
  end
41
149
  end
@@ -0,0 +1,21 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
2
+ <DATA id="DATA" xmlns="http://xml.e-tax.nta.go.jp/XSD/hojin" xmlns:gen="http://xml.e-tax.nta.go.jp/XSD/general" xmlns:kyo="http://xml.e-tax.nta.go.jp/XSD/kyotsu" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3
+ <<%= @procedure_code %> VR="<%= @version %>" id="<%= @procedure_code %>">
4
+ <CATALOG id="CATALOG">
5
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
6
+ <rdf:description id="REPORT">
7
+ <SEND_DATA/>
8
+ <FORM_SEC><rdf:Seq><%= @form_sec %></rdf:Seq></FORM_SEC>
9
+ <IT_SEC><rdf:description about="#IT"/></IT_SEC>
10
+ <TENPU_SEC/><XBRL_SEC/><XBRL_2_1_SEC/>
11
+ <SOFUSHO_SEC/><ATTACH_SEC/><CSV_SEC/>
12
+ </rdf:description>
13
+ </rdf:RDF>
14
+ </CATALOG>
15
+ <CONTENTS id="CONTENTS">
16
+
17
+ <%= @it %>
18
+ <%= @form_data %>
19
+ </CONTENTS>
20
+ </<%= @procedure_code %>>
21
+ </DATA>
@@ -0,0 +1,31 @@
1
+ <HOA116 page="1" VR="1.0" id="HOA116" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
2
+
3
+ <QHA00000><QHA00010>
4
+ <QHA00020 IDREF="JIGYO_NENDO_FROM"/>
5
+ <QHA00030 IDREF="JIGYO_NENDO_TO"/>
6
+ </QHA00010>
7
+ <QHA00040 IDREF="NOZEISHA_NM"/>
8
+ </QHA00000>
9
+ <QHB00000>
10
+ <QHB00010>
11
+ <%= render_attr('QHB00020', '12') %>
12
+ <%= render_attr('QHB00030', 中小企業の軽減税率対象所得) %>
13
+ </QHB00010>
14
+ <%= render_attr('QHB00070', 中小企業の軽減税率対象を超える所得) %>
15
+ <QHB00080>
16
+ <QHB00090><kubun_CD>1</kubun_CD></QHB00090><%# 15% %>
17
+ <%= render_attr('QHB00100', 中小企業の軽減税額) %>
18
+ </QHB00080>
19
+ <QHB00120>
20
+ <QHB00130><kubun_CD>2</kubun_CD></QHB00130><%# 23.2% %>
21
+ <%= render_attr('QHB00140', 一般区分の税額) %>
22
+ </QHB00120>
23
+ </QHB00000>
24
+ <QHC00000>
25
+ <%= render_attr('QHC00010', @地方法人税課税標準) %>
26
+ <QHC00030>
27
+ <QHC00040><kubun_CD>2</kubun_CD></QHC00040><%# 10.3% %>
28
+ <%= render_attr('QHC00050', 地方法人税額(@地方法人税課税標準)) %>
29
+ </QHC00030>
30
+ </QHC00000>
31
+ </HOA116>
@@ -0,0 +1,71 @@
1
+ <HOA112 page="1" VR="2.0" id="HOA112" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
2
+ <BGA00000>
3
+ <BGA00010 IDREF="TEISYUTSU_DAY"/>
4
+ <BGA00020 IDREF="ZEIMUSHO"/>
5
+ <BGA00030 IDREF="NOZEISHA_ADR"/>
6
+ <BGA00040 IDREF="NOZEISHA_TEL"/>
7
+ <BGA00050>
8
+ <BGA00060 IDREF="NOZEISHA_NM_KN"/>
9
+ <BGA00070 IDREF="NOZEISHA_NM"/>
10
+ </BGA00050>
11
+ <BGA00080 IDREF="NOZEISHA_BANGO"/>
12
+ <BGA00090>
13
+ <BGA00100 IDREF="DAIHYO_NM_KN"/>
14
+ <BGA00110 IDREF="DAIHYO_NM"/>
15
+ </BGA00090>
16
+ <BGA00120 IDREF="DAIHYO_ADR"/>
17
+ <BGA00140 IDREF="JIGYO_NAIYO"/>
18
+ <BGA00150 IDREF="SHIHON_KIN"/>
19
+ <BGA00210>
20
+ <BGA00220><kubun_CD>1</kubun_CD></BGA00220>
21
+ <BGA00230><kubun_CD>1</kubun_CD></BGA00230>
22
+ <BGA00240><kubun_CD>1</kubun_CD></BGA00240>
23
+ <BGA00250><kubun_CD>1</kubun_CD></BGA00250>
24
+ <BGA00260><kubun_CD>1</kubun_CD></BGA00260>
25
+ </BGA00210>
26
+ <%= render_attr('BGA00290', @概況売上) %>
27
+ <BGA00300><kubun_CD>1</kubun_CD></BGA00300>
28
+ <BGA00330>
29
+ <BGA00340 IDREF="JIGYO_NENDO_FROM"/>
30
+ <BGA00350 IDREF="JIGYO_NENDO_TO"/>
31
+ </BGA00330>
32
+ <BGA00360 IDREF="SHINKOKU_KBN"/>
33
+ <BGA00420 IDREF="KANPU_KINYUKIKAN"/>
34
+ </BGA00000>
35
+
36
+ <BGB00000>
37
+ <%= render_attr('BGB00010', 所得金額) %>
38
+ <%= render_attr('BGB00020', @法人税額) %>
39
+ <%= render_attr('BGB00040', @法人税額) %>
40
+ <BGB00120>
41
+ <%= render_attr('BGB00150', @法人税額) %>
42
+ </BGB00120>
43
+ <%= render_attr('BGB00190', @確定法人税額) %>
44
+ <%= render_attr('BGB00200', @法人税中間納付) %>
45
+ <%= render_attr('BGB00210', 納付税額(@確定法人税額, @法人税中間納付)) %>
46
+ <BGB00320>
47
+ <%= render_attr('BGB00340', 中間還付税額(@確定法人税額, @法人税中間納付)) %>
48
+ <BGB00380>
49
+ <%= render_attr('BGB00400', 中間還付税額(@確定法人税額, @法人税中間納付)) %>
50
+ </BGB00380>
51
+ </BGB00320>
52
+ <%= render_attr('BGB00460', 当期控除計) %>
53
+ <%= render_attr('BGB00470', 翌期繰越損失 + 当期繰越損失) %>
54
+ </BGB00000>
55
+ <BGC00000>
56
+ <BGC00010>
57
+ <BGC00020>
58
+ <%= render_attr('BGC00030', 中小企業の軽減税額 + 一般区分の税額) %>
59
+ </BGC00020>
60
+ <%= render_attr('BGC00050', @地方法人税課税標準) %>
61
+ </BGC00010>
62
+ <%= render_attr('BGC00060', @地方法人税額) %>
63
+ <%= render_attr('BGC00080', @地方法人税額) %>
64
+ <%= render_attr('BGC00120', @確定地方法人税額) %>
65
+ <%= render_attr('BGC00130', @地方法人税中間納付) %>
66
+ <%= render_attr('BGC00140', 納付税額(@確定地方法人税額, @地方法人税中間納付)) %>
67
+ <BGC00150>
68
+ <%= render_attr('BGC00170', 中間還付税額(@確定地方法人税額, @地方法人税中間納付)) %>
69
+ </BGC00150>
70
+ </BGC00000>
71
+ </HOA112>
@@ -0,0 +1,30 @@
1
+ <HOE200 page="1" VR="13.0" id="HOE200" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
2
+ <EGA00000>
3
+ <EGA00010>
4
+ <EGA00020 IDREF="JIGYO_NENDO_FROM"/>
5
+ <EGA00030 IDREF="JIGYO_NENDO_TO"/>
6
+ </EGA00010>
7
+ <EGA00040 IDREF="NOZEISHA_NM"/>
8
+ </EGA00000>
9
+ <%= render_attr('EGB00000', @交際費) %>
10
+ <EGC00000>
11
+ <%= render_attr('EGC00020', 12) %>
12
+ <%= render_attr('EGC00030', @限度額) %>
13
+ </EGC00000>
14
+ <EGD00000>
15
+ <%= render_attr('EGD00020', @限度額) %>
16
+ </EGD00000>
17
+ <%= render_attr('EGE00000', @不算入額) %>
18
+ <EGF00000>
19
+ <EGF00010>
20
+ <%= render_attr('EGF00020', @交際費) %>
21
+ <%= render_attr('EGF00030', 0) %>
22
+ <%= render_attr('EGF00040', @交際費) %>
23
+ </EGF00010>
24
+ <EGF00100>
25
+ <%= render_attr('EGF00110', @交際費) %>
26
+ <%= render_attr('EGF00120', 0) %>
27
+ <%= render_attr('EGF00130', @交際費) %>
28
+ </EGF00100>
29
+ </EGF00000>
30
+ </HOE200>
@@ -0,0 +1,9 @@
1
+ <HOA201 page="1" VR="4.0" id="HOA201" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
2
+ <VAA00000>
3
+ <VAA00010>
4
+ <VAA00020 IDREF="JIGYO_NENDO_FROM"/>
5
+ <VAA00030 IDREF="JIGYO_NENDO_TO"/>
6
+ </VAA00010>
7
+ <VAA00040 IDREF="NOZEISHA_NM"/>
8
+ </VAA00000>
9
+ </HOA201>
@@ -0,0 +1,84 @@
1
+ <HOA420 page="1" VR="19.0" id="HOA420" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
2
+ <ARA00000>
3
+ <ARA00010>
4
+ <ARA00020 IDREF="JIGYO_NENDO_FROM"/>
5
+ <ARA00030 IDREF="JIGYO_NENDO_TO"/>
6
+ </ARA00010>
7
+ <ARA00040 IDREF="NOZEISHA_NM"/>
8
+ </ARA00000>
9
+ <ARB00000>
10
+ <%= render_attr('ARB00010', @当期純損益) %>
11
+ <%= render_attr('ARB00020', @当期純損益) %>
12
+ </ARB00000>
13
+ <ARC00000>
14
+ <ARC00010>
15
+ <%= render_attr('ARC00020', 法人税損金納付額 + 法人税仮払納付額) %>
16
+ <%= render_attr('ARC00030', 法人税損金納付額 + 法人税仮払納付額) %>
17
+ </ARC00010>
18
+ <ARC00040>
19
+ <%= render_attr('ARC00050', (都道府県民税損金納付 + 市民税損金納付 + 都道府県民税仮払納付 + 市民税仮払納付)) %>
20
+ <%= render_attr('ARC00060', (都道府県民税損金納付 + 市民税損金納付 + 都道府県民税仮払納付 + 市民税仮払納付)) %>
21
+ </ARC00040>
22
+ <ARC00100>
23
+ <%= render_attr('ARC00110', (@法人税等 - 法人税損金納付額 - 都道府県民税損金納付 - 市民税損金納付)) %>
24
+ <%= render_attr('ARC00120', (@法人税等 - 法人税損金納付額 - 都道府県民税損金納付 - 市民税損金納付)) %>
25
+ </ARC00100>
26
+ <%= 別表四還付事業税 %>
27
+ <% if (@還付法人税 + @還付都道府県住民税 + @還付市民税) > 0 %>
28
+ <ARC00220>
29
+ <%= render_attr('ARC00230', '前期仮払税金否認') %>
30
+ <%= render_attr('ARC00240', (@還付法人税 + @還付都道府県住民税 + @還付市民税)) %>
31
+ <%= render_attr('ARC00250', (@還付法人税 + @還付都道府県住民税 + @還付市民税)) %>
32
+ </ARC00220>
33
+ <% end %>
34
+ <ARC00325>
35
+ <%= render_attr('ARC00330', @法人税等 + @還付事業税 + 法人税仮払納付額 + 都道府県民税仮払納付 + 市民税仮払納付 + @還付法人税 + @還付都道府県住民税 + @還付市民税) %>
36
+ <%= render_attr('ARC00340', @法人税等 + @還付事業税 + 法人税仮払納付額 + 都道府県民税仮払納付 + 市民税仮払納付 + @還付法人税 + @還付都道府県住民税 + @還付市民税) %>
37
+ </ARC00325>
38
+ </ARC00000>
39
+ <ARD00000>
40
+ <ARD00040>
41
+ <%= render_attr('ARD00050', @納付事業税) %>
42
+ <%= render_attr('ARD00060', @納付事業税) %>
43
+ </ARD00040>
44
+ <ARD00100>
45
+ <%= render_attr('ARD00110', @還付法人税 + @還付都道府県住民税 + @還付市民税) %>
46
+ <%= render_attr('ARD00120', @還付法人税 + @還付都道府県住民税 + @還付市民税) %>
47
+ </ARD00100>
48
+ <% if (法人税仮払納付額 + 都道府県民税仮払納付 + 市民税仮払納付) > 0 %>
49
+ <ARD00215>
50
+ <%= render_attr('ARD00220', '仮払税金認定損') %>
51
+ <%= render_attr('ARD00230', (法人税仮払納付額 + 都道府県民税仮払納付 + 市民税仮払納付)) %>
52
+ <%= render_attr('ARD00240', (法人税仮払納付額 + 都道府県民税仮払納付 + 市民税仮払納付)) %>
53
+ </ARD00215>
54
+ <% end %>
55
+ <ARD00280>
56
+ <%= render_attr('ARD00290', (@納付事業税 + 法人税仮払納付額 + 都道府県民税仮払納付 + 市民税仮払納付 + @還付法人税 + @還付都道府県住民税 + @還付市民税)) %>
57
+ <%= render_attr('ARD00300', (@納付事業税 + 法人税仮払納付額 + 都道府県民税仮払納付 + 市民税仮払納付 + @還付法人税 + @還付都道府県住民税 + @還付市民税)) %>
58
+ </ARD00280>
59
+ </ARD00000>
60
+ <ARE00000>
61
+ <%= render_attr('ARE00010', @別表四調整所得) %>
62
+ <%= render_attr('ARE00020', @別表四調整所得) %>
63
+ </ARE00000>
64
+ <ARK00000>
65
+ <%= render_attr('ARK00010', @別表四調整所得) %>
66
+ <%= render_attr('ARK00020', @別表四調整所得) %>
67
+ </ARK00000>
68
+ <ARM00000>
69
+ <%= render_attr('ARM00010', @別表四調整所得) %>
70
+ <%= render_attr('ARM00020', @別表四調整所得) %>
71
+ </ARM00000>
72
+ <ARS00000>
73
+ <%= render_attr('ARS00010', @別表四調整所得) %>
74
+ <%= render_attr('ARS00020', @別表四調整所得) %>
75
+ </ARS00000>
76
+ <ART00000>
77
+ <%= render_attr('ART00010', @繰越損失管理.deduction) %>
78
+ <%= render_attr('ART00020', @繰越損失管理.deduction) %>
79
+ </ART00000>
80
+ <ARV00000>
81
+ <%= render_attr('ARV00010', @別表四調整所得 - @繰越損失管理.deduction) %>
82
+ <%= render_attr('ARV00020', @別表四調整所得 - @繰越損失管理.deduction) %>
83
+ </ARV00000>
84
+ </HOA420>