Add sorecop to p_product_ref
This commit is contained in:
parent
f3246d0209
commit
d6640ded5a
@ -48,6 +48,7 @@ class PProductRef < ApplicationRecord
|
||||
:actions => {:name => "Actions", :reorder => false}
|
||||
}
|
||||
|
||||
acts_as_caching :fields => [:sorecop]
|
||||
|
||||
def not_imported?
|
||||
if !self.p_product or !self.p_product.imported
|
||||
@ -150,4 +151,12 @@ class PProductRef < ApplicationRecord
|
||||
"#{self.ref} | #{self.p_product.name} - #{self.ct_sub_name} - #{self.p_product_color.name if self.p_product_color} | #{self.cat_name}"
|
||||
end
|
||||
|
||||
def ca_sorecop
|
||||
if self.cc_sorecop
|
||||
return self.cc_sorecop
|
||||
else
|
||||
"TODO Calcul sorecop"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -0,0 +1,7 @@
|
||||
class AddSorecopToPProductRefs < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_column :p_product_refs, :ca_sorecop, :decimal
|
||||
add_column :p_product_refs, :cc_sorecop, :decimal
|
||||
add_column :p_product_refs, :ct_sorecop, :decimal
|
||||
end
|
||||
end
|
@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2021_09_14_071847) do
|
||||
ActiveRecord::Schema.define(version: 2021_09_17_115613) do
|
||||
|
||||
create_table "accounting_zones", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
|
||||
t.string "name"
|
||||
@ -1793,6 +1793,9 @@ ActiveRecord::Schema.define(version: 2021_09_14_071847) do
|
||||
t.boolean "stocked", default: true
|
||||
t.text "description"
|
||||
t.integer "p_product_color_id"
|
||||
t.decimal "ca_sorecop", precision: 10
|
||||
t.decimal "cc_sorecop", precision: 10
|
||||
t.decimal "ct_sorecop", precision: 10
|
||||
end
|
||||
|
||||
create_table "p_product_specs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
|
||||
|
Reference in New Issue
Block a user