
-lock_modif = false

-if form.object.p_sheet_line_stocks.count > 0 
  -lock_modif = true
.product_stock_form.qi_pannel.qi_plain.padding{:style => "margin-bottom:20px;"}
  %table{:style => "width:100%;"}
    %tr
      %td
        = form.input :p_brut_product_id, :label => "Matière :", :collection => PBrutProduct.all, :as => :select, :include_blank => false , :input_html =>{:readonly => (true if lock_modif)}
      %td
        = form.input :p_tank_id, :label => "Stockage :", :collection => PTank.all, :as => :select, :include_blank => true , :input_html =>{:readonly => (true if lock_modif)}
      %td
        = form.input :externe, :label => "Stock externe ?"


    
      %td
        = form.input :qte, :label => "Quantité annoncée:", :input_html =>{:class => "t_sheet_line_qte", :readonly => (true if lock_modif)}, :inline => true
      %td  
        = form.input :price, :label => "Prix annoncé :" , :input_html =>{:class => "t_sheet_line_price", :readonly => (true if lock_modif)}
        
      %td.price_td
        %label Prix HT :
        .t_sheet_line_tot.price_emp
      
    %tr
      %td
        = form.input :comptabilised, :label => "Comptabilisé ?"
          
      %td{:colspan => 1}= form.input :ok_at, :label => "Date de livraison :", :input_html =>{:readonly => (true if lock_modif)}, :as => :date
      
      %td
        -if lock_modif
          Livrée :
        -else
          = form.input :ok, :label => "Livrée ?", :input_html =>{:readonly => (true if lock_modif)}
        
        
      
      
 
      
      %td= form.input :ok_qte, :label => "Quantité livrée :" , :input_html =>{:class => "sheet_line_qte", :readonly => (true if lock_modif)}
      %td= form.input :ok_price, :label => "Prix livré :" , :input_html =>{:class => "sheet_line_price", :readonly => (true if lock_modif)}
      
      %td.price_td
        %label Prix HT :
        .sheet_line_tot.price_emp
    
      