luca-jp 0.1.2 → 0.1.3
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 +7 -0
- data/lib/luca/jp/aoiro.rb +1 -1
- data/lib/luca/jp/chihouzei.rb +3 -3
- data/lib/luca/jp/common.rb +2 -2
- data/lib/luca/jp/it_part.rb +4 -1
- data/lib/luca/jp/syouhizei.rb +3 -3
- data/lib/luca/jp/templates/fuhyo53.xml.erb +1 -1
- data/lib/luca/jp/util.rb +4 -0
- data/lib/luca/jp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6d54c44deab442663640f9b11e8abd3e71cf6c9deb5b9e00afd5c059104246d
|
4
|
+
data.tar.gz: 052d3583d83f6a7ea82df1bc53a75bbfa4b72373d549572eeae3266ccdaf7057
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81f56987c7f87af6ae87ac2536118ab9ef58a62b61c133ad8b0b6e3b81704034fbfea485c5fb07382d42791b34c2817224f5354eb7c9076f1e163034bf9a2c9a
|
7
|
+
data.tar.gz: b2c2edd9429190aaa6617bb4ef316d888be4fb1d85a576d6a5ef09f658c8f8f01c56da656c5c5fc5c2977d4adb67a64f4b4038b8a4e20ef153b9de3b90da1e0c
|
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
|
@@ -12,4 +13,10 @@ module Luca
|
|
12
13
|
autoload :ItPart, 'luca/jp/it_part'
|
13
14
|
autoload :Util, 'luca/jp/util'
|
14
15
|
end
|
16
|
+
|
17
|
+
EX_CONF = begin
|
18
|
+
YAML.load_file(Pathname(LucaSupport::PJDIR) / 'config-lucajp.yml')
|
19
|
+
rescue Errno::ENOENT
|
20
|
+
nil
|
21
|
+
end
|
15
22
|
end
|
data/lib/luca/jp/aoiro.rb
CHANGED
@@ -24,7 +24,7 @@ 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
|
@確定法人税額 = @税額.dig(:houjin, :kokuzei)
|
data/lib/luca/jp/chihouzei.rb
CHANGED
@@ -22,9 +22,9 @@ 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 =
|
27
|
+
@jimusho_code = config.dig('jp', 'eltax', 'jimusho_code')
|
28
28
|
@jimusho_name = '都税事務所長'
|
29
29
|
|
30
30
|
@税額 = 税額計算
|
@@ -109,7 +109,7 @@ 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
|
|
data/lib/luca/jp/common.rb
CHANGED
@@ -75,7 +75,7 @@ module Luca
|
|
75
75
|
# -----------------------------------------------------
|
76
76
|
|
77
77
|
def 均等割
|
78
|
-
if
|
78
|
+
if config.dig('jp', 'eltax', 'office_23ku')
|
79
79
|
[70_000, 0]
|
80
80
|
else
|
81
81
|
[20_000, 50_000]
|
@@ -88,7 +88,7 @@ module Luca
|
|
88
88
|
else
|
89
89
|
@法人税割課税標準
|
90
90
|
end
|
91
|
-
if
|
91
|
+
if config.dig('jp', 'eltax', 'office_23ku')
|
92
92
|
[(課税標準 * 7 / 100).floor, 0]
|
93
93
|
else
|
94
94
|
[(課税標準 * 1 / 100).floor, (課税標準 * 6 / 100).floor]
|
data/lib/luca/jp/it_part.rb
CHANGED
@@ -6,6 +6,8 @@ require 'luca_support/config'
|
|
6
6
|
module Luca
|
7
7
|
module Jp
|
8
8
|
module ItPart
|
9
|
+
# タグの出現順序は順不同ではない。eTaxの定義に準拠
|
10
|
+
#
|
9
11
|
def it_part
|
10
12
|
entries = ['<IT VR="1.4" id="IT">']
|
11
13
|
entries.concat(['zeimusho']
|
@@ -23,12 +25,13 @@ module Luca
|
|
23
25
|
entries.concat([jigyo_nendo_from, jigyo_nendo_to, kazei_kikan_from, kazei_kikan_to])
|
24
26
|
entries << render_it_tag('keiri_sekininsha')
|
25
27
|
entries << '<SHINKOKU_KBN ID="SHINKOKU_KBN"><kubun_CD>1</kubun_CD></SHINKOKU_KBN>'
|
28
|
+
entries.concat(['eltax_id'].map{ |key| render_it_tag(key) })
|
26
29
|
entries << '</IT>'
|
27
30
|
entries.compact.join("\n")
|
28
31
|
end
|
29
32
|
|
30
33
|
def render_it_tag(key)
|
31
|
-
content =
|
34
|
+
content = config.dig('jp', 'it_part', key)
|
32
35
|
return nil if content.nil?
|
33
36
|
|
34
37
|
case key
|
data/lib/luca/jp/syouhizei.rb
CHANGED
@@ -23,14 +23,14 @@ module Luca
|
|
23
23
|
set_pl(4)
|
24
24
|
set_bs(4)
|
25
25
|
@issue_date = Date.today
|
26
|
-
@company = CGI.escapeHTML(
|
26
|
+
@company = CGI.escapeHTML(config.dig('company', 'name'))
|
27
27
|
@software = 'LucaJp'
|
28
28
|
税率 = BigDecimal('7.8') # percent
|
29
29
|
地方税率 = BigDecimal('2.2')
|
30
30
|
|
31
31
|
@sales = @pl_data.dig('A0') * 100 / (100 + 税率 + 地方税率).floor
|
32
32
|
@tax_amount = (課税標準額(@sales) * 税率 / 100).floor
|
33
|
-
@みなし仕入税額 = (@tax_amount * みなし仕入率(
|
33
|
+
@みなし仕入税額 = (@tax_amount * みなし仕入率(config.dig('jp', 'syouhizei_kubun')) / 100).floor
|
34
34
|
@税額 = LucaSupport::Code.readable(((@tax_amount - @みなし仕入税額) / 100).floor * 100)
|
35
35
|
@譲渡割額 = (@税額 * 地方税率 / (税率*100)).floor * 100
|
36
36
|
@中間納付額 = prepaid_tax('185B')
|
@@ -119,7 +119,7 @@ module Luca
|
|
119
119
|
end
|
120
120
|
|
121
121
|
def 事業区分
|
122
|
-
tags = case
|
122
|
+
tags = case config.dig('jp', 'syouhizei_kubun')
|
123
123
|
when 1
|
124
124
|
['ABL00030', 'ABL00040', 'ABL00050']
|
125
125
|
when 2
|
@@ -16,7 +16,7 @@
|
|
16
16
|
</DVB00130>
|
17
17
|
</DVB00000>
|
18
18
|
<DVC00000>
|
19
|
-
<DVC00010><kubun_CD><%=
|
19
|
+
<DVC00010><kubun_CD><%= config.dig('jp', 'syouhizei_kubun') %></kubun_CD>
|
20
20
|
</DVC00010>
|
21
21
|
<%= render_attr('DVC00030', @みなし仕入税額) %>
|
22
22
|
<%= render_attr('DVC00040', @みなし仕入税額) %>
|
data/lib/luca/jp/util.rb
CHANGED
@@ -52,6 +52,10 @@ module Luca
|
|
52
52
|
def etax_date(date)
|
53
53
|
"<gen:era>#{gengou(date)}</gen:era><gen:yy>#{wareki(date)}</gen:yy><gen:mm>#{date.month}</gen:mm><gen:dd>#{date.day}</gen:dd>"
|
54
54
|
end
|
55
|
+
|
56
|
+
def config
|
57
|
+
EX_CONF.nil? ? LucaSupport::CONFIG : LucaSupport::CONFIG.merge(EX_CONF)
|
58
|
+
end
|
55
59
|
end
|
56
60
|
end
|
57
61
|
end
|
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.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chuma Takahiro
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lucabook
|