suite
This commit is contained in:
parent
429325823c
commit
23eb1c086d
@ -114,8 +114,8 @@ GEM
|
|||||||
net-ssh (2.7.0)
|
net-ssh (2.7.0)
|
||||||
net-ssh-gateway (1.2.0)
|
net-ssh-gateway (1.2.0)
|
||||||
net-ssh (>= 2.6.5)
|
net-ssh (>= 2.6.5)
|
||||||
nokogiri (1.6.5)
|
nokogiri (1.6.0)
|
||||||
mini_portile (~> 0.6.0)
|
mini_portile (~> 0.5.0)
|
||||||
non-stupid-digest-assets (1.0.4)
|
non-stupid-digest-assets (1.0.4)
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
paypal-sdk-core (0.3.1)
|
paypal-sdk-core (0.3.1)
|
||||||
|
@ -7,11 +7,18 @@ class Renew < ActiveRecord::Base
|
|||||||
validates :payment_type_id, :presence => true
|
validates :payment_type_id, :presence => true
|
||||||
|
|
||||||
validates :join_type, :presence => true
|
validates :join_type, :presence => true
|
||||||
|
validates :personalized_price, :presence => true, numericality:{greater_than_or_equal_to: 20}, :if => :bienfaiteur?
|
||||||
|
|
||||||
before_validation do
|
before_validation do
|
||||||
self.payment_type_id = 3
|
if !self.bienfaiteur
|
||||||
|
self.personalized_price = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
if self.join_type == 1
|
self.payment_type_id = 3
|
||||||
|
if self.bienfaiteur
|
||||||
|
self.price = self.personalized_price
|
||||||
|
elsif self.join_type == 1
|
||||||
self.price = 10.0
|
self.price = 10.0
|
||||||
elsif self.join_type == 2
|
elsif self.join_type == 2
|
||||||
self.price = 15.0
|
self.price = 15.0
|
||||||
@ -36,7 +43,7 @@ class Renew < ActiveRecord::Base
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
sheet_year = self.sheet.sheet_years.new(:year => Renew::YEAR, :join_type => self.join_type, :paid_at => Time.now, :amount => self.price, :payment_type => self.payment_type_id, )
|
sheet_year = self.sheet.sheet_years.new(:benefactor => self.bienfaiteur, :year => Renew::YEAR, :join_type => self.join_type, :paid_at => Time.now, :amount => self.price, :payment_type => self.payment_type_id, )
|
||||||
|
|
||||||
if sheet_year.save
|
if sheet_year.save
|
||||||
self.return_done = true
|
self.return_done = true
|
||||||
|
@ -35,8 +35,12 @@
|
|||||||
%a{:href => "http://www.lepicvert.asso.fr/131/lassociation/adherer", :style => "color:white;text-decoration:none;"}
|
%a{:href => "http://www.lepicvert.asso.fr/131/lassociation/adherer", :style => "color:white;text-decoration:none;"}
|
||||||
Attention : votre adhésion n'a pas encore été renouvelée pour
|
Attention : votre adhésion n'a pas encore été renouvelée pour
|
||||||
= Date.today.year.to_s+"."
|
= Date.today.year.to_s+"."
|
||||||
|
%br
|
||||||
|
|
||||||
|
=link_to select_sheet_public_renews_index_path(:s => @options[:sheet].sheet_number.to_s), :style => "color:white;text-decoration:underline;" do
|
||||||
|
%strong
|
||||||
|
Nouveau : vous pouvez désormais la renouveler directement en ligne, par carte bancaire en suivant ce lien.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%tr{:style => "background:#f4f3ef"}
|
%tr{:style => "background:#f4f3ef"}
|
||||||
%td{:style => "width:185px;padding:20px;padding-top:22px;padding-bottom:28px;padding-left:30px;"}
|
%td{:style => "width:185px;padding:20px;padding-top:22px;padding-bottom:28px;padding-left:30px;"}
|
||||||
|
@ -2,6 +2,14 @@
|
|||||||
|
|
||||||
%p Pour renouveller votre adhésion vous pouvez indiquer votre numéro d'adhérent ci-dessous :
|
%p Pour renouveller votre adhésion vous pouvez indiquer votre numéro d'adhérent ci-dessous :
|
||||||
|
|
||||||
|
%ul
|
||||||
|
%li
|
||||||
|
Adhésion individuelle : 10 €
|
||||||
|
%li
|
||||||
|
Adhésion familiale : 15 €
|
||||||
|
%li
|
||||||
|
Bienfaiteur individuel ou familial : 20 € ou plus
|
||||||
|
|
||||||
=semantic_form_for @renew, :url => save_sheet_public_renews_index_path(), :html => {:method => :get} do |f|
|
=semantic_form_for @renew, :url => save_sheet_public_renews_index_path(), :html => {:method => :get} do |f|
|
||||||
|
|
||||||
-f.inputs do
|
-f.inputs do
|
||||||
@ -10,10 +18,15 @@
|
|||||||
|
|
||||||
=f.input :email, :label => "Email :"
|
=f.input :email, :label => "Email :"
|
||||||
|
|
||||||
=f.input :join_type, :collection => {"Individuel (10€)" => 1, "Familial (15€)" => 2}, :include_blank => false, :label => "Type d'adhésion", :as => :radio
|
=f.input :join_type, :collection => {"Individuel" => 1, "Familial" => 2}, :include_blank => false, :label => "Type d'adhésion :", :as => :radio
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
=f.input :bienfaiteur, :label => "Adhésion bienfaiteur ? (somme libre au dessus de 20€)", :input_html => {:onchange => "if($(this).is(':checked')){$('.bienfaiteur').show();}else{$('.bienfaiteur').hide();}"}
|
||||||
|
.bienfaiteur{:style => ("display:none" if !@renew.bienfaiteur)}
|
||||||
|
=f.input :personalized_price, :label => "Montant de votre adhésion bienfaiteur :"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
=f.submit "Renouveller mon adhésion par CB"
|
=f.submit "Renouveller mon adhésion par CB"
|
||||||
|
|
||||||
|
@ -29,8 +29,11 @@ Survey::Application.configure do
|
|||||||
config.assets.debug = true
|
config.assets.debug = true
|
||||||
|
|
||||||
|
|
||||||
config.action_mailer.delivery_method = :file
|
config.action_mailer.delivery_method = :smtp
|
||||||
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
|
config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }
|
||||||
|
|
||||||
|
config.action_mailer.default_url_options = { :host => HOSTNAME }
|
||||||
|
Rails.application.routes.default_url_options = config.action_mailer.default_url_options = { :host => HOSTNAME, :protocol => 'http' }
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
6
db/migrate/20190604091050_add_bienfaiteur_to_renews.rb
Normal file
6
db/migrate/20190604091050_add_bienfaiteur_to_renews.rb
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
class AddBienfaiteurToRenews < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :renews, :bienfaiteur, :boolean, :default => false
|
||||||
|
add_column :renews, :personalized_price, :decimal, :precision => 10, :scale => 2
|
||||||
|
end
|
||||||
|
end
|
@ -11,7 +11,7 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20190315002155) do
|
ActiveRecord::Schema.define(version: 20190604091050) do
|
||||||
|
|
||||||
create_table "admins", force: true do |t|
|
create_table "admins", force: true do |t|
|
||||||
t.string "email", default: "", null: false
|
t.string "email", default: "", null: false
|
||||||
@ -783,6 +783,8 @@ ActiveRecord::Schema.define(version: 20190315002155) do
|
|||||||
t.boolean "return_done", default: false
|
t.boolean "return_done", default: false
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
|
t.boolean "bienfaiteur", default: false
|
||||||
|
t.decimal "personalized_price", precision: 10, scale: 2
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "renews", ["sheet_id"], name: "index_renews_on_sheet_id", using: :btree
|
add_index "renews", ["sheet_id"], name: "index_renews_on_sheet_id", using: :btree
|
||||||
|
Loading…
x
Reference in New Issue
Block a user