menu & forms
This commit is contained in:
parent
7a5e27685c
commit
0246cf966e
@ -126,7 +126,9 @@ class ApplicationController < ActionController::Base
|
|||||||
set_sub_sub_menu :stocks, :p_preferences_products_menu, :p_grades, "Grades" if PGrade::ACTIVATED
|
set_sub_sub_menu :stocks, :p_preferences_products_menu, :p_grades, "Grades" if PGrade::ACTIVATED
|
||||||
set_sub_sub_menu :stocks, :p_preferences_products_menu, :p_product_powers, "Types de chargeurs"
|
set_sub_sub_menu :stocks, :p_preferences_products_menu, :p_product_powers, "Types de chargeurs"
|
||||||
set_sub_sub_menu :stocks, :p_preferences_products_menu, :p_product_zones, "Zones produits"
|
set_sub_sub_menu :stocks, :p_preferences_products_menu, :p_product_zones, "Zones produits"
|
||||||
|
set_sub_sub_menu :stocks, :p_preferences_products_menu, :sorecop_cats, "Catégories SORECOP"
|
||||||
|
set_sub_sub_menu :stocks, :p_preferences_products_menu, :sorecop_taxes, "taxe SORECOP"
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
class PProductRef < ApplicationRecord
|
class PProductRef < ApplicationRecord
|
||||||
belongs_to :p_product
|
belongs_to :p_product
|
||||||
|
belongs_to :sorecop_cat
|
||||||
|
has_many :sorecop_taxes, through: :sorecop_cat
|
||||||
has_many :p_customer_cats, :through => :p_product
|
has_many :p_customer_cats, :through => :p_product
|
||||||
|
|
||||||
has_many :p_product_features
|
has_many :p_product_features
|
||||||
|
@ -1,2 +1,10 @@
|
|||||||
class SorecopCat < ApplicationRecord
|
class SorecopCat < ApplicationRecord
|
||||||
|
has_many :p_product_refs
|
||||||
|
has_many :sorecop_taxes, dependent: :destroy
|
||||||
|
|
||||||
|
acts_as_sorting :fields => {
|
||||||
|
:id => {:name => "ID"},
|
||||||
|
:name => {:name => "Catégorie", :reorder => true},
|
||||||
|
:actions => {:name => "Actions", :reorder => true}
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
@ -1,3 +1,15 @@
|
|||||||
class SorecopTax < ApplicationRecord
|
class SorecopTax < ApplicationRecord
|
||||||
belongs_to :sorecop_cat_id
|
belongs_to :sorecop_cat
|
||||||
|
|
||||||
|
|
||||||
|
acts_as_sorting :fields => {
|
||||||
|
:id => {:name => "ID"},
|
||||||
|
:title => {:name => "Désignation", :reorder => true},
|
||||||
|
:critere_min => {:name => "Critère mini (Go)", :reorder => true},
|
||||||
|
:critere_max => {:name => "Critère maxi (Go)", :reorder => true},
|
||||||
|
:fixed_price => {:name => "Prix forfaitaire", :reorder => true, :format => :boolean},
|
||||||
|
:sorecop_cat => {:name => "Catégorie SORECOP", :reorder => false},
|
||||||
|
:price => {:name => "Prix", :reorder => false},
|
||||||
|
:actions => {:name => "Actions", :reorder => true}
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
@ -2,15 +2,17 @@
|
|||||||
|
|
||||||
.content
|
.content
|
||||||
=f.inputs do
|
=f.inputs do
|
||||||
= f.input :critere_min, :label => f.object.label_for(:critere_min)
|
= f.input :sorecop_cat_id, as: :select, collection: SorecopCat.pluck(:name, :id) ,:label => f.object.label_for(:sorecop_cat)
|
||||||
= f.input :critere_max, :label => f.object.label_for(:critere_max)
|
= f.input :title, :label => f.object.label_for(:title)
|
||||||
= f.input :title, :label => f.object.label_for(:title)
|
= f.input :critere_min, :label => f.object.label_for(:critere_min)
|
||||||
= f.input :fixed_price, :label => f.object.label_for(:fixed_price)
|
= f.input :critere_max, :label => f.object.label_for(:critere_max)
|
||||||
= f.input :sorecop_cat_id, :label => f.object.label_for(:sorecop_cat_id)
|
= f.input :price, :label => f.object.label_for(:price)
|
||||||
|
= f.input :fixed_price, :label => f.object.label_for(:fixed_price)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.actions=f.submit "sauvegarder", :class => "btn btn-primary"
|
.actions=f.submit "sauvegarder", :class => "btn btn-primary"
|
||||||
|
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
%tr#sorecop_tax_row{:id => sorecop_tax.id}
|
%tr#sorecop_tax_row{:id => sorecop_tax.id}
|
||||||
-tr = {}
|
-tr = {}
|
||||||
|
|
||||||
|
-tr[:sorecop_cat] = capture do
|
||||||
|
%td
|
||||||
|
= sorecop_tax.sorecop_cat.name
|
||||||
|
|
||||||
|
|
||||||
-tr[:actions] = capture do
|
-tr[:actions] = capture do
|
||||||
%td.actions
|
%td.actions
|
||||||
@ -13,4 +18,4 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user