Class: Luca::Jp::Chihouzei
- Inherits:
-
LucaBook::State
- Object
- LucaBook::State
- Luca::Jp::Chihouzei
show all
- Includes:
- Common, Util, LucaSupport::View
- Defined in:
- lib/luca/jp/chihouzei.rb
Instance Method Summary
collapse
Methods included from Util
beppyo2_config, config, eltax_config, etax_date, form_rdf, gaikyo_config, gengou, it_part_config, prepaid_tax, refund_tax, render_attr, tokyo23?, uchiwake_account_config, wareki, 中間還付税額, 期首期末残高, 納付税額, 純資産期中増減
Methods included from Common
一般区分の税額, 中小企業の軽減税率対象を超える所得, 中小企業の軽減税率対象所得, 中小企業の軽減税額, 中間還付税額, 地方法人特別税, 地方法人税額, 地方消費税中間納付額, 地方税資本金等の額, 均等割, 当期所得金額, 当期控除計, 当期繰越損失, 所得400万以下, 所得800万以下, 所得800万超, 所得割400万以下, 所得割800万以下, 所得割800万超, 所得割税率400万以下, 所得割税率800万以下, 所得割税率800万超, 所得金額, 期末資本金, 期首繰越損失, 未納事業税期中増減, 法人税割, 法人税割税率, 消費税中間納付額, 消費税課税売上高, 税額計算, 納付税額, 翌期繰越損失, 資本金等の額, 軽減税率不適用法人, 還付事業税
Instance Method Details
#export_json(report_cfg) ⇒ Object
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
# File 'lib/luca/jp/chihouzei.rb', line 94
def export_json(report_cfg)
records = kani(report_cfg, export: true)
{}.tap do |item|
item['date'] = @end_date
item['debit'] = []
item['credit'] = []
records[:jigyouzei].each do |k, dat|
if dat[:chukan] > 0
item['credit'] << { 'label' => karibarai_label(k), 'amount' => dat[:chukan] }
end
if dat[:chukan] > dat[:zeigaku]
item['debit'] << { 'label' => '未収地方事業税', 'amount' => dat[:chukan] - dat[:zeigaku] }
else
item['credit'] << { 'label' => '未払地方事業税', 'amount' => dat[:zeigaku] - dat[:chukan] }
end
item['debit'] << { 'label' => '法人税、住民税及び事業税', 'amount' => dat[:zeigaku] } if dat[:zeigaku] > 0
end
records[:juminzei].each do |k, dat|
if dat[:chukan] > 0
item['credit'] << { 'label' => karibarai_label(k), 'amount' => dat[:chukan] }
end
if dat[:chukan] > dat[:zeigaku]
item['debit'] << { 'label' => '未収都道府県住民税', 'amount' => dat[:chukan] - dat[:zeigaku] }
else
item['credit'] << { 'label' => '未払都道府県民税', 'amount' => dat[:zeigaku] - dat[:chukan] }
end
item['debit'] << { 'label' => '法人税、住民税及び事業税', 'amount' => dat[:zeigaku] } if dat[:zeigaku] > 0
end
item['x-editor'] = 'LucaJp'
end
end
|
#kani(report_cfg, export: false) ⇒ Object
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
# File 'lib/luca/jp/chihouzei.rb', line 21
def kani(report_cfg, export: false)
set_pl(4)
set_bs(4)
@issue_date = Date.today
@software = 'LucaJp'
@report_category = report_cfg['type']
@employee = report_cfg['employee'] || 1
@税額 = 税額計算
@均等割 = @税額.dig(:kenmin, :kintou)
@確定法人税割 = @税額.dig(:kenmin, :houjinzei)
@地方特別法人事業税中間納付 = prepaid_tax('1854')
@所得割中間納付 = prepaid_tax('1855')
@法人税割中間納付 = prepaid_tax('1859')
@均等割中間納付 = prepaid_tax('185A')
@所得割 = @税額.dig(:kenmin, :shotoku)
if export
{
jigyouzei: {
shotoku: {
zeigaku: @所得割,
chukan: @所得割中間納付
},
tokubetsu: {
zeigaku: @税額.dig(:kenmin, :tokubetsu),
chukan: @地方特別法人事業税中間納付
},
},
juminzei: {
kinto: {
zeigaku: @均等割,
chukan: @均等割中間納付
},
houjinzei: {
zeigaku: @確定法人税割,
chukan: @法人税割中間納付
}
}
}
else
@company = CGI.escapeHTML(config.dig('company', 'name'))
@form_vers = proc_version
@jichitai_code = report_cfg['jichitai_code']
@jimusho_code = report_cfg['jimusho_code']
@jimusho_name = report_cfg['jimusho_name']
@kanri_bango = report_cfg['x_houjin_bango']
@app_version = report_cfg['app_version']
@address = report_cfg['address'] || it_part_config('nozeisha_adr')
@procedure_code = 'R0102100'
@procedure_name = '法人都道府県民税・事業税・特別法人事業税又は地方法人特別税 確定申告'
@form_sec = case @report_category
when 'prefecture'
["R0102AA#{@form_vers['R0102AA']}", 別表九フォーム]
.compact.map{ |c| form_attr(c) }.join('')
when '23ku'
["R0102AA#{@form_vers['R0102AA']}", "R0102AG120", 別表九フォーム]
.compact.map{ |c| form_attr(c) }.join('')
when 'city'
end
@user_inf = render_erb(search_template('eltax-userinf.xml.erb'))
@form_data = case @report_category
when 'prefecture'
[第六号, 別表九].compact.join("\n")
when '23ku'
[第六号, 別表四三, 別表九].compact.join("\n")
when 'city'
end
render_erb(search_template('eltax.xml.erb'))
end
end
|
#別表九 ⇒ Object
143
144
145
146
147
|
# File 'lib/luca/jp/chihouzei.rb', line 143
def 別表九
return nil if @繰越損失管理.records.length == 0
render_erb(search_template('el-no6-9.xml.erb'))
end
|
#別表九フォーム ⇒ Object
137
138
139
140
141
|
# File 'lib/luca/jp/chihouzei.rb', line 137
def 別表九フォーム
return nil if @繰越損失管理.records.length == 0
"R0102AM#{@form_vers['R0102AM']}"
end
|
#別表四三 ⇒ Object
132
133
134
135
|
# File 'lib/luca/jp/chihouzei.rb', line 132
def 別表四三
@office_23ku = config.dig('jp', 'eltax', 'office_23ku')
render_erb(search_template('el-no6-43.xml.erb'))
end
|
#第六号 ⇒ Object
126
127
128
129
130
|
# File 'lib/luca/jp/chihouzei.rb', line 126
def 第六号
@資本金準備金 = readable(['911', '9131'].map { |cd| @bs_data.dig(cd) }.compact.sum)
STDERR.puts "第六号様式: 「決算確定の日」「国外関連者」などの追記が必要"
render_erb(search_template('el-no6.xml.erb'))
end
|