menu & forms
This commit is contained in:
parent
7a5e27685c
commit
0246cf966e
@ -126,6 +126,8 @@ 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_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, :sorecop_cats, "Catégories SORECOP"
|
||||
set_sub_sub_menu :stocks, :p_preferences_products_menu, :sorecop_taxes, "taxe SORECOP"
|
||||
|
||||
|
||||
end
|
||||
|
@ -1,6 +1,7 @@
|
||||
class PProductRef < ApplicationRecord
|
||||
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_product_features
|
||||
|
@ -1,2 +1,10 @@
|
||||
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
|
||||
|
@ -1,3 +1,15 @@
|
||||
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
|
||||
|
@ -2,11 +2,13 @@
|
||||
|
||||
.content
|
||||
=f.inputs do
|
||||
= f.input :sorecop_cat_id, as: :select, collection: SorecopCat.pluck(:name, :id) ,:label => f.object.label_for(:sorecop_cat)
|
||||
= f.input :title, :label => f.object.label_for(:title)
|
||||
= f.input :critere_min, :label => f.object.label_for(:critere_min)
|
||||
= f.input :critere_max, :label => f.object.label_for(:critere_max)
|
||||
= f.input :title, :label => f.object.label_for(:title)
|
||||
= f.input :price, :label => f.object.label_for(:price)
|
||||
= f.input :fixed_price, :label => f.object.label_for(:fixed_price)
|
||||
= f.input :sorecop_cat_id, :label => f.object.label_for(:sorecop_cat_id)
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,6 +1,11 @@
|
||||
%tr#sorecop_tax_row{:id => sorecop_tax.id}
|
||||
-tr = {}
|
||||
|
||||
-tr[:sorecop_cat] = capture do
|
||||
%td
|
||||
= sorecop_tax.sorecop_cat.name
|
||||
|
||||
|
||||
-tr[:actions] = capture do
|
||||
%td.actions
|
||||
= link_to i(:"trash-o"), [:admin, sorecop_tax], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
|
||||
|
Reference in New Issue
Block a user