Adds dues to navigation and fixes amount calculation

This commit is contained in:
Hugo Peixoto 2023-03-23 18:15:45 +00:00
parent b4dda05575
commit f956a65100
5 changed files with 8 additions and 1 deletions

View File

@ -33,7 +33,7 @@ class ContributionsController < ApplicationController
[year, @due_members.select {|m| m.expires_on < Date.new(year, 12, 31) }.map { |m| [year, @due_members.select {|m| m.expires_on < Date.new(year, 12, 31) }.map { |m|
OpenStruct.new( OpenStruct.new(
member: m, member: m,
amount: m.category == 'normal' ? 30 : 6, amount: m.employed? ? 30 : 6,
) )
}] }]
end end

View File

@ -12,6 +12,10 @@ class Member < ApplicationRecord
update(status: expected_status) update(status: expected_status)
end end
def employed?
category == "normal" || category == "employed"
end
def remove_personal_information! def remove_personal_information!
update( update(
excluded: true, excluded: true,

View File

@ -18,6 +18,7 @@
<li><%= link_to t('navigation.board'), edit_board_path %></li> <li><%= link_to t('navigation.board'), edit_board_path %></li>
<li><%= link_to t('navigation.notifications'), notifications_path %></li> <li><%= link_to t('navigation.notifications'), notifications_path %></li>
<li><%= link_to t('navigation.contributions'), contributions_path %></li> <li><%= link_to t('navigation.contributions'), contributions_path %></li>
<li><%= link_to t('navigation.due_contributions'), due_contributions_path %></li>
<li> <li>
<%= button_to sign_out_path, method: :delete do %> <%= button_to sign_out_path, method: :delete do %>
Sign out of <%= current_user.email %> Sign out of <%= current_user.email %>

View File

@ -4,6 +4,7 @@ en:
board: "Board" board: "Board"
notifications: "Notificações" notifications: "Notificações"
contributions: "Contributions" contributions: "Contributions"
due_contributions: "Dues"
members: members:
index: index:
title: "Members" title: "Members"

View File

@ -7,6 +7,7 @@ pt:
board: "Direcção" board: "Direcção"
notifications: "Notificações" notifications: "Notificações"
contributions: "Contribuições" contributions: "Contribuições"
due_contributions: "Dívidas"
members: members:
delete: delete:
confirmation_message: | confirmation_message: |