suite
This commit is contained in:
parent
2c09c5decb
commit
b97e5612d0
@ -25,7 +25,7 @@ class MOdrRep < ApplicationRecord
|
||||
has_many :m_odr_files, :dependent => :destroy
|
||||
accepts_nested_attributes_for :m_odr_files, :allow_destroy => true
|
||||
|
||||
|
||||
validates :m_odr_product_cat_id, :presence => true, :if => :product_cat_needed?
|
||||
|
||||
validates :qte, :presence => true
|
||||
validates :m_odr_product_id, :presence => true
|
||||
@ -37,6 +37,14 @@ class MOdrRep < ApplicationRecord
|
||||
|
||||
|
||||
|
||||
def product_cat_needed?
|
||||
if self.m_odr.m_odr_product_cats.count > 0
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def rgpd_needed?
|
||||
if self.m_odr and self.m_odr.confirm_case_needed
|
||||
true
|
||||
|
@ -102,7 +102,7 @@
|
||||
|
||||
-if @m_odr_rep.m_odr.tel_process
|
||||
=f.input :tel, :label => (!@m_odr_rep.m_odr.placeholder? ? false : "Tel :"), :placeholder => (@m_odr_rep.m_odr.placeholder? ? false : "Tel")
|
||||
Nous ne vous contacterons par téléphone qu’en cas de problème avec votre dossier
|
||||
Nous ne vous contacterons par téléphone qu’en cas de problème avec votre dossier
|
||||
|
||||
-if @m_odr_rep.m_odr_rep_ribs.size > 0
|
||||
.form_pannel
|
||||
@ -128,7 +128,7 @@
|
||||
|
||||
-if f.object.m_odr.m_odr_product_cats.count > 0
|
||||
=f.inputs do
|
||||
=f.input :m_odr_product_cat_id, :label => (!@m_odr_rep.m_odr.placeholder ? false :(@m_odr_rep.m_odr.product_cat_label? ? @m_odr_rep.m_odr.product_cat_label : "Types :")), :as => :select, :collection => f.object.m_odr.m_odr_product_cats.order("id ASC"), :member_label => :name, :include_blank => false
|
||||
=f.input :m_odr_product_cat_id, :label => (!@m_odr_rep.m_odr.placeholder ? false :(@m_odr_rep.m_odr.product_cat_label? ? @m_odr_rep.m_odr.product_cat_label : "Types :")), :as => :select, :collection => f.object.m_odr.m_odr_product_cats.order("id ASC"), :member_label => :name, :include_blank => true, :prompt => (@m_odr_rep.m_odr.product_cat_label? ? @m_odr_rep.m_odr.product_cat_label : "Nombre de pneus")
|
||||
|
||||
|
||||
=f.inputs do
|
||||
|
Loading…
x
Reference in New Issue
Block a user