luca-jp 0.2.4 → 0.7.0

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: b52a931f2268427904135b52cac066411eeb52256c0c136b30862a4ea0d4771e
4
- data.tar.gz: c83a16ff2ae64a8199ce8768da53d0cc2987f2b1ee6955de47a6b5718aa14bbb
3
+ metadata.gz: 3b66dbdc4bfe4b3dbde23a58cfff90901ca05fd0dc5b4b180c6f7229a24e499a
4
+ data.tar.gz: d90a7ae0ff13f5843aaec9fe482c6751bda8d50f87e7ff29f7a61635640f18ed
5
5
  SHA512:
6
- metadata.gz: 85bad06f6af2920dda348d1a61b4521d16a143937dc710e6ea3dca650a65fd5ca1911beb0dd377c97d17eefab7c5e058490f7129339b7834ff476639b6d0f6e5
7
- data.tar.gz: '048199e0f592eddc0a987ccb43d7b517955fb783db4484f00ed4d5cfa86e0b2ef1d2c577c7e3acec1e1c0f7ea888b0a42c840131152ba91c618544fb9ce753a6'
6
+ metadata.gz: 38b0a53ff70c2b5d145be4725d9866c6c37d727e14463acfe4e044c52fc30f977f2a44e70a2971ee882374c6529d5b1becca360e11bed9108e48bd1104dded06
7
+ data.tar.gz: 4ca2bae386c0a17f36454af98dbd8a1273b5756e12cc65ba73d790446e6376e3bd1384fc976931c5eb4b2404b84594e8743eb4f9f910bf632818e4e4daee9310
data/lib/luca/jp/aoiro.rb CHANGED
@@ -27,6 +27,7 @@ module Luca
27
27
  @issue_date = Date.today
28
28
  @company = CGI.escapeHTML(config.dig('company', 'name'))
29
29
  @software = 'LucaJp'
30
+ @shinkoku_kbn = '30' # 確定申告
30
31
 
31
32
  @税額 = 税額計算
32
33
  @確定法人税額 = @税額.dig(:houjin, :kokuzei)
@@ -51,7 +52,8 @@ module Luca
51
52
  else
52
53
  @procedure_code = 'RHO0012'
53
54
  @procedure_name = '内国法人の確定申告(青色)'
54
- @version = '20.0.2'
55
+ @form_vers = proc_version
56
+ @version = @form_vers['proc']
55
57
  @都道府県民税法人税割中間納付 = prepaid_tax('1859')
56
58
  @都道府県民税均等割中間納付 = prepaid_tax('185A')
57
59
  @都道府県民税中間納付 = @都道府県民税法人税割中間納付 + @都道府県民税均等割中間納付
@@ -116,6 +118,7 @@ module Luca
116
118
  end
117
119
 
118
120
  def 別表一
121
+ STDERR.puts "別表一: 「決算確定の日」などの追記が必要"
119
122
  render_erb(search_template('beppyo1.xml.erb'))
120
123
  end
121
124
 
@@ -148,6 +151,15 @@ module Luca
148
151
  end
149
152
 
150
153
  def 別表五一
154
+ @期首資本金 = readable(@start_balance.dig('911'))
155
+ @資本金期中減, @資本金期中増 = 純資産期中増減('911')
156
+ @期首資本準備金, @期末資本準備金 = 期首期末残高('9131')
157
+ @資本準備金期中減, @資本準備金期中増 = 純資産期中増減('9131')
158
+ @期首その他資本剰余金, @期末その他資本剰余金 = 期首期末残高('9132')
159
+ @その他資本剰余金期中減, @その他資本剰余金期中増 = 純資産期中増減('9132')
160
+ @期首自己株式, @期末自己株式 = 期首期末残高('916')
161
+ @自己株式期中減, @自己株式期中増 = 純資産期中増減('916')
162
+ @資本金等の額期中減, @資本金等の額期中増 = 資本金等の額期中増減
151
163
  render_erb(search_template('beppyo51.xml.erb'))
152
164
  end
153
165
 
@@ -221,7 +233,7 @@ module Luca
221
233
  @代表者報酬 = gaikyo('C11')
222
234
  @代表者借入 = gaikyo('5121')
223
235
  @概況仕入 = gaikyo('B11') + gaikyo('B12')
224
- @概況外注費 = gaikyo('C10')
236
+ @概況外注費 = gaikyo('C1O')
225
237
  @概況人件費 = gaikyo('C11') + gaikyo('C12') + gaikyo('C13')
226
238
  render_erb(search_template('gaikyo.xml.erb'))
227
239
  end
@@ -522,6 +534,23 @@ module Luca
522
534
  readable((@bs_data[code] || 0) * -1)
523
535
  end
524
536
 
537
+ def 別表五一期首資本
538
+ readable(@start_balance.dig('911')||0 + @start_balance.dig('913')||0)
539
+ end
540
+
541
+ # 資本金、資本準備金、その他資本剰余金、自己株式(控除)の合算
542
+ #
543
+ def 資本金等の額期中増減
544
+ inc = ['911', '913', '916'].map do |code|
545
+ credit_amount(code, @start_date.year, @start_date.month, @end_date.year, @end_date.month) || 0
546
+ end
547
+ dec = ['911', '913', '916'].map do |code|
548
+ debit_amount(code, @start_date.year, @start_date.month, @end_date.year, @end_date.month) || 0
549
+ end
550
+
551
+ [readable(dec.sum), readable(inc.sum)]
552
+ end
553
+
525
554
  def 別表七各期青色損失
526
555
  tags = @繰越損失管理.records
527
556
  .filter { |record| record['start_date'] > @end_date.prev_year(10) && record['end_date'] < @start_date }
@@ -545,22 +574,6 @@ module Luca
545
574
  tags.compact.join("\n")
546
575
  end
547
576
 
548
- def 期首資本金
549
- readable(@start_balance.dig('911')) || 0
550
- end
551
-
552
- def 期末資本金
553
- readable(@bs_data.dig('911')) || 0
554
- end
555
-
556
- def 別表五一期首資本
557
- 期首資本金
558
- end
559
-
560
- def 別表五一期末資本
561
- 期末資本金
562
- end
563
-
564
577
  def 期首未納消費税
565
578
  readable(@start_balance.dig('516')) || 0
566
579
  end
@@ -577,10 +590,10 @@ module Luca
577
590
 
578
591
  def 概況源泉徴収種類
579
592
  tags = []
580
- if credit_count('5191', @start_date.year, @start_date.month, @end_date.year, @end_date.month)
593
+ if credit_count('5191', @start_date.year, @start_date.month, @end_date.year, @end_date.month) > 0
581
594
  tags << render_attr('IAF03100', '<kubun_CD>1</kubun_CD>')
582
595
  end
583
- if credit_count('5193', @start_date.year, @start_date.month, @end_date.year, @end_date.month)
596
+ if credit_count('5193', @start_date.year, @start_date.month, @end_date.year, @end_date.month) > 0
584
597
  tags << render_attr('IAF03200', '<kubun_CD>1</kubun_CD>')
585
598
  elsif credit_count('5194', @start_date.year, @start_date.month, @end_date.year, @end_date.month)
586
599
  tags << render_attr('IAF03200', '<kubun_CD>1</kubun_CD>')
@@ -605,7 +618,7 @@ module Luca
605
618
  end
606
619
 
607
620
  def 概況月外注費(idx)
608
- gaikyo_month(idx, 'C10')
621
+ gaikyo_month(idx, 'C1O')
609
622
  end
610
623
 
611
624
  def 概況月源泉徴収(idx)
@@ -638,6 +651,14 @@ module Luca
638
651
  readable(@monthly.dig(index, code) || 0)
639
652
  end
640
653
 
654
+ def proc_version
655
+ if @end_date >= Date.parse('2021-4-1')
656
+ { 'proc' => '21.0.2', 'HOA112' => '3.1', 'HOA116' => '2.0', 'HOA420' => '20.0', 'HOA522' => '7.0', 'HOK010' => '6.0' }
657
+ else
658
+ { 'proc' => '20.0.2', 'HOA112' => '2.0', 'HOA116' => '1.0', 'HOA420' => '19.0', 'HOA522' => '6.0', 'HOK010' => '5.0' }
659
+ end
660
+ end
661
+
641
662
  def lib_path
642
663
  __dir__
643
664
  end
@@ -27,10 +27,11 @@ module Luca
27
27
  @jimusho_code = eltax_config('jimusho_code')
28
28
  @jimusho_name = eltax_config('jimusho_name')
29
29
  @app_version = eltax_config('app_version')
30
+ @form_vers = proc_version
30
31
 
31
32
  @税額 = 税額計算
32
33
  @均等割 = @税額.dig(:kenmin, :kintou)
33
- @確定法人税割 = (@税額.dig(:kenmin, :houjinzei) / 100).floor * 100
34
+ @確定法人税割 = @税額.dig(:kenmin, :houjinzei)
34
35
  @地方特別法人事業税中間納付 = prepaid_tax('1854')
35
36
  @所得割中間納付 = prepaid_tax('1855')
36
37
  @法人税割中間納付 = prepaid_tax('1859')
@@ -62,7 +63,7 @@ module Luca
62
63
  else
63
64
  @procedure_code = 'R0102100'
64
65
  @procedure_name = '法人都道府県民税・事業税・特別法人事業税又は地方法人特別税 確定申告'
65
- @form_sec = ['R0102AA190', 'R0102AG120', 別表九フォーム].compact.map{ |c| form_attr(c) }.join('')
66
+ @form_sec = ["R0102AA#{@form_vers['R0102AA']}", "R0102AG120", 別表九フォーム].compact.map{ |c| form_attr(c) }.join('')
66
67
  @user_inf = render_erb(search_template('eltax-userinf.xml.erb'))
67
68
  @form_data = [第六号, 別表四三, 別表九].compact.join("\n")
68
69
  render_erb(search_template('eltax.xml.erb'))
@@ -117,7 +118,7 @@ module Luca
117
118
  def 別表九フォーム
118
119
  return nil if @繰越損失管理.records.length == 0
119
120
 
120
- 'R0102AM190'
121
+ "R0102AM#{@form_vers['R0102AM']}"
121
122
  end
122
123
 
123
124
  def 別表九
@@ -205,6 +206,14 @@ module Luca
205
206
  end
206
207
  end
207
208
 
209
+ def proc_version
210
+ if @start_date >= Date.parse('2020-4-1')
211
+ { 'R0102AA' => '200', 'R0102AM' => '200' }
212
+ else
213
+ { 'R0102AA' => '190', 'R0102AM' => '190' }
214
+ end
215
+ end
216
+
208
217
  def lib_path
209
218
  __dir__
210
219
  end
@@ -119,6 +119,7 @@ module Luca
119
119
  end
120
120
  end
121
121
 
122
+ # 100円未満切り捨て
122
123
  def 法人税割(法人税 = nil)
123
124
  課税標準 = if 法人税
124
125
  (法人税 / 1000).floor * 1000
@@ -126,9 +127,9 @@ module Luca
126
127
  法人税割課税標準
127
128
  end
128
129
  if config.dig('jp', 'eltax', 'office_23ku')
129
- [(課税標準 * 7 / 100).floor, 0]
130
+ [(課税標準 * 7 / 100 / 100).floor * 100, 0]
130
131
  else
131
- [(課税標準 * 1 / 100).floor, (課税標準 * 6 / 100).floor]
132
+ [(課税標準 * 1 / 100 / 100).floor * 100, (課税標準 * 6 / 100 / 100).floor * 100]
132
133
  end
133
134
  end
134
135
 
@@ -143,6 +144,7 @@ module Luca
143
144
  end
144
145
  end
145
146
 
147
+ # 100円未満切り捨て
146
148
  def 所得割400万以下(所得 = nil)
147
149
  ((所得400万以下(所得) * 3.5 / 100) / 100).floor * 100
148
150
  end
@@ -160,6 +162,7 @@ module Luca
160
162
  end
161
163
  end
162
164
 
165
+ # 100円未満切り捨て
163
166
  def 所得割800万以下(所得 = nil)
164
167
  ((所得800万以下(所得) * 5.3 / 100) / 100).floor * 100
165
168
  end
@@ -175,10 +178,12 @@ module Luca
175
178
  end
176
179
  end
177
180
 
181
+ # 100円未満切り捨て
178
182
  def 所得割800万超(所得 = nil)
179
183
  ((所得800万超(所得) * 7.0 / 100) / 100).floor * 100
180
184
  end
181
185
 
186
+ # 100円未満切り捨て
182
187
  def 地方法人特別税(事業税)
183
188
  ((事業税 * 37 / 100) / 100).floor * 100
184
189
  end
@@ -224,6 +229,17 @@ module Luca
224
229
  def 地方消費税中間納付額
225
230
  prepaid_tax('185C')
226
231
  end
232
+
233
+ # -----------------------------------------------------
234
+ # :section: 外形標準の計算
235
+ # -----------------------------------------------------
236
+ def 資本金等の額
237
+ readable(@bs_data.dig('911') + @bs_data.dig('913'))
238
+ end
239
+
240
+ def 期末資本金
241
+ readable(@bs_data.dig('911'))
242
+ end
227
243
  end
228
244
  end
229
245
  end
@@ -24,7 +24,7 @@ module Luca
24
24
  entries << %Q(<TETSUZUKI ID="TETSUZUKI"><procedure_CD>#{@procedure_code}</procedure_CD><procedure_NM>#{@procedure_name}</procedure_NM></TETSUZUKI>)
25
25
  entries.concat([jigyo_nendo_from, jigyo_nendo_to, kazei_kikan_from, kazei_kikan_to])
26
26
  entries << render_it_tag('keiri_sekininsha')
27
- entries << '<SHINKOKU_KBN ID="SHINKOKU_KBN"><kubun_CD>30</kubun_CD></SHINKOKU_KBN>'
27
+ entries << %Q(<SHINKOKU_KBN ID="SHINKOKU_KBN"><kubun_CD>#{@shinkoku_kbn}</kubun_CD></SHINKOKU_KBN>)
28
28
  entries.concat(['eltax_id'].map{ |key| render_it_tag(key) })
29
29
  entries << '</IT>'
30
30
  entries.compact.join("\n")
@@ -27,6 +27,7 @@ module Luca
27
27
  @issue_date = Date.today
28
28
  @company = CGI.escapeHTML(config.dig('company', 'name'))
29
29
  @software = 'LucaJp'
30
+ @shinkoku_kbn = '1' # 確定申告
30
31
  税率 = BigDecimal('7.8') # percent
31
32
  地方税率 = BigDecimal('2.2')
32
33
 
@@ -52,7 +53,8 @@ module Luca
52
53
  else
53
54
  @procedure_code = 'RSH0040'
54
55
  @procedure_name = '消費税及び地方消費税申告(簡易課税・法人)'
55
- @version = '20.0.0'
56
+ @form_vers = proc_version
57
+ @version = @form_vers['proc']
56
58
  @form_sec = ['SHA020', 'SHB047', 'SHB067'].map{ |c| form_rdf(c) }.join('')
57
59
  @it = it_part
58
60
  @form_data = [申告書簡易課税, 付表四の三, 付表五の三].join("\n")
@@ -142,6 +144,14 @@ module Luca
142
144
  render_attr(tags[0], [amount, share].join(''))
143
145
  end
144
146
 
147
+ def proc_version
148
+ if @end_date >= Date.parse('2021-4-1')
149
+ { 'proc' => '20.0.1', 'SHA020' => '7.1' }
150
+ else
151
+ { 'proc' => '20.0.0', 'SHA020' => '7.0' }
152
+ end
153
+ end
154
+
145
155
  def lib_path
146
156
  __dir__
147
157
  end
@@ -1,4 +1,4 @@
1
- <HOA116 page="1" VR="1.0" id="HOA116" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
1
+ <HOA116 page="1" VR="<%= @form_vers['HOA116'] %>" id="HOA116" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
2
2
 
3
3
  <QHA00000><QHA00010>
4
4
  <QHA00020 IDREF="JIGYO_NENDO_FROM"/>
@@ -24,7 +24,9 @@
24
24
  <QHC00000>
25
25
  <%= render_attr('QHC00010', @地方法人税課税標準) %>
26
26
  <QHC00030>
27
- <QHC00040><kubun_CD>2</kubun_CD></QHC00040><%# 10.3% %>
27
+ <% if @form_vers['HOA116'] == '1.0' %>
28
+ <QHC00040><kubun_CD>2</kubun_CD></QHC00040><%# 10.3% %>
29
+ <% end %>
28
30
  <%= render_attr('QHC00050', 地方法人税額(@地方法人税課税標準)) %>
29
31
  </QHC00030>
30
32
  </QHC00000>
@@ -1,4 +1,4 @@
1
- <HOA112 page="1" VR="2.0" id="HOA112" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
1
+ <HOA112 page="1" VR="<%= @form_vers['HOA112'] %>" id="HOA112" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
2
2
  <BGA00000>
3
3
  <BGA00010 IDREF="TEISYUTSU_DAY"/>
4
4
  <BGA00020 IDREF="ZEIMUSHO"/>
@@ -1,4 +1,4 @@
1
- <HOA420 page="1" VR="19.0" id="HOA420" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
1
+ <HOA420 page="1" VR="<%= @form_vers['HOA420'] %>" id="HOA420" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
2
2
  <ARA00000>
3
3
  <ARA00010>
4
4
  <ARA00020 IDREF="JIGYO_NENDO_FROM"/>
@@ -73,20 +73,50 @@
73
73
  </ICB00000>
74
74
  <ICC00000>
75
75
  <ICC00010>
76
- <%= render_attr('ICC00020', 期首資本金) %>
76
+ <%= render_attr('ICC00020', @期首資本金) %>
77
77
  <ICC00030>
78
- <%= render_attr('ICC00040', 期首資本金) %>
79
- <%= render_attr('ICC00050', 期末資本金) %>
78
+ <%= render_attr('ICC00040', @資本金期中減) %>
79
+ <%= render_attr('ICC00050', @資本金期中増) %>
80
80
  </ICC00030>
81
81
  <%= render_attr('ICC00060', 期末資本金) %>
82
82
  </ICC00010>
83
+ <ICC00070>
84
+ <%= render_attr('ICC00080', @期首資本準備金) %>
85
+ <ICC00090>
86
+ <%= render_attr('ICC00100', @資本準備金期中減) %>
87
+ <%= render_attr('ICC00110', @資本準備金期中増) %>
88
+ </ICC00090>
89
+ <%= render_attr('ICC00120', @期末資本準備金) %>
90
+ </ICC00070>
91
+ <% unless [@期首その他資本剰余金, @その他資本剰余金期中減, @その他資本剰余金期中増, @期末その他資本剰余金].reject { |i| i == 0 }.compact.empty? %>
92
+ <ICC00130>
93
+ <%= render_attr('ICC00140', 'その他資本剰余金') %>
94
+ <%= render_attr('ICC00150', @期首その他資本剰余金) %>
95
+ <ICC00160>
96
+ <%= render_attr('ICC00170', @その他資本剰余金期中減) %>
97
+ <%= render_attr('ICC00180', @その他資本剰余金期中増) %>
98
+ </ICC00160>
99
+ <%= render_attr('ICC00190', @期末その他資本剰余金) %>
100
+ </ICC00130>
101
+ <% end %>
102
+ <% unless [@期首自己株式, @自己株式期中減, @自己株式期中増, @期末自己株式].reject { |i| i == 0 }.compact.empty? %>
103
+ <ICC00130>
104
+ <%= render_attr('ICC00140', '自己株式') %>
105
+ <%= render_attr('ICC00150', @期首自己株式) %>
106
+ <ICC00160>
107
+ <%= render_attr('ICC00170', @自己株式期中減) %>
108
+ <%= render_attr('ICC00180', @自己株式期中増) %>
109
+ </ICC00160>
110
+ <%= render_attr('ICC00190', @期末自己株式) %>
111
+ </ICC00130>
112
+ <% end %>
83
113
  <ICC00200>
84
114
  <%= render_attr('ICC00210', 別表五一期首資本) %>
85
115
  <ICC00220>
86
- <%= render_attr('ICC00230', 別表五一期首資本) %>
87
- <%= render_attr('ICC00240', 別表五一期末資本) %>
116
+ <%= render_attr('ICC00230', @資本金等の額期中減) %>
117
+ <%= render_attr('ICC00240', @資本金等の額期中増) %>
88
118
  </ICC00220>
89
- <%= render_attr('ICC00250', 別表五一期末資本) %>
119
+ <%= render_attr('ICC00250', 資本金等の額) %>
90
120
  </ICC00200>
91
121
  </ICC00000>
92
122
  </HOA511>
@@ -1,4 +1,4 @@
1
- <HOA522 page="1" VR="6.0" id="HOA522" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
1
+ <HOA522 page="1" VR="<%= @form_vers['HOA522'] %>" id="HOA522" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
2
2
  <IEA00000>
3
3
  <IEA00010>
4
4
  <IEA00020 IDREF="JIGYO_NENDO_FROM"/>
@@ -1,4 +1,4 @@
1
- <R0102AM190 xmlns="http://eltax.jp/HOJIN_DOFUKEN" vr="190" page="" seiseiSoft="<%= @software %>" seiseiVr="1" seiseiDay="<%= Date.today.strftime('%Y%m%d') %>" seiseiNM="<%= it_part_config('nozeisha_nm') %>" koshinSoft="" koshinVr="" koshinDay="" koshinNM="" taari="">
1
+ <R0102AM<%= @form_vers['R0102AM'] %> xmlns="http://eltax.jp/HOJIN_DOFUKEN" vr="<%= @form_vers['R0102AM'] %>" page="" seiseiSoft="<%= @software %>" seiseiVr="1" seiseiDay="<%= Date.today.strftime('%Y%m%d') %>" seiseiNM="<%= it_part_config('nozeisha_nm') %>" koshinSoft="" koshinVr="" koshinDay="" koshinNM="" taari="">
2
2
  <AMA_JIGYO_SDATE idref="SDATE">
3
3
  <gen:era></gen:era><gen:yy></gen:yy><gen:mm></gen:mm><gen:dd></gen:dd>
4
4
  <gen:yyyymmdd></gen:yyyymmdd>
@@ -48,4 +48,4 @@
48
48
  </AMC00500>
49
49
  <AMC00600 />
50
50
  <AMC00700 />
51
- </R0102AM190>
51
+ </R0102AM<%= @form_vers['R0102AM'] %>>
@@ -1,4 +1,4 @@
1
- <R0102AA190 xmlns="http://eltax.jp/HOJIN_DOFUKEN" vr="190" page="" seiseiSoft="<%= @software %>" seiseiVr="1" seiseiDay="<%= Date.today.strftime('%Y%m%d') %>" seiseiNM="<%= it_part_config('nozeisha_nm') %>" koshinSoft="" koshinVr="" koshinDay="" koshinNM="" taari="">
1
+ <R0102AA<%= @form_vers['R0102AA'] %> xmlns="http://eltax.jp/HOJIN_DOFUKEN" vr="<%= @form_vers['R0102AA'] %>" page="" seiseiSoft="<%= @software %>" seiseiVr="1" seiseiDay="<%= Date.today.strftime('%Y%m%d') %>" seiseiNM="<%= it_part_config('nozeisha_nm') %>" koshinSoft="" koshinVr="" koshinDay="" koshinNM="" taari="">
2
2
  <AAA00100 idref="SEIRI_NUM" />
3
3
  <AAA00200 idref="JIMUSHO_NUM"></AAA00200>
4
4
  <AAA00300 idref="HOJIN_NUM"></AAA00300>
@@ -19,10 +19,10 @@
19
19
  <gen:dd></gen:dd>
20
20
  </AAA00700>
21
21
  <AAA00800>
22
- <gen:era />
23
- <gen:yy />
24
- <gen:mm />
25
- <gen:dd />
22
+ <gen:era><%= gengou(@issue_date) %></gen:era>
23
+ <gen:yy><%= wareki(@issue_date) %></gen:yy>
24
+ <gen:mm><%= @issue_date.month %></gen:mm>
25
+ <gen:dd><%= @issue_date.day %></gen:dd>
26
26
  </AAA00800>
27
27
  <AAA00900 idref="ORG1_NAME"></AAA00900>
28
28
  <AAA_HONTEN_ZIP idref="HONTEN_ZIP"></AAA_HONTEN_ZIP>
@@ -41,9 +41,9 @@
41
41
  <AAA_SHIHON idref="SHIHON"></AAA_SHIHON>
42
42
  <AAA_SHIHON3></AAA_SHIHON3>
43
43
  <AAA_SHIHON4></AAA_SHIHON4>
44
- <AAA_SHIHON2><%= @資本金準備金 %></AAA_SHIHON2>
44
+ <AAA_SHIHON2><%= 資本金等の額 %></AAA_SHIHON2>
45
45
  <AAA_SHIHON5><%= @資本金準備金 %></AAA_SHIHON5>
46
- <AAA_SHIHON6><%= @資本金準備金 %></AAA_SHIHON6>
46
+ <AAA_SHIHON6><%= 資本金等の額 %></AAA_SHIHON6>
47
47
  <AAA_JIGYO_SDATE idref="SDATE">
48
48
  <gen:era></gen:era>
49
49
  <gen:yy></gen:yy>
@@ -119,7 +119,9 @@
119
119
  <AAE00810 />
120
120
  <AAE00820 />
121
121
  <%= render_attr('AAE00900', @所得割) %>
122
- <AAE00950 />
122
+ <% if @form_vers['R0102AA'] == '190' %>
123
+ <AAE00950 />
124
+ <% end %>
123
125
  <AAE00960 />
124
126
  <AAE01000 />
125
127
  <AAE01050 />
@@ -195,4 +197,4 @@
195
197
  <AAI00800 />
196
198
  <AAJ_DAIRI_NAME></AAJ_DAIRI_NAME>
197
199
  <AAJ_DAIRI_TEL_NUM></AAJ_DAIRI_TEL_NUM>
198
- </R0102AA190>
200
+ </R0102AA<%= @form_vers['R0102AA'] %>>
@@ -3,8 +3,8 @@
3
3
  <KOUSEI_KANRI_INF id="KOUSEI_KANRI_INF">
4
4
  <KOUSEI_KANRI id="KOUSEI_KANRI">
5
5
  <KANRI_INF id="KANRI_INF">
6
- <KOUSEI_KANRI_VR>0001</KOUSEI_KANRI_VR>
7
- <ORG1_CD>13000</ORG1_CD>
6
+ <KOUSEI_KANRI_VR>0001</KOUSEI_KANRI_VR><%# 固定値 %>
7
+ <ORG1_CD>13000</ORG1_CD><%# 地方公共団体コード %>
8
8
  <PROC_ID><%= @procedure_code %></PROC_ID>
9
9
  <PROC_NAME><%= @procedure_name %></PROC_NAME>
10
10
  <FIRST_RCPT_NUM></FIRST_RCPT_NUM>
@@ -12,9 +12,9 @@
12
12
  <%= @form_sec %>
13
13
  <GYOMU_PROC id="GYOMU_PROC">
14
14
  <PROC_INF id="PROC_INF">
15
- <GYOMU_KBN id="GYOMU_KBN">R0</GYOMU_KBN>
16
- <ORG2_CD id="ORG2_CD"><%= @jimusho_code %></ORG2_CD>
17
- <ORG3_CD id="ORG3_CD">000000</ORG3_CD>
15
+ <GYOMU_KBN id="GYOMU_KBN">R0</GYOMU_KBN><%# 申告 %>
16
+ <ORG2_CD id="ORG2_CD"><%= @jimusho_code %></ORG2_CD><%# 税務事務所 %>
17
+ <ORG3_CD id="ORG3_CD">000000</ORG3_CD><%# 固定値 %>
18
18
  <ORG1_NAME id="ORG1_NAME"><%= @jimusho_name %></ORG1_NAME>
19
19
  <SDATE id="SDATE">
20
20
  <gen:era><%= gengou(@start_date) %></gen:era>
@@ -40,7 +40,7 @@
40
40
  <RPT_KBN id="RPT_KBN">100</RPT_KBN>
41
41
  <TAX_NAME id="TAX_NAME">法人都道府県民税・事業税・特別法人事業税又は地方法人特別税</TAX_NAME>
42
42
  <RPT_NAME id="RPT_NAME">確定</RPT_NAME>
43
- <MAKE_KBN id="MAKE_KBN">1</MAKE_KBN>
43
+ <MAKE_KBN id="MAKE_KBN">1</MAKE_KBN><%# 新規 %>
44
44
  <REV_RCPT_NUM id="REV_RCPT_NUM"></REV_RCPT_NUM>
45
45
  </PROC_INF>
46
46
  <%= @user_inf %>
@@ -78,11 +78,11 @@
78
78
  <HOJO_NUM id="HOJO_NUM" />
79
79
  <STF_NUM id="STF_NUM" />
80
80
  </ORG_INF>
81
- <STIME id="STIME"><%= @app_version %></STIME>
81
+ <STIME id="STIME"><%# @app_version %></STIME>
82
82
  <HOJIN_DOFUKEN id="HOJIN_DOFUKEN">
83
83
  <FORM_INF id="FORM_INF">
84
84
  <JIGYO_NAME id="JIGYO_NAME"><%= it_part_config('jigyo_naiyo') %></JIGYO_NAME>
85
- <SHIHON id="SHIHON"><%= it_part_config('shihon_kin') %></SHIHON>
85
+ <SHIHON id="SHIHON"><%= 期末資本金 %></SHIHON>
86
86
  <HOJIN_NUM id="HOJIN_NUM"></HOJIN_NUM>
87
87
  <JIMUSHO_NUM id="JIMUSHO_NUM"><%= @jimusho_code %></JIMUSHO_NUM>
88
88
  <SEIRI_NUM id="SEIRI_NUM" />
@@ -93,7 +93,7 @@
93
93
  <TAX_DATA id="TAX_DATA">
94
94
  <%= @form_data %>
95
95
  <TENPU_INF>
96
- <YUSO_KBN>0</YUSO_KBN>
96
+ <YUSO_KBN>0</YUSO_KBN><%# 郵送添付書類なし %>
97
97
  </TENPU_INF>
98
98
  </TAX_DATA>
99
99
  </KOUSEI_KANRI_INF>
@@ -108,9 +108,9 @@
108
108
  <UDATE></UDATE>
109
109
  <SIGN_DATE></SIGN_DATE>
110
110
  <SEND_DATE></SEND_DATE>
111
- <RPT_INF>10</RPT_INF>
112
- <CREATE_SYS>1</CREATE_SYS>
113
- <INP_KBN>1</INP_KBN>
111
+ <RPT_INF>10</RPT_INF><%# 未入力 %>
112
+ <CREATE_SYS>1</CREATE_SYS><%# PCDesk作成 %>
113
+ <INP_KBN>1</INP_KBN><%# 通常入力モード %>
114
114
  <USER_FILE_NM></USER_FILE_NM>
115
115
  </NOUZEI_UPDATE>
116
116
  </SYSTEM_INF>
@@ -1,4 +1,4 @@
1
- <HOK010 page="1" VR="5.0" id="HOK010" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
1
+ <HOK010 page="1" VR="<%= @form_vers['HOK010'] %>" id="HOK010" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
2
2
  <HOK010-1 page="1">
3
3
  <IAA00000>
4
4
  <IAA01000>
@@ -13,7 +13,7 @@
13
13
  <IAA02400><kubun_CD><%= gaikyo_config('homepage') ? 1 : 2 %></kubun_CD></IAA02400>
14
14
  <%= render_attr('IAA02500', gaikyo_config('homepage')) %>
15
15
  </IAA00000>
16
- <%= render_attr('IAS00000', it_part_config('jigyo_naiyo')) %>
16
+ <%= render_attr('IAB00000', it_part_config('jigyo_naiyo')) %>
17
17
  <IAC00000>
18
18
  <IAC01000>
19
19
  <%= render_attr('IAC01100', gaikyo_config('shiten_kokunai')) %>
@@ -23,21 +23,65 @@
23
23
  <%= render_attr('IAC02050', gaikyo_config('kogaisha_kokunai')) %>
24
24
  <%= render_attr('IAC02100', gaikyo_config('kogaisha_kaigai')) %>
25
25
  </IAC02000>
26
+ <IAC03000>
27
+ <%= render_attr('IAC03100', gaikyo_config('yunyu') ? '<kubun_CD>1</kubun_CD>' : nil) %>
28
+ <%= render_attr('IAC03200', gaikyo_config('yushutsu') ? '<kubun_CD>1</kubun_CD>' : nil) %>
29
+ <%= render_attr('IAC03300', (!gaikyo_config('yunyu') && !gaikyo_config('yushutsu')) ? '<kubun_CD>1</kubun_CD>' : nil) %>
30
+ </IAC03000>
31
+ <IAC04000>
32
+ <% if gaikyo_config('kaigai_torihiki') %>
33
+ <%= render_attr('IAC04100', '<kubun_CD>1</kubun_CD>') %>
34
+ <% elsif gaikyo_config('kaigai_torihiki') == false %>
35
+ <%= render_attr('IAC04100', '<kubun_CD>2</kubun_CD>') %>
36
+ <% end %>
37
+ </IAC04000>
26
38
  </IAC00000>
27
39
  <IAD00000>
28
40
  <IAD01000>
29
41
  <%= render_attr('IAD01100', gaikyo_config('yakuin')) %>
30
42
  </IAD01000>
43
+ <% if gaikyo_config('chingin_kotei') && gaikyo_config('chingin_buai') %>
44
+ <%= render_attr('IAD02000', '<kubun_CD>3</kubun_CD>') %>
45
+ <% elsif gaikyo_config('chingin_kotei') %>
46
+ <%= render_attr('IAD02000', '<kubun_CD>1</kubun_CD>') %>
47
+ <% elsif gaikyo_config('chingin_buai') %>
48
+ <%= render_attr('IAD02000', '<kubun_CD>2</kubun_CD>') %>
49
+ <% end %>
50
+ <% if gaikyo_config('shataku') %>
51
+ <%= render_attr('IAD03000', '<kubun_CD>1</kubun_CD>') %>
52
+ <% elsif gaikyo_config('shataku') == false %>
53
+ <%= render_attr('IAD03000', '<kubun_CD>2</kubun_CD>') %>
54
+ <% end %>
31
55
  </IAD00000>
32
56
  <IAE00000>
33
57
  <%= render_attr('IAE01000', gaikyo_config('software_kaikei') ? '<kubun_CD>1</kubun_CD>' : nil) %>
58
+ <IAE02100>
59
+ <%= render_attr('IAE02200', gaikyo_config('windows') ? '<kubun_CD>1</kubun_CD>' : nil) %>
60
+ <%= render_attr('IAE02300', gaikyo_config('mac') ? '<kubun_CD>1</kubun_CD>' : nil) %>
61
+ <%= render_attr('IAE02400', gaikyo_config('linux') ? '<kubun_CD>1</kubun_CD>' : nil) %>
62
+ </IAE02100>
34
63
  <IAE03000>
64
+ <%= render_attr('IAE03100', gaikyo_config('pc_kyuuyo') ? '<kubun_CD>1</kubun_CD>' : nil) %>
65
+ <%= render_attr('IAE03300', gaikyo_config('pc_hanbai') ? '<kubun_CD>1</kubun_CD>' : nil) %>
66
+ <%= render_attr('IAE03400', gaikyo_config('pc_seisan') ? '<kubun_CD>1</kubun_CD>' : nil) %>
35
67
  <%= render_attr('IAE03600', gaikyo_config('software_kaikei') ? '<kubun_CD>1</kubun_CD>' : nil) %>
36
68
  </IAE03000>
37
69
  <%= render_attr('IAE04300', gaikyo_config('software_kaikei') ? '<kubun_CD>1</kubun_CD>' : nil) %>
38
70
  <%= render_attr('IAE04500', gaikyo_config('software_kaikei')) %>
39
71
  <%= render_attr('IAE04600', gaikyo_config('software_mail')) %>
72
+ <IAE07000>
73
+ <%= render_attr('IAE07700', gaikyo_config('data_cloud') ? '<kubun_CD>1</kubun_CD>' : nil) %>
74
+ <%= render_attr('IAE07800', gaikyo_config('data_media') ? '<kubun_CD>1</kubun_CD>' : nil) %>
75
+ <%= render_attr('IAE07900', gaikyo_config('data_server') ? '<kubun_CD>1</kubun_CD>' : nil) %>
76
+ </IAE07000>
40
77
  </IAE00000>
78
+ <IAT00000>
79
+ <IAT01000>
80
+ <%= render_attr('IAT01100', gaikyo_config('ec_uriage') ? '<kubun_CD>1</kubun_CD>' : nil) %>
81
+ <%= render_attr('IAT01200', gaikyo_config('ec_shiire') ? '<kubun_CD>1</kubun_CD>' : nil) %>
82
+ <%= render_attr('IAT01300', gaikyo_config('ec_keihi') ? '<kubun_CD>1</kubun_CD>' : nil) %>
83
+ </IAT01000>
84
+ </IAT00000>
41
85
  <IAF00000>
42
86
  <IAF01000>
43
87
  <IAF01100>
@@ -47,12 +91,44 @@
47
91
  <%= render_attr('IAF01210', gaikyo_config('tsucho_kanrisha')) %>
48
92
  </IAF01200>
49
93
  </IAF01000>
94
+ <IAF02000>
95
+ <% if gaikyo_config('shisanhyou') == 1 %>
96
+ <%= render_attr('IAF02100', '<kubun_CD>1</kubun_CD>') %>
97
+ <%= render_attr('IAF02200', '<kubun_CD>2</kubun_CD>') %>
98
+ <%= render_attr('IAF02300', '<kubun_CD>2</kubun_CD>') %>
99
+ <% elsif gaikyo_config('shisanhyou') == 12 %>
100
+ <%= render_attr('IAF02100', '<kubun_CD>2</kubun_CD>') %>
101
+ <%= render_attr('IAF02200', '<kubun_CD>2</kubun_CD>') %>
102
+ <%= render_attr('IAF02300', '<kubun_CD>1</kubun_CD>') %>
103
+ <% elsif gaikyo_config('shisanhyou') < 12 %>
104
+ <%= render_attr('IAF02100', '<kubun_CD>2</kubun_CD>') %>
105
+ <%= render_attr('IAF02200', '<kubun_CD>1</kubun_CD>') %>
106
+ <%= render_attr('IAF02250', gaikyo_config('shisanhyou')) %>
107
+ <%= render_attr('IAF02300', '<kubun_CD>2</kubun_CD>') %>
108
+ <% end %>
109
+ </IAF02000>
50
110
  <IAF03000>
51
111
  <%= 概況源泉徴収種類 %>
112
+ <%= render_attr('IAF03300', gaikyo_config('gensen_rishi') ? '<kubun_CD>1</kubun_CD>' : nil) %>
113
+ <%= render_attr('IAF03400', gaikyo_config('gensen_haitou') ? '<kubun_CD>1</kubun_CD>' : nil) %>
114
+ <%= render_attr('IAF03500', gaikyo_config('gensen_hikyoju') ? '<kubun_CD>1</kubun_CD>' : nil) %>
115
+ <%= render_attr('IAF03600', gaikyo_config('gensen_taishoku') ? '<kubun_CD>1</kubun_CD>' : nil) %>
52
116
  </IAF03000>
53
117
  <IAF04000>
54
118
  <%= render_attr('IAF04200', 消費税課税売上高) %>
119
+ <% if gaikyo_config('keiri_zeinuki') %>
120
+ <%= render_attr('IAF04300', '<kubun_CD>1</kubun_CD>') %>
121
+ <% elsif gaikyo_config('keiri_zeikomi') %>
122
+ <%= render_attr('IAF04300', '<kubun_CD>2</kubun_CD>') %>
123
+ <% end %>
55
124
  </IAF04000>
125
+ <IAF04400>
126
+ <% if gaikyo_config('kansa') %>
127
+ <%= render_attr('IAF04500', '<kubun_CD>1</kubun_CD>') %>
128
+ <% elsif gaikyo_config('kansa') == false %>
129
+ <%= render_attr('IAF04500', '<kubun_CD>2</kubun_CD>') %>
130
+ <% end %>
131
+ </IAF04400>
56
132
  </IAF00000>
57
133
  <IAI00000>
58
134
  <%= render_attr('IAI01100', @概況売上) %>
@@ -1,21 +1,27 @@
1
1
  <HOI060 page="1" VR="4.0" id="HOI060" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
2
- <% @有価証券.values.each do |scurity| %>
2
+ <% @有価証券.values.each do |security| %>
3
3
  <HFB00000>
4
4
  <HFB00110>
5
- <%= render_attr('HFB00120', scurity[:security_purpose]) %>
6
- <%= render_attr('HFB00130', scurity[:security_genre]) %>
7
- <%= render_attr('HFB00140', scurity[:name]) %>
5
+ <%= render_attr('HFB00120', security[:security_purpose]) %>
6
+ <%= render_attr('HFB00130', security[:security_genre]) %>
7
+ <%= render_attr('HFB00140', security[:name]) %>
8
8
  </HFB00110>
9
9
  <HFB00200>
10
- <%= render_attr('HFB00210', scurity[:security_units]) %>
10
+ <%= render_attr('HFB00210', security[:security_units]) %>
11
11
  <HFB00215>
12
- <%= render_attr('HFB00230', scurity[:amount]) %>
12
+ <%= render_attr('HFB00230', security[:amount]) %>
13
13
  </HFB00215>
14
14
  </HFB00200>
15
- <%= render_attr('HFB00400', scurity[:note]) %>
15
+ <% unless security[:diff].nil? || security[:diff].zero? %>
16
+ <HFB00300>
17
+ <%= render_attr('HFB00340', security[:diff]) %>
18
+ </HFB00300>
19
+ <% end %>
20
+ <%= render_attr('HFB00400', security[:note]) %>
16
21
  </HFB00000>
17
22
  <% end %>
18
23
  <HFC00000>
19
24
  <%= render_attr('HFC00100', 有価証券合計) %>
25
+ <%= render_attr('HFC00200', @有価証券.values.map { |s| s[:diff] }.compact.sum) %>
20
26
  </HFC00000>
21
27
  </HOI060>
@@ -1,4 +1,4 @@
1
- <SHA020 page="1" VR="7.0" id="SHA020" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
1
+ <SHA020 page="1" VR="<%= @form_vers['SHA020'] %>" id="SHA020" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
2
2
  <SHA020-1 page="1">
3
3
  <ABH00000>
4
4
  <ABH00010 IDREF="TEISYUTSU_DAY"/>
@@ -41,18 +41,23 @@ module Luca #:nodoc:
41
41
 
42
42
  @有価証券 = @bs_data.each.with_object({}) do |(k, v), h|
43
43
  next unless account_codes.include?(k.to_s)
44
- next unless readable(v || 0) > 0
44
+ next if v.nil? || v <= 0
45
45
 
46
+ inc = debit_amount(k, @start_date.year, @start_date.month, @end_date.year, @end_date.month) || 0
47
+ dec = credit_amount(k, @start_date.year, @start_date.month, @end_date.year, @end_date.month) || 0
46
48
  h[k] = {
47
49
  name: self.class.dict.dig(k)[:label],
48
- amount: readable(v)
50
+ amount: readable(v),
51
+ diff: readable(inc - dec)
49
52
  }
53
+ STDERR.puts "勘定科目内訳書(有価証券)異動の追記が必要: #{h[k][:name]}" unless (inc - dec).zero?
54
+
50
55
  metadata = uchiwake_account_config(k).first
51
56
  if metadata && metadata['name']
52
57
  h[k][:name] = metadata['name'][0..9] if metadata['name']
53
58
  h[k][:security_purpose] = metadata['security_purpose']
54
59
  h[k][:security_genre] = metadata['security_genre']
55
- h[k][:security_units] = metadata['security_units']
60
+ h[k][:security_units] = (h[:amount].nil? || h[:amount].zero?) ? 0 : metadata['security_units']
56
61
  h[k][:note] = metadata['note']
57
62
  end
58
63
  h[k][:security_purpose] ||= 'その他' if /^332/.match(k.to_s)
data/lib/luca/jp/util.rb CHANGED
@@ -89,6 +89,19 @@ module Luca
89
89
  def eltax_config(key)
90
90
  config.dig('jp', 'eltax', key)
91
91
  end
92
+
93
+ def 期首期末残高(code)
94
+ pre = readable(@start_balance.dig(code))
95
+ post = readable(@bs_data.dig(code))
96
+ [readable(pre), readable(post)]
97
+ end
98
+
99
+ def 純資産期中増減(code)
100
+ inc = credit_amount(code, @start_date.year, @start_date.month, @end_date.year, @end_date.month)
101
+ dec = debit_amount(code, @start_date.year, @start_date.month, @end_date.year, @end_date.month)
102
+
103
+ [readable(dec), readable(inc)]
104
+ end
92
105
  end
93
106
  end
94
107
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Luca
4
4
  module Jp
5
- VERSION = '0.2.4'
5
+ VERSION = '0.7.0'
6
6
  end
7
7
  end
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.2.4
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chuma Takahiro
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-09 00:00:00.000000000 Z
11
+ date: 2022-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lucabook
@@ -68,7 +68,7 @@ dependencies:
68
68
  version: 12.3.3
69
69
  description: 'JP tax extension for Luca
70
70
 
71
- '
71
+ '
72
72
  email:
73
73
  - co.chuma@gmail.com
74
74
  executables:
@@ -124,7 +124,7 @@ licenses:
124
124
  metadata:
125
125
  homepage_uri: https://github.com/chumaltd/luca-jp/tree/main
126
126
  source_code_uri: https://github.com/chumaltd/luca-jp/tree/main
127
- post_install_message:
127
+ post_install_message:
128
128
  rdoc_options: []
129
129
  require_paths:
130
130
  - lib
@@ -139,8 +139,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
141
  requirements: []
142
- rubygems_version: 3.2.3
143
- signing_key:
142
+ rubygems_version: 3.2.5
143
+ signing_key:
144
144
  specification_version: 4
145
145
  summary: JP tax extension for Luca
146
146
  test_files: []