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|
OpenStruct.new(
member: m,
amount: m.category == 'normal' ? 30 : 6,
amount: m.employed? ? 30 : 6,
)
}]
end

View File

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

View File

@ -18,6 +18,7 @@
<li><%= link_to t('navigation.board'), edit_board_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.due_contributions'), due_contributions_path %></li>
<li>
<%= button_to sign_out_path, method: :delete do %>
Sign out of <%= current_user.email %>

View File

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

View File

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