This commit is contained in:
Barnabé 2021-10-11 19:07:32 +02:00
parent 63d1069be5
commit dbc8d3bfd6

View File

@ -94,19 +94,11 @@ class Admin::ImportCsvsController < ApplicationController
end end
def temp_p_product def temp_p_product
dev_mode = false
if dev_mode
@p_product_ref = PProductRef.last #DEV mode only
@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_ref.p_product_ref_specs.build
else
if params[:price_line_id] if params[:price_line_id]
@price_line = PriceLine.find(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 = 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 @p_product_ref.p_product_ref_specs.build
end end
end end
end end
end