%table.table

  -@csv.each do |row|
    -if p_product = PProduct.where(:code => row["Ref"]).first
      %tr
        %td
          =row["Ref"]
        -if p_product
          %td
            =p_product.id
          

          %td
            =p_product.name
          %td
            =row["Marque"]
          %td
            -if s_brand = SBrand.where(:name => row["Marque"]).first
              =s_brand.id
          
          %td
            -tva = row["Tva"].to_s.sub(" %", "").sub(",", ".").to_f
            -if tva != 5.5 and tva != 0.0
              =tva
          %td=row["Region"]
          
      
      
        -p_product.s_brand_id = s_brand.id if s_brand
        -p_product.country = row["Pays"]
        -p_product.sub_country = row["Region"]
        -p_product.domaine = row["Domaine"] 
        -p_product.note = p_product.note.to_s+row["Commentaire"].to_s
        

        
        -p_product.save
        
        -p_product.p_product_refs.each do |ppr|
          -ppr.uv = row["Format"]
          -ppr.capacite = row["Pcb"]
          -ppr.save