refacto
This commit is contained in:
parent
63d1069be5
commit
dbc8d3bfd6
@ -94,19 +94,11 @@ class Admin::ImportCsvsController < ApplicationController
|
||||
end
|
||||
|
||||
def temp_p_product
|
||||
dev_mode = false
|
||||
if dev_mode
|
||||
@p_product_ref = PProductRef.last #DEV mode only
|
||||
if params[:price_line_id]
|
||||
@price_line = PriceLine.find(params[:price_line_id])
|
||||
|
||||
@p_product_ref.ct_price_ht = @price_line.ct_u_price_ht #DEV ode onmy
|
||||
p_product = PProduct.find_or_create_by(name: "--> Selectioner un produit <--", code: "--> Indiquer un code produit <--")
|
||||
@p_product_ref = PProductRef.find_or_create_by(p_product: p_product, ct_sub_name: @price_line.title, ct_price_ht: @price_line.ct_u_price_ht)
|
||||
@p_product_ref.p_product_ref_specs.build
|
||||
else
|
||||
if params[:price_line_id]
|
||||
@price_line = PriceLine.find(params[:price_line_id])
|
||||
@p_product_ref = PProductRef.find_or_create_by(p_product: PProduct.find_by(name: "--> Selectioner un produit <--"), ct_sub_name: @price_line.title, ct_price_ht: @price_line.ct_u_price_ht)
|
||||
@p_product_ref.p_product_ref_specs.build
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user