Add tax_references, its controller and some basic pages for viewing ref data about taxes.
This commit is contained in:
@@ -7,11 +7,11 @@
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
||||
<li class="nav-item">
|
||||
<%= link_to(t('Home'), root_path, class: 'nav-link') %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
<%= link_to(t('Tax References Tables'), tax_references_path, class: 'nav-link') %>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<% tax_references.each do |tax_ref| %>
|
||||
<li class="nav-item">
|
||||
<% item_class = 'nav-link' %>
|
||||
<% if not @tax_reference.nil? and tax_ref.year == @tax_reference.year %>
|
||||
<% item_class.concat(' active') %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to tax_ref.year, {controller: 'tax_references', action: :show, year: tax_ref.year},
|
||||
class: item_class %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
@@ -0,0 +1 @@
|
||||
<%= render 'top_list', tax_references: @tax_references %>
|
||||
@@ -0,0 +1,28 @@
|
||||
<%= render 'top_list', tax_references: @tax_references %>
|
||||
|
||||
<p><%= @tax_reference.year %></p>
|
||||
<p><%= @tax_reference.hourly_wage %></p>
|
||||
<p><%= number_to_percentage(@tax_reference.worker_percentage, precision: 2) %></p>
|
||||
<p><%= number_to_percentage(@tax_reference.employer_percentage, precision: 2) %></p>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t('Number of Hours') %></th>
|
||||
<th><%= t('Employer (extra)') %></th>
|
||||
<th><%= t('Worker (discount)') %></th>
|
||||
<th><%= t('Total contribution') %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% hourly_contribution = @tax_reference.hourly_wage / 100 %>
|
||||
<% (@tax_reference.min_monthly_hours..TaxReference::MAX_MONTHLY_HOURS).each do |n_hours| %>
|
||||
<tr>
|
||||
<td><%= n_hours %></td>
|
||||
<td><%= number_to_currency(@tax_reference.employer_contribution(n_hours), locale: :pt) %></td>
|
||||
<td><%= number_to_currency(@tax_reference.worker_contribution(n_hours), locale: :pt) %></td>
|
||||
<td><%= number_to_currency(@tax_reference.total_contribution(n_hours), locale: :pt) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
Reference in New Issue
Block a user