diff --git a/app/models/m_odr_rep.rb b/app/models/m_odr_rep.rb index dcc0941..e390829 100644 --- a/app/models/m_odr_rep.rb +++ b/app/models/m_odr_rep.rb @@ -74,7 +74,7 @@ class MOdrRep < ApplicationRecord def send_mail_type(slug, element = nil) if self.m_odr and mail_type = self.m_odr.mail_types.where(:slug => slug).first and self.particulars.first and self.particulars.first.email? - mail_hist = MailHist.generate_mail(:fr, mail_type, self.particulars.first.email, {:arguments => {:nom_odr => self.m_odr.name, :remise => number_to_currency(self.remise.to_f), :civilite => self.particular_civilite, :nom => self.particular_name, :prenom => self.particular_firstname }, :m_odr => self.m_odr, :m_odr_rep => self, :element => element}) + mail_hist = MailHist.generate_mail(:fr, mail_type, self.particulars.first.email, {:arguments => {:bon_achat => ("
" if self.m_odr.ba_generation),:nom_odr => self.m_odr.name, :remise => number_to_currency(self.remise.to_f), :civilite => self.particular_civilite, :nom => self.particular_name, :prenom => self.particular_firstname }, :m_odr => self.m_odr, :m_odr_rep => self, :element => element}) end end diff --git a/app/views/admin/m_odr_reps/_left_column.html.haml b/app/views/admin/m_odr_reps/_left_column.html.haml index ab245f8..e9b1089 100644 --- a/app/views/admin/m_odr_reps/_left_column.html.haml +++ b/app/views/admin/m_odr_reps/_left_column.html.haml @@ -157,7 +157,17 @@ RIB : -if @m_odr_rep.m_odr.ba_generation - =debug @m_odr_rep.generate_ba + - @m_odr_rep.generate_ba =link_to "Voir le bon d'achat", @m_odr_rep.ba_url, :class => "btn btn-primary" + + -if false + + %p Test mail + + -if m_odr_virement = @m_odr_rep.m_odr_virements.first + -m_odr_virement.m_odr_rep.send_mail_type("succes", m_odr_virement) + %p test + + \ No newline at end of file diff --git a/app/views/admin/m_odr_reps/ba.html.haml b/app/views/admin/m_odr_reps/ba.html.haml index 1a12176..20ceda6 100644 --- a/app/views/admin/m_odr_reps/ba.html.haml +++ b/app/views/admin/m_odr_reps/ba.html.haml @@ -1,5 +1,5 @@ #ba - =image_tag "https://offres.market-inn.fr/"+@m_odr_rep.m_odr.ba_image_file.file.url if @m_odr_rep.m_odr.ba_image_file + =image_tag (Rails.env.development? ? "http://localhost:4000" : "https://offres.market-inn.fr/")+@m_odr_rep.m_odr.ba_image_file.file.url if @m_odr_rep.m_odr.ba_image_file .name{:style => "top:#{@m_odr_rep.m_odr.ba_name_y}px;"} diff --git a/app/views/admin/m_odr_reps/show.html.haml b/app/views/admin/m_odr_reps/show.html.haml index 3a69df3..1f66bc9 100644 --- a/app/views/admin/m_odr_reps/show.html.haml +++ b/app/views/admin/m_odr_reps/show.html.haml @@ -35,8 +35,6 @@ #head=render :partial => "admin/m_odr_reps/head" - - %hr Achat .row diff --git a/app/views/admin/m_odrs/_form.html.haml b/app/views/admin/m_odrs/_form.html.haml index de11e7f..1e550f0 100644 --- a/app/views/admin/m_odrs/_form.html.haml +++ b/app/views/admin/m_odrs/_form.html.haml @@ -47,6 +47,8 @@ = f.input :thank_text, :label => "Texte remerciement" = f.input :buy_infos, :label => "Texte info supplémentaire achats" + + = f.input :email_from, :label => "Adresse email d'envoi :" .qi_row diff --git a/app/views/admin/m_odrs/show.html.haml b/app/views/admin/m_odrs/show.html.haml index 680d27a..6cba8a0 100644 --- a/app/views/admin/m_odrs/show.html.haml +++ b/app/views/admin/m_odrs/show.html.haml @@ -58,7 +58,7 @@ .qi_tab_header .right{:style => "text-align:right;"} - = link_to 'Ajouter', new_admin_m_odr_file_type_path(:m_odr => @m_odr.id), :class => "btn btn-primary", :remote => true + = link_to 'Ajouter', new_admin_m_odr_file_type_path(:m_odr_id => @m_odr.id), :class => "btn btn-primary", :remote => true -params[:search][:per_page] = params[:search][:per_page] || 50 -per_page = params[:search][:per_page]