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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c49087082344b219aa575860edc352d9aeaa9f6ec330198ca6564144625b1b5
4
- data.tar.gz: '058ea66e0a93be29b3fdcdb6639b28589de79b40159e49c59f4dab1ea36563f7'
3
+ metadata.gz: b6d54c44deab442663640f9b11e8abd3e71cf6c9deb5b9e00afd5c059104246d
4
+ data.tar.gz: 052d3583d83f6a7ea82df1bc53a75bbfa4b72373d549572eeae3266ccdaf7057
5
5
  SHA512:
6
- metadata.gz: 021d11b98374b99a0cdcc34f305a4858d615190b9911e37c4b33c80106c973997f2614d3d2e5ab0eb7a78b8bab21494bf99a4f3d009a65718ebe210a2a617679
7
- data.tar.gz: 65477750f24b8e4c2f5d9a4cbe0268686e58999620d3beb1bd2ff2be5375dd1771923d1ee58e5bbf86b7f4d9779a7a482757c37aeb861e438072e2ff3f71ec41
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(LucaSupport::CONFIG.dig('company', 'name'))
27
+ @company = CGI.escapeHTML(config.dig('company', 'name'))
28
28
  @software = 'LucaJp'
29
29
  @税額 = 税額計算
30
30
  @確定法人税額 = @税額.dig(:houjin, :kokuzei)
@@ -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(LucaSupport::CONFIG.dig('company', 'name'))
25
+ @company = CGI.escapeHTML(config.dig('company', 'name'))
26
26
  @software = 'LucaJp'
27
- @jimusho_code = LucaSupport::CONFIG.dig('jp', 'eltax', '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 = LucaSupport::CONFIG.dig('jp', 'eltax', '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
 
@@ -75,7 +75,7 @@ module Luca
75
75
  # -----------------------------------------------------
76
76
 
77
77
  def 均等割
78
- if LucaSupport::CONFIG.dig('jp', 'eltax', 'office_23ku')
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 LucaSupport::CONFIG.dig('jp', 'eltax', 'office_23ku')
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]
@@ -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 = LucaSupport::CONFIG.dig('jp', 'it_part', key)
34
+ content = config.dig('jp', 'it_part', key)
32
35
  return nil if content.nil?
33
36
 
34
37
  case key
@@ -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(LucaSupport::CONFIG.dig('company', 'name'))
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 * みなし仕入率(LucaSupport::CONFIG.dig('jp', 'syouhizei_kubun')) / 100).floor
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 LucaSupport::CONFIG.dig('jp', 'syouhizei_kubun')
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><%= LucaSupport::CONFIG.dig('jp', 'syouhizei_kubun') %></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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Luca
4
4
  module Jp
5
- VERSION = '0.1.2'
5
+ VERSION = '0.1.3'
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.1.2
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-14 00:00:00.000000000 Z
11
+ date: 2021-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lucabook