suite
This commit is contained in:
parent
c9dd9d8501
commit
2f57a75117
@ -80,10 +80,15 @@ class PCustomer < ApplicationRecord
|
||||
self.m_odr_rep_ribs.create(:bic => self.imp_bic, :iban => self.imp_iban, :admin_ok => true)
|
||||
end
|
||||
|
||||
if self.imp_test == "oui"
|
||||
self.test_user = true
|
||||
end
|
||||
|
||||
if self.particular
|
||||
part = self.particular
|
||||
else
|
||||
part = Particular.new
|
||||
part.owner = self
|
||||
end
|
||||
part.name = self.imp_name
|
||||
part.firstname = self.imp_firstname
|
||||
@ -129,7 +134,9 @@ class PCustomer < ApplicationRecord
|
||||
|
||||
end
|
||||
|
||||
#after_create :do_import
|
||||
after_create do
|
||||
do_import() if self.imp_email?
|
||||
end
|
||||
|
||||
after_update do
|
||||
#self.do_import if self.refresh_import
|
||||
|
@ -20,18 +20,27 @@
|
||||
.row.qi_cancel_margins
|
||||
|
||||
|
||||
.col-sm-4
|
||||
.col-sm-2
|
||||
|
||||
= form.input :parent_id, :label => "Ambassadeur :", :include_blank => true, :collection => PCustomer.where(:ambassadeur => true).all, :as => :select, :member_label => :member_label
|
||||
|
||||
.col-sm-4
|
||||
.col-sm-2
|
||||
%br
|
||||
= form.input :enabled, :label => "Utilisateur actif ?", :as => :boolean, :input_html => {:id => ""}
|
||||
= form.input :enabled, :label => "Utilisateur actif ?", :as => :boolean
|
||||
|
||||
.col-sm-4
|
||||
.col-sm-2
|
||||
%br
|
||||
= form.input :ambassadeur, :label => "Ambassadeur ?", :as => :boolean, :input_html => {:id => ""}
|
||||
|
||||
= form.input :ambassadeur, :label => "Ambassadeur ?", :as => :boolean
|
||||
|
||||
.col-sm-2
|
||||
%br
|
||||
= form.input :sticker, :label => "Sticker envoyés ?"
|
||||
|
||||
.col-sm-2
|
||||
%br
|
||||
= form.input :test_user, :label => "Client test ?", :as => :boolean
|
||||
|
||||
|
||||
|
||||
= form.input :tel, :label => "Tel :"
|
||||
= form.input :email, :label => "Email (login) :"
|
||||
@ -66,7 +75,7 @@
|
||||
= form.input :nbr_roulages, :label => "Nombre de roulage :", :include_blank => true, :collection => PCustomer::NBR_ROULAGES, :as => :select
|
||||
|
||||
.col-sm-2
|
||||
= form.input :sticker, :label => "Sticker envoyés ?"
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
.center_programme
|
||||
.block_num
|
||||
%span.chiffre
|
||||
=PCustomer.where(:enabled => true).count
|
||||
=PCustomer.where(:enabled => true, :test_user => false).count
|
||||
%span.label-chiffre Membres
|
||||
.block_num
|
||||
%span.chiffre
|
||||
|
@ -0,0 +1,7 @@
|
||||
class AddTestUserToPCustomers < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_column :p_customers, :test_user, :boolean, :default => false
|
||||
|
||||
PCustomer.where(:imp_test => "oui").update_all :test_user => true
|
||||
end
|
||||
end
|
@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2020_06_24_140026) do
|
||||
ActiveRecord::Schema.define(version: 2020_06_25_135439) do
|
||||
|
||||
create_table "accounting_zones", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
|
||||
t.string "name"
|
||||
@ -1722,6 +1722,7 @@ ActiveRecord::Schema.define(version: 2020_06_24_140026) do
|
||||
t.string "imp_demande_info"
|
||||
t.date "imp_creation"
|
||||
t.date "imp_modification"
|
||||
t.boolean "test_user", default: false
|
||||
t.index ["market_discount_id"], name: "index_p_customers_on_market_discount_id"
|
||||
t.index ["p_customer_cat_id"], name: "index_p_customers_on_p_customer_cat_id"
|
||||
t.index ["particular_id"], name: "index_p_customers_on_particular_id"
|
||||
|
Loading…
x
Reference in New Issue
Block a user