suite
This commit is contained in:
parent
a4170d531d
commit
7ff2f312f7
@ -7,6 +7,20 @@ class Admin::PCustomersController < ApplicationController
|
|||||||
before_action :admin_space
|
before_action :admin_space
|
||||||
|
|
||||||
|
|
||||||
|
def update_tel
|
||||||
|
PCustomer.find_each do |pc|
|
||||||
|
if !pc.tel?
|
||||||
|
if pc.imp_tel?
|
||||||
|
pc.tel = pc.imp_tel
|
||||||
|
pc.save
|
||||||
|
elsif pc.imp_portable
|
||||||
|
pc.tel = pc.imp_portable
|
||||||
|
pc.save
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def send_mail
|
def send_mail
|
||||||
@p_customer = PCustomer.find(params[:id])
|
@p_customer = PCustomer.find(params[:id])
|
||||||
@ -421,7 +435,7 @@ class Admin::PCustomersController < ApplicationController
|
|||||||
|
|
||||||
@data_to_send = @csv
|
@data_to_send = @csv
|
||||||
|
|
||||||
send_data @data_to_send, :filename => "export-csv.csv" #, :type => 'text/csv; charset=iso-8859-1; header=present'
|
send_data "\uFEFF" + @data_to_send, :filename => "export-csv.csv" #, :type => 'text/csv; charset=iso-8859-1; header=present'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,6 +25,8 @@ class MOdrPrime < ApplicationRecord
|
|||||||
|
|
||||||
has_many :mail_hists
|
has_many :mail_hists
|
||||||
has_many :m_odr_virements
|
has_many :m_odr_virements
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
acts_as_sorting :fields => {
|
acts_as_sorting :fields => {
|
||||||
:id => {:name => "Id", :reorder => true},
|
:id => {:name => "Id", :reorder => true},
|
||||||
@ -53,6 +55,7 @@ class MOdrPrime < ApplicationRecord
|
|||||||
|
|
||||||
:date_roulage => {:name => "Date de roulage", :reorder => true, :sort_name => "m_odr_file_roulages.date"},
|
:date_roulage => {:name => "Date de roulage", :reorder => true, :sort_name => "m_odr_file_roulages.date"},
|
||||||
:state => {:name => "Statut", :reorder => true},
|
:state => {:name => "Statut", :reorder => true},
|
||||||
|
:date_virement => {:name => "Date de virement"},
|
||||||
|
|
||||||
:actions => {:name => "Actions", :reorder => true},
|
:actions => {:name => "Actions", :reorder => true},
|
||||||
|
|
||||||
|
@ -264,7 +264,8 @@ class PCustomer < ApplicationRecord
|
|||||||
:particular_fill => "Adresse remplie ?",
|
:particular_fill => "Adresse remplie ?",
|
||||||
:parent => "Ambassadeur",
|
:parent => "Ambassadeur",
|
||||||
|
|
||||||
|
:particular_address_2 => "Adresse",
|
||||||
|
:particular_address_3 => "Adresse (suite)",
|
||||||
|
|
||||||
:particular_cp => "Code postal",
|
:particular_cp => "Code postal",
|
||||||
:particular_city => "Ville",
|
:particular_city => "Ville",
|
||||||
@ -597,6 +598,14 @@ class PCustomer < ApplicationRecord
|
|||||||
self.particular.firstname if self.particular
|
self.particular.firstname if self.particular
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def csv_particular_address_2
|
||||||
|
self.particular.address_2 if self.particular
|
||||||
|
end
|
||||||
|
|
||||||
|
def csv_particular_address_3
|
||||||
|
self.particular.address_3 if self.particular
|
||||||
|
end
|
||||||
|
|
||||||
def csv_particular_cp
|
def csv_particular_cp
|
||||||
self.particular.cp if self.particular
|
self.particular.cp if self.particular
|
||||||
end
|
end
|
||||||
|
@ -47,7 +47,15 @@
|
|||||||
=m_odr_prime.m_odr_file_roulage.m_event.organisateur.name if m_odr_prime.m_odr_file_roulage and m_odr_prime.m_odr_file_roulage.m_event and m_odr_prime.m_odr_file_roulage.m_event.organisateur
|
=m_odr_prime.m_odr_file_roulage.m_event.organisateur.name if m_odr_prime.m_odr_file_roulage and m_odr_prime.m_odr_file_roulage.m_event and m_odr_prime.m_odr_file_roulage.m_event.organisateur
|
||||||
|
|
||||||
|
|
||||||
|
-tr[:date_virement] = capture do
|
||||||
|
%td
|
||||||
|
-virement = m_odr_prime.m_odr_virements.where(:refused => 0, :sended => 1).order('id DESC').first
|
||||||
|
-if virement and virement.m_odr_remise
|
||||||
|
=l virement.m_odr_remise.created_at, :format => :date
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-tr[:actions] = capture do
|
-tr[:actions] = capture do
|
||||||
|
@ -42,7 +42,24 @@
|
|||||||
%td
|
%td
|
||||||
-if p_customer.particular
|
-if p_customer.particular
|
||||||
= p_customer.particular.country
|
= p_customer.particular.country
|
||||||
|
|
||||||
|
|
||||||
|
-tr[:particular_address_2] = capture do
|
||||||
|
%td
|
||||||
|
-if p_customer.particular
|
||||||
|
= p_customer.particular.address_2
|
||||||
|
|
||||||
|
-tr[:particular_address_3] = capture do
|
||||||
|
%td
|
||||||
|
-if p_customer.particular
|
||||||
|
= p_customer.particular.address_3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-tr[:particular_cp] = capture do
|
-tr[:particular_cp] = capture do
|
||||||
%td
|
%td
|
||||||
-if p_customer.particular
|
-if p_customer.particular
|
||||||
|
Loading…
x
Reference in New Issue
Block a user