tax_jp 0.5.6 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/tax_jp/layout,css.scss +5 -0
- data/app/controllers/tax_jp/consumption_taxes_controller.rb +11 -0
- data/app/views/layouts/tax_jp/_nav.html.erb +22 -6
- data/app/views/layouts/tax_jp/application.html.erb +4 -2
- data/app/views/tax_jp/bonus_withheld_taxes/index.html.erb +4 -4
- data/app/views/tax_jp/common/_date_field.html.erb +1 -1
- data/app/views/tax_jp/consumption_taxes/index.html.erb +32 -0
- data/app/views/tax_jp/depreciation_rates/index.html.erb +1 -1
- data/app/views/tax_jp/employment_insurances/index.html.erb +1 -1
- data/app/views/tax_jp/social_insurances/index.html.erb +4 -4
- data/app/views/tax_jp/withheld_taxes/index.html.erb +5 -5
- data/config/routes.rb +1 -0
- data/data//346/266/210/350/262/273/347/250/216.yml +7 -0
- data/lib/tax_jp/consumption_tax.rb +39 -6
- data/lib/tax_jp/version.rb +1 -1
- data/lib/tax_jp.rb +0 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 438e6fc5fdcdf40d44d653f10139e204861579f3db44ccb26af6dabee62ad42f
|
4
|
+
data.tar.gz: ee7d70c0bb46247548e21b97f86394c13f39b53762a5d09f579200f2c7ed1cca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c791aaab288035b998409f8d07a6db3b4cc96c14438005a329a264d252a147c0a4b19b6301f223233b0d0ff0bb7334a09b097e5d6efb7d3acaac4df5195fb346
|
7
|
+
data.tar.gz: cf83548d64b7ce03d73851de39680720c710a6850d33373345b1bc25869742c805b0f0ca4ce754d61fed6dc7cd8a1148da7d4cef796422a0bc95faeb6b2a3a3a
|
@@ -1,7 +1,23 @@
|
|
1
|
-
<nav class="
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
<nav class="navbar navbar-expand-sm navbar-light bg-light fixed-top">
|
2
|
+
<span class="navbar-brand">TaxJP</span>
|
3
|
+
<ul class="navbar-nav mr-auto">
|
4
|
+
<li class="nav-item <%= 'active' if controller_name == 'withheld_taxes' %>">
|
5
|
+
<%= link_to '源泉徴収税', withheld_taxes_path, class: "nav-link" %>
|
6
|
+
</li>
|
7
|
+
<li class="nav-item <%= 'active' if controller_name == 'bonus_withheld_taxes' %>">
|
8
|
+
<%= link_to '源泉徴収税(賞与)', bonus_withheld_taxes_path, class: "nav-link" %>
|
9
|
+
</li>
|
10
|
+
<li class="nav-item <%= 'active' if controller_name == 'social_insurances' %>">
|
11
|
+
<%= link_to '社会保険料', social_insurances_path, class: "nav-link" %>
|
12
|
+
</li>
|
13
|
+
<li class="nav-item <%= 'active' if controller_name == 'employment_insurances' %>">
|
14
|
+
<%= link_to '雇用保険料', employment_insurances_path, class: "nav-link" %>
|
15
|
+
</li>
|
16
|
+
<li class="nav-item <%= 'active' if controller_name == 'consumption_taxes' %>">
|
17
|
+
<%= link_to '消費税', consumption_taxes_path, class: "nav-link" %>
|
18
|
+
</li>
|
19
|
+
<li class="nav-item <%= 'active' if controller_name == 'depreciation_rates' %>">
|
20
|
+
<%= link_to '減価償却率', depreciation_rates_path, class: "nav-link" %>
|
21
|
+
</li>
|
22
|
+
</ul>
|
7
23
|
</nav>
|
@@ -8,10 +8,12 @@
|
|
8
8
|
<%= stylesheet_link_tag "tax_jp/application", media: "all" %>
|
9
9
|
<%= javascript_include_tag "tax_jp/application" %>
|
10
10
|
</head>
|
11
|
-
<body>
|
11
|
+
<body class="taxjp">
|
12
12
|
|
13
13
|
<%= render 'layouts/tax_jp/nav' %>
|
14
|
-
|
14
|
+
<main role="main">
|
15
|
+
<%= yield %>
|
16
|
+
</main>
|
15
17
|
|
16
18
|
</body>
|
17
19
|
</html>
|
@@ -1,16 +1,16 @@
|
|
1
1
|
<div class="container">
|
2
2
|
<%= form_with model: @finder, url: {action: 'index'}, method: 'get', class: 'form form-vertical', local: true do |f| %>
|
3
3
|
<div class="row">
|
4
|
-
<div class="
|
4
|
+
<div class="form-group m-2">
|
5
5
|
<%= f.t_date_field :from %>
|
6
6
|
</div>
|
7
|
-
<div class="
|
8
|
-
<%= f.submit '表示', class: 'btn btn-
|
7
|
+
<div class="m-2">
|
8
|
+
<%= f.submit '表示', class: 'btn btn-light' %>
|
9
9
|
</div>
|
10
10
|
</div>
|
11
11
|
<% end %>
|
12
12
|
</div>
|
13
|
-
<div class="
|
13
|
+
<div class="py-2 px-4">
|
14
14
|
<table class="table table-striped table-bordered table-hover table-sm">
|
15
15
|
<thead class="thead-light">
|
16
16
|
<tr>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<div class="input-group date" id="datetimepicker4" data-target-input="nearest">
|
2
2
|
<label for="datetimepicker1" class="pt-2 pr-2">年月日:</label>
|
3
|
-
<%= f.text_field method, class: 'form-control datetimepicker-input', data: {target: '#datetimepicker4'} %>
|
3
|
+
<%= f.text_field method, class: 'form-control datetimepicker-input', style: 'width: 7em;', data: {target: '#datetimepicker4'} %>
|
4
4
|
<div class="input-group-append" data-target="#datetimepicker4" data-toggle="datetimepicker">
|
5
5
|
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
|
6
6
|
</div>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<div class="py-2 px-4">
|
2
|
+
<table class="table table-striped table-bordered table-hover table-sm col">
|
3
|
+
<thead class="thead-light">
|
4
|
+
<tr>
|
5
|
+
<th rowspan="2" class="align-middle text-center">適用開始日</th>
|
6
|
+
<th colspan="3" class="text-center">標準税率</th>
|
7
|
+
<th colspan="3" class="text-center">軽減税率</th>
|
8
|
+
</tr>
|
9
|
+
<tr>
|
10
|
+
<th class="text-center">消費税率(%)</th>
|
11
|
+
<th class="text-center">地方消費税率(%)</th>
|
12
|
+
<th class="text-center">合計(%)</th>
|
13
|
+
<th class="text-center">消費税率(%)</th>
|
14
|
+
<th class="text-center">地方消費税率(%)</th>
|
15
|
+
<th class="text-center">合計(%)</th>
|
16
|
+
</tr>
|
17
|
+
</thead>
|
18
|
+
<tbody>
|
19
|
+
<% @consumption_taxes.each do |ct| %>
|
20
|
+
<tr>
|
21
|
+
<td class="text-center"><%= ct.valid_from %></td>
|
22
|
+
<td class="text-center"><%= number_to_currency(ct.national_percent, unit: '', precision: 1) if ct.national_percent > 0 %></td>
|
23
|
+
<td class="text-center"><%= number_to_currency(ct.local_percent, unit: '', precision: 1) if ct.local_percent > 0 %></td>
|
24
|
+
<td class="text-center"><%= number_to_currency(ct.total_percent, unit: '') if ct.total_percent > 0 %></td>
|
25
|
+
<td class="text-center"></td>
|
26
|
+
<td class="text-center"></td>
|
27
|
+
<td class="text-center"></td>
|
28
|
+
</tr>
|
29
|
+
<% end %>
|
30
|
+
</tbody>
|
31
|
+
</table>
|
32
|
+
</div>
|
@@ -1,15 +1,15 @@
|
|
1
1
|
<div class="container">
|
2
2
|
<%= form_with model: @finder, url: {action: 'index'}, method: 'get', class: 'form form-vertical', local: true do |f| %>
|
3
3
|
<div class="row">
|
4
|
-
<div class="
|
4
|
+
<div class="form-group m-2">
|
5
5
|
<%= f.t_date_field :from %>
|
6
6
|
</div>
|
7
|
-
<div class="
|
7
|
+
<div class="form-group form-inline m-2">
|
8
8
|
<label for="finder_prefecture_code" class="pr-2">都道府県:</label>
|
9
9
|
<%= f.collection_select :prefecture_code, TaxJp::Prefecture.all, :code, :name, {}, class: 'form-control' %>
|
10
10
|
</div>
|
11
|
-
<div class="
|
12
|
-
<%= f.submit '表示', class: 'btn btn-
|
11
|
+
<div class="m-2">
|
12
|
+
<%= f.submit '表示', class: 'btn btn-light' %>
|
13
13
|
</div>
|
14
14
|
</div>
|
15
15
|
<% end %>
|
@@ -1,18 +1,18 @@
|
|
1
1
|
<div class="container">
|
2
2
|
<%= form_with model: @finder, url: {action: 'index'}, method: 'get', class: 'form form-vertical', local: true do |f| %>
|
3
3
|
<div class="row">
|
4
|
-
<div class="
|
4
|
+
<div class="form-group m-2">
|
5
5
|
<%= f.t_date_field :from %>
|
6
6
|
</div>
|
7
|
-
<div class="
|
8
|
-
<%= f.submit '表示', class: 'btn btn-
|
7
|
+
<div class="m-2">
|
8
|
+
<%= f.submit '表示', class: 'btn btn-light' %>
|
9
9
|
</div>
|
10
10
|
</div>
|
11
11
|
<% end %>
|
12
12
|
</div>
|
13
|
-
<div class="
|
13
|
+
<div class="py-2 px-4">
|
14
14
|
<table class="table table-striped table-bordered table-hover table-sm">
|
15
|
-
<thead>
|
15
|
+
<thead class="thead-light">
|
16
16
|
<tr>
|
17
17
|
<th class="text-center">社会保険料控除後の<br/>給与範囲(以上)</th>
|
18
18
|
<th class="text-center">社会保険料控除後の<br/>給与範囲(未満)</th>
|
data/config/routes.rb
CHANGED
@@ -1,24 +1,57 @@
|
|
1
1
|
module TaxJp
|
2
|
-
module
|
2
|
+
module ConsumptionTaxes
|
3
|
+
end
|
4
|
+
|
5
|
+
class ConsumptionTax
|
3
6
|
@@consumption_taxes = TaxJp::Utils.load_yaml('消費税.yml')
|
4
7
|
|
5
|
-
|
8
|
+
attr_reader :valid_from
|
9
|
+
attr_reader :national, :local, :total
|
10
|
+
|
11
|
+
def initialize(valid_from, values)
|
12
|
+
@valid_from = valid_from
|
13
|
+
@national = values['national']
|
14
|
+
@local = values['local']
|
15
|
+
@total = values['total']
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.all
|
19
|
+
ret = []
|
20
|
+
@@consumption_taxes.each do |valid_from, values|
|
21
|
+
ret << ConsumptionTax.new(valid_from, values)
|
22
|
+
end
|
23
|
+
ret
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.rate_on(date, options = {})
|
6
27
|
if date.is_a?(String)
|
7
28
|
date = Date.parse(date)
|
8
29
|
end
|
9
30
|
|
10
31
|
ret = 0
|
11
|
-
@@consumption_taxes.reverse_each do |
|
32
|
+
@@consumption_taxes.reverse_each do |valid_from, rate|
|
12
33
|
ret = rate['total']
|
13
|
-
break if date >=
|
34
|
+
break if date >= valid_from
|
14
35
|
end
|
15
|
-
|
36
|
+
|
16
37
|
if options[:percent]
|
17
38
|
ret *= 100
|
18
39
|
end
|
19
|
-
|
40
|
+
|
20
41
|
ret
|
21
42
|
end
|
22
43
|
|
44
|
+
def national_percent
|
45
|
+
national * 100
|
46
|
+
end
|
47
|
+
|
48
|
+
def local_percent
|
49
|
+
local * 100
|
50
|
+
end
|
51
|
+
|
52
|
+
def total_percent
|
53
|
+
total * 100
|
54
|
+
end
|
55
|
+
|
23
56
|
end
|
24
57
|
end
|
data/lib/tax_jp/version.rb
CHANGED
data/lib/tax_jp.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tax_jp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ichylinux
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-01-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bootstrap
|
@@ -110,8 +110,10 @@ files:
|
|
110
110
|
- app/assets/javascripts/tax_jp.js
|
111
111
|
- app/assets/javascripts/tax_jp/application.js
|
112
112
|
- app/assets/stylesheets/tax_jp/application.css.scss
|
113
|
+
- app/assets/stylesheets/tax_jp/layout,css.scss
|
113
114
|
- app/controllers/tax_jp/application_controller.rb
|
114
115
|
- app/controllers/tax_jp/bonus_withheld_taxes_controller.rb
|
116
|
+
- app/controllers/tax_jp/consumption_taxes_controller.rb
|
115
117
|
- app/controllers/tax_jp/depreciation_rates_controller.rb
|
116
118
|
- app/controllers/tax_jp/employment_insurances_controller.rb
|
117
119
|
- app/controllers/tax_jp/social_insurances_controller.rb
|
@@ -126,6 +128,7 @@ files:
|
|
126
128
|
- app/views/layouts/tax_jp/application.html.erb
|
127
129
|
- app/views/tax_jp/bonus_withheld_taxes/index.html.erb
|
128
130
|
- app/views/tax_jp/common/_date_field.html.erb
|
131
|
+
- app/views/tax_jp/consumption_taxes/index.html.erb
|
129
132
|
- app/views/tax_jp/depreciation_rates/index.html.erb
|
130
133
|
- app/views/tax_jp/employment_insurances/index.html.erb
|
131
134
|
- app/views/tax_jp/social_insurances/index.html.erb
|