- Adding a contribution will automatically bump the membership expiration
- date by one year. If it's the first contribution for this member, the
- join date will be set to the payment date and the expiration date one
- year after that. You can override the expiration date by setting a date
- below:
+ <%= t('contributions.new.expires_on_warning') %>
+
+
<%= t('members.attributes.joined_on') %>
+
<%= @member.joined_on %>
+
+
+
<%= t('members.attributes.expires_on') %>
+
<%= @member.expires_on %>
+
diff --git a/app/views/members/delete.html.erb b/app/views/members/delete.html.erb
new file mode 100644
index 0000000..dea23a6
--- /dev/null
+++ b/app/views/members/delete.html.erb
@@ -0,0 +1,27 @@
+
+ <% @member.notifications.order(to_be_sent_on: :desc).each do |notification| %>
+
+
<%= notification.to_be_sent_on %>
+
<%= notification.template %>
+
<%= notification_status(notification.status) %>
+
+ <% end %>
+
+
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 3adf8af..3d357e1 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -44,6 +44,14 @@ en:
unemployed: "Unemployed"
student: "Student"
retired: "Retired"
+ contributions:
+ new:
+ expires_on_warning: |
+ Adding a contribution will automatically bump the membership expiration
+ date by one year. If it's the first contribution for this member, the
+ join date will be set to the payment date and the expiration date one
+ year after that. You can override the expiration date by setting a date
+ below.
notification_mailer:
expiration_in_60d:
subject: "ANSOL - Pagamento anual de quotas"
diff --git a/config/locales/pt.yml b/config/locales/pt.yml
index aa915a4..b6fa5e6 100644
--- a/config/locales/pt.yml
+++ b/config/locales/pt.yml
@@ -2,6 +2,16 @@ pt:
navigation:
members: "Lista de membros"
members:
+ delete:
+ confirmation_message: |
+ Tens a certeza que queres apagar o registo deste membro
+ permanentemente? Esta acção vai apagar todos os dados pessoais da
+ pessoa em questão, mas não irá apagar o registo de contribuições, caso
+ estas sejam necessárias por motivos legais/fiscais.
+ title: "Remover membro permanentemente"
+ actions:
+ submit: "Confirmar remoção"
+ go_back: "Cancelar"
index:
title: "Membros"
actions:
@@ -16,6 +26,9 @@ pt:
actions:
edit: "Editar detalhes"
edit_contribution: "Editar"
+ delete_contribution: "Apagar"
+ contribution_history: "Histórico de contribuições"
+ notifications: "Notificações por correio electrónico"
edit:
title: "Editar detalhes de membro"
actions:
@@ -46,6 +59,34 @@ pt:
unemployed: "Desempregado"
student: "Estudante"
retired: "Reformado"
+ notifications:
+ attributes:
+ to_be_sent_on: Data de envio
+ template: Modelo
+ status: Estado
+ status:
+ sent: Enviada
+ scheduled: Agendada
+ contributions:
+ attributes:
+ amount: Montante
+ payment_on: Data de pagamento
+ payment_method: Método de pagamento
+ payment_reference: Referência
+ edit:
+ member: "Membro"
+ title: "Editar dados de contribuição"
+ actions:
+ submit: "Gravar"
+ new:
+ member: "Membro"
+ title: "Registar contribuição"
+ expires_on_warning: |
+ Ao registar uma contribuição, o sistema estende a data de expiração por
+ um ano automaticamente. Se for a primeira contribuição deste membro, a
+ data de inscrição é automaticamente definida como a data de pagamento,
+ e a data de expiração passa a ser um ano após essa data. Podes definir
+ uma data de expiração manualmente usando o próximo campo.
notification_mailer:
expiration_in_60d:
subject: "ANSOL - Pagamento anual de quotas"
diff --git a/config/routes.rb b/config/routes.rb
index 29828f3..f21fa29 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -5,8 +5,15 @@ Rails.application.routes.draw do
# root "articles#index"
resources :members do
+ member do
+ get :delete
+ end
resources :contributions, only: [:new, :create]
end
- resources :contributions, only: [:edit, :update]
+ resources :contributions, only: [:edit, :update, :destroy] do
+ member do
+ get :delete
+ end
+ end
end
diff --git a/db/migrate/20220625174250_add_excluded_to_members.rb b/db/migrate/20220625174250_add_excluded_to_members.rb
new file mode 100644
index 0000000..4c4c607
--- /dev/null
+++ b/db/migrate/20220625174250_add_excluded_to_members.rb
@@ -0,0 +1,7 @@
+class AddExcludedToMembers < ActiveRecord::Migration[7.0]
+ def change
+ change_table :members do |t|
+ t.boolean :excluded, default: false
+ end
+ end
+end
diff --git a/db/migrate/20220625181824_remove_null_constraints_from_member.rb b/db/migrate/20220625181824_remove_null_constraints_from_member.rb
new file mode 100644
index 0000000..e4963f7
--- /dev/null
+++ b/db/migrate/20220625181824_remove_null_constraints_from_member.rb
@@ -0,0 +1,6 @@
+class RemoveNullConstraintsFromMember < ActiveRecord::Migration[7.0]
+ def change
+ change_column_null :members, :email, true
+ change_column_null :members, :display_name, true
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index fead68e..acaad17 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema[7.0].define(version: 2022_06_24_134509) do
+ActiveRecord::Schema[7.0].define(version: 2022_06_25_181824) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
@@ -28,8 +28,8 @@ ActiveRecord::Schema[7.0].define(version: 2022_06_24_134509) do
create_table "members", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.serial "number", null: false
- t.string "email", null: false
- t.string "display_name", null: false
+ t.string "email"
+ t.string "display_name"
t.string "identification_number"
t.string "status"
t.string "category"
@@ -40,6 +40,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_06_24_134509) do
t.date "expires_on"
t.string "regular_ifthenpay_link"
t.string "reduced_ifthenpay_link"
+ t.boolean "excluded", default: false
t.index ["email"], name: "index_members_on_email", unique: true
t.index ["number"], name: "index_members_on_number", unique: true
end