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,37 @@
1
+ <HOI100 page="1" VR="5.0" id="HOI100" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
2
+ <HJB00000>
3
+ <HJB01000>
4
+ <%= render_attr('HJB01100', '預り金') %>
5
+ <HJB01200>
6
+ <%= render_attr('HJB01210', '源泉所得税') %>
7
+ </HJB01200>
8
+ <%= render_attr('HJB01300', @源泉給与 + @源泉報酬) %>
9
+ </HJB01000>
10
+ </HJB00000>
11
+ <HJC00000>
12
+ <% if @源泉給与 > 0 %>
13
+ <HJC01000>
14
+ <HJC01100>
15
+ <HJC01110>
16
+ <gen:era><%= gengou(@end_date) %></gen:era><gen:yy><%= wareki(@end_date) %></gen:yy>
17
+ </HJC01110>
18
+ <%= render_attr('HJC01120', @end_date.month) %>
19
+ </HJC01100>
20
+ <HJC01400><kubun_CD>1</kubun_CD></HJC01400>
21
+ <%= render_attr('HJC01300', @源泉給与) %>
22
+ </HJC01000>
23
+ <% end %>
24
+ <% if @源泉報酬 > 0 %>
25
+ <HJC01000>
26
+ <HJC01100>
27
+ <HJC01110>
28
+ <gen:era><%= gengou(@end_date) %></gen:era><gen:yy><%= wareki(@end_date) %></gen:yy>
29
+ </HJC01110>
30
+ <%= render_attr('HJC01120', @end_date.month) %>
31
+ </HJC01100>
32
+ <HJC01400><kubun_CD>3</kubun_CD></HJC01400>
33
+ <%= render_attr('HJC01300', @源泉報酬) %>
34
+ </HJC01000>
35
+ <% end %>
36
+ </HJC00000>
37
+ </HOI100>
@@ -0,0 +1,95 @@
1
+ <SHA020 page="1" VR="7.0" id="SHA020" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
2
+ <SHA020-1 page="1">
3
+ <ABH00000>
4
+ <ABH00010 IDREF="TEISYUTSU_DAY"/>
5
+ <ABH00020 IDREF="ZEIMUSHO"/>
6
+ <ABH00030 IDREF="NOZEISHA_ADR"/>
7
+ <ABH00040 IDREF="NOZEISHA_TEL"/>
8
+ <ABH00050>
9
+ <ABH00060 IDREF="NOZEISHA_NM_KN"/>
10
+ <ABH00070 IDREF="NOZEISHA_NM"/>
11
+ </ABH00050>
12
+ <ABH00080 IDREF="NOZEISHA_BANGO"/>
13
+ <ABH00090>
14
+ <ABH00100 IDREF="DAIHYO_NM_KN"/>
15
+ <ABH00110 IDREF="DAIHYO_NM"/>
16
+ </ABH00090>
17
+ <ABH00120>
18
+ <ABH00130 IDREF="KAZEI_KIKAN_FROM"/>
19
+ <ABH00140 IDREF="KAZEI_KIKAN_TO"/>
20
+ </ABH00120>
21
+ <ABH00150 IDREF="SHINKOKU_KBN"/>
22
+ <ABH00190 IDREF="KANPU_KINYUKIKAN"/>
23
+ <ABH00230><kubun_CD>2</kubun_CD></ABH00230><%# 税理士なし %>
24
+ <ABH00240><kubun_CD>2</kubun_CD></ABH00240><%# 税理士なし %>
25
+ </ABH00000>
26
+ <ABI00000>
27
+ <%= render_attr('ABI00010', 課税標準額(@sales)) %>
28
+ <%= render_attr('ABI00020', @tax_amount) %>
29
+ <ABI00040>
30
+ <%= render_attr('ABI00050', @みなし仕入税額) %>
31
+ <%= render_attr('ABI00080', @みなし仕入税額) %>
32
+ </ABI00040>
33
+ <%= render_attr('ABI00100', @税額) %>
34
+ <%= render_attr('ABI00110', @中間納付額) %>
35
+ <%= render_attr('ABI00120', 納付税額(@税額, @中間納付額)) %>
36
+ <%= render_attr('ABI00130', 中間還付税額(@税額, @中間納付額)) %>
37
+ <%= render_attr('ABI00170', LucaSupport::Code.readable(@sales)) %>
38
+ </ABI00000>
39
+ <ABJ00000>
40
+ <ABJ00010>
41
+ <%= render_attr('ABJ00030', @税額) %>
42
+ </ABJ00010>
43
+ <ABJ00040>
44
+ <%= render_attr('ABJ00060', @譲渡割額) %>
45
+ </ABJ00040>
46
+ <%= render_attr('ABJ00070', @地方税中間納付額) %>
47
+ <%= render_attr('ABJ00080', 納付税額(@譲渡割額, @地方税中間納付額)) %>
48
+ <%= render_attr('ABJ00090', 中間還付税額(@譲渡割額, @地方税中間納付額)) %>
49
+ <%= render_attr('ABJ00130', (@税額 - @中間納付額) + (@譲渡割額 - @地方税中間納付額)) %>
50
+ </ABJ00000>
51
+ <ABK00000>
52
+ <ABK00010><kubun_CD>2</kubun_CD></ABK00010>
53
+ <ABK00020><kubun_CD>2</kubun_CD></ABK00020>
54
+ <ABK00030><kubun_CD>2</kubun_CD></ABK00030>
55
+ <ABK00040><kubun_CD>2</kubun_CD></ABK00040>
56
+ </ABK00000>
57
+ <ABL00000>
58
+ <ABL00010><kubun_CD>2</kubun_CD></ABL00010>
59
+ <ABL00020><%= 事業区分 %></ABL00020>
60
+ <ABL00210><kubun_CD>2</kubun_CD></ABL00210>
61
+ </ABL00000>
62
+ </SHA020-1>
63
+ <SHA020-2 page="1">
64
+ <ABM00000>
65
+ <ABM00010 IDREF="NOZEISHA_ADR"/>
66
+ <ABM00020 IDREF="NOZEISHA_TEL"/>
67
+ <ABM00030>
68
+ <ABM00040 IDREF="NOZEISHA_NM_KN"/>
69
+ <ABM00050 IDREF="NOZEISHA_NM"/>
70
+ </ABM00030>
71
+ <ABM00060>
72
+ <ABM00070 IDREF="DAIHYO_NM_KN"/>
73
+ <ABM00080 IDREF="DAIHYO_NM"/>
74
+ </ABM00060>
75
+ <ABM00090>
76
+ <ABM00100 IDREF="KAZEI_KIKAN_FROM"/>
77
+ <ABM00110 IDREF="KAZEI_KIKAN_TO"/>
78
+ </ABM00090>
79
+ <ABM00120 IDREF="SHINKOKU_KBN"/>
80
+ </ABM00000>
81
+ <%= render_attr('ABO00000', 課税標準額(@sales)) %>
82
+ <ABP00000>
83
+ <%= render_attr('ABP00050', LucaSupport::Code.readable(@sales)) %>
84
+ <%= render_attr('ABP00060', LucaSupport::Code.readable(@sales)) %>
85
+ </ABP00000>
86
+ <%= render_attr('ABR00000', @tax_amount) %>
87
+ <ABS00000>
88
+ <%= render_attr('ABS00050', @tax_amount) %>
89
+ </ABS00000>
90
+ <ABV00000>
91
+ <%= render_attr('ABV00010', @税額) %>
92
+ <%= render_attr('ABV00040', @譲渡割額) %>
93
+ </ABV00000>
94
+ </SHA020-2>
95
+ </SHA020>
@@ -0,0 +1,35 @@
1
+ <HOE990 page="1" VR="5.0" id="HOE990" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
2
+ <MAA00000>
3
+ <MAA00010>
4
+ <MAA00020 IDREF="JIGYO_NENDO_FROM"/>
5
+ <MAA00030 IDREF="JIGYO_NENDO_TO"/>
6
+ </MAA00010>
7
+ <MAA00050 IDREF="TEISYUTSU_DAY"/>
8
+ <MAA00060 IDREF="ZEIMUSHO"/>
9
+ <MAA00070 IDREF="NOZEISHA_ADR"/>
10
+ <MAA00080 IDREF="NOZEISHA_TEL"/>
11
+ <MAA00090>
12
+ <MAA00100 IDREF="NOZEISHA_NM_KN"/>
13
+ <MAA00110 IDREF="NOZEISHA_NM"/>
14
+ </MAA00090>
15
+ <MAA00115 IDREF="NOZEISHA_BANGO"/>
16
+ <MAA00120 IDREF="SHIHON_KIN"/>
17
+ <MAA00140>
18
+ <%= render_attr('MAA00150', 1) %>
19
+ <%= render_attr('MAA00160', 1) %>
20
+ </MAA00140>
21
+ <MAA00170 IDREF="JIGYO_NAIYO"/>
22
+ </MAA00000>
23
+ <% if 所得金額 > 0 %>
24
+ <MAB00000>
25
+ <MAB00010>
26
+ <%= render_attr('MAB00020', 42) %>
27
+ <%= render_attr('MAB00030', 'の3の2') %>
28
+ <%= render_attr('MAB00040', 1) %>
29
+ <%= render_attr('MAB00050', 1) %>
30
+ </MAB00010>
31
+ <%= render_attr('MAB00070', '00380') %>
32
+ <%= render_attr('MAB00080', 中小企業の軽減税率対象所得) %>
33
+ </MAB00000>
34
+ <% end %>
35
+ </HOE990>
@@ -0,0 +1,13 @@
1
+ <HOI141 page="1" VR="5.0" id="HOI141" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
2
+ <ILB00000>
3
+ <ILB00010>
4
+ <%= render_attr('ILB00020', @役員報酬) %>
5
+ </ILB00010>
6
+ <ILB00040>
7
+ <%= render_attr('ILB00050', @給料) %>
8
+ </ILB00040>
9
+ <ILB00100>
10
+ <%= render_attr('ILB00110', @役員報酬 + @給料) %>
11
+ </ILB00100>
12
+ </ILB00000>
13
+ </HOI141>
@@ -0,0 +1,13 @@
1
+ <HOI010 page="1" VR="4.0" id="HOI010" sakuseiNM="<%= @company %>" softNM="<%= @software %> <%= @company %>" sakuseiDay="<%= @issue_date %>">
2
+ <% @預金.each do |k, v| %>
3
+ <HAB00000>
4
+ <HAB00100>
5
+ <%= render_attr('HAB00110', k) %>
6
+ </HAB00100>
7
+ <%= render_attr('HAB00400', v) %>
8
+ </HAB00000>
9
+ <% end %>
10
+ <HAC00000>
11
+ <%= render_attr('HAC00100', @預金.values.sum) %>
12
+ </HAC00000>
13
+ </HOI010>
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Luca
4
+ module Jp
5
+ module Util
6
+ module_function
7
+
8
+ def gengou(date)
9
+ if date >= Date.new(2019, 5, 1)
10
+ 5
11
+ else
12
+ 4
13
+ end
14
+ end
15
+
16
+ def wareki(date)
17
+ if date >= Date.new(2019, 5, 1)
18
+ date.year - 2018
19
+ else
20
+ date.year - 1988
21
+ end
22
+ end
23
+
24
+ def prepaid_tax(code)
25
+ #LucaSupport::Code.readable(@bs_data.dig(code) || 0)
26
+ search_end = @end_date.prev_month # exclude year end adjustment
27
+ amount, _ = self.class.net(@start_date.year, @start_date.month, search_end.year, search_end.month, code: code)
28
+ LucaSupport::Code.readable(amount[code] || 0)
29
+ end
30
+
31
+ def refund_tax(code)
32
+ credit = credit_amount(code, @start_date.year, @start_date.month, @end_date.year, @end_date.month)
33
+ LucaSupport::Code.readable(credit)
34
+ end
35
+
36
+ def 納付税額(税額, 中間納付額)
37
+ if 税額 > 中間納付額
38
+ 税額 - 中間納付額
39
+ else
40
+ 0
41
+ end
42
+ end
43
+
44
+ def 中間還付税額(税額, 中間納付額)
45
+ if 税額 < 中間納付額
46
+ 中間納付額 - 税額
47
+ else
48
+ 0
49
+ end
50
+ end
51
+
52
+ def form_rdf(code)
53
+ "<rdf:li><rdf:description about=\"##{code}\"/></rdf:li>"
54
+ end
55
+
56
+ def render_attr(code, val)
57
+ "<#{code}>#{val}</#{code}>"
58
+ end
59
+
60
+ def etax_date(date)
61
+ "<gen:era>#{gengou(date)}</gen:era><gen:yy>#{wareki(date)}</gen:yy><gen:mm>#{date.month}</gen:mm><gen:dd>#{date.day}</gen:dd>"
62
+ end
63
+
64
+ def config
65
+ EX_CONF.nil? ? LucaSupport::CONFIG : LucaSupport::CONFIG.merge(EX_CONF)
66
+ end
67
+ end
68
+ end
69
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Luca
4
4
  module Jp
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.5'
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.0
4
+ version: 0.1.5
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-04 00:00:00.000000000 Z
11
+ date: 2021-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lucabook
@@ -80,8 +80,36 @@ files:
80
80
  - exe/luca-jp
81
81
  - lib/luca.rb
82
82
  - lib/luca/jp.rb
83
+ - lib/luca/jp/aoiro.rb
84
+ - lib/luca/jp/chihouzei.rb
85
+ - lib/luca/jp/common.rb
86
+ - lib/luca/jp/it_part.rb
83
87
  - lib/luca/jp/kessan.rb
88
+ - lib/luca/jp/sonshitsu.rb
84
89
  - lib/luca/jp/syouhizei.rb
90
+ - lib/luca/jp/templates/aoiro.xtx.erb
91
+ - lib/luca/jp/templates/beppyo1-next.xml.erb
92
+ - lib/luca/jp/templates/beppyo1.xml.erb
93
+ - lib/luca/jp/templates/beppyo15.xml.erb
94
+ - lib/luca/jp/templates/beppyo2.xml.erb
95
+ - lib/luca/jp/templates/beppyo4.xml.erb
96
+ - lib/luca/jp/templates/beppyo51.xml.erb
97
+ - lib/luca/jp/templates/beppyo52.xml.erb
98
+ - lib/luca/jp/templates/beppyo7.xml.erb
99
+ - lib/luca/jp/templates/consumption.xtx.erb
100
+ - lib/luca/jp/templates/el-no6-43.xml.erb
101
+ - lib/luca/jp/templates/el-no6-9.xml.erb
102
+ - lib/luca/jp/templates/el-no6.xml.erb
103
+ - lib/luca/jp/templates/eltax.xml.erb
104
+ - lib/luca/jp/templates/fuhyo43.xml.erb
105
+ - lib/luca/jp/templates/fuhyo53.xml.erb
106
+ - lib/luca/jp/templates/gaikyo.xml.erb
107
+ - lib/luca/jp/templates/kariuke-meisai.xml.erb
108
+ - lib/luca/jp/templates/syouhizei-shinkoku-kanni.xml.erb
109
+ - lib/luca/jp/templates/tekiyougaku.xml.erb
110
+ - lib/luca/jp/templates/yakuin-meisai.xml.erb
111
+ - lib/luca/jp/templates/yokin-meisai.xml.erb
112
+ - lib/luca/jp/util.rb
85
113
  - lib/luca/jp/version.rb
86
114
  homepage: https://github.com/chumaltd/luca-jp/tree/main
87
115
  licenses: