suite
This commit is contained in:
parent
06bde6e25c
commit
31cfbbe637
@ -1,6 +1,10 @@
|
|||||||
class MOdrRep < ApplicationRecord
|
class MOdrRep < ApplicationRecord
|
||||||
belongs_to :m_odr
|
belongs_to :m_odr
|
||||||
|
|
||||||
|
include ActionView::Helpers::NumberHelper
|
||||||
|
include ActionView::Helpers::TranslationHelper
|
||||||
|
include ActionView::Helpers::UrlHelper
|
||||||
|
|
||||||
|
|
||||||
has_many :particulars, :dependent => :destroy
|
has_many :particulars, :dependent => :destroy
|
||||||
accepts_nested_attributes_for :particulars, :allow_destroy => true
|
accepts_nested_attributes_for :particulars, :allow_destroy => true
|
||||||
@ -33,7 +37,7 @@ class MOdrRep < ApplicationRecord
|
|||||||
def send_mail_type(slug, element = nil)
|
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?
|
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}, :m_odr => self.m_odr, :m_odr_rep => self, :element => element})
|
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})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user