
=f.inputs do

  =f.inputs do
    
    = f.input :p_commercial_id, :label => "Commercial :", :include_blank => true, :collection => PCommercial.order(:name).all, :as => :select, :member_label => :long_name if @p_customer_sheet.id
    
    
    = f.hidden_field :p_customer_id, :class => "p_customer_id"
    
  .p_customer_sheet_customer
  
  
    -if @p_customer_sheet.p_customer and @p_customer_sheet.p_customer.particular
      =render :partial => "admin/p_customers/apercu", :locals => {:particular => @p_customer_sheet.p_customer.particular}
  
  .addresses.row
    .columns.span_6
      %h3 Adresse de facturation
  
      -if @p_customer_sheet.p_customer
        =f.inputs do
          = f.input :particular_bill_id, :collection => @p_customer_sheet.p_customer.particulars.all, :as => :select, :member_label => :address_line, :include_blank => false, :label => "Adresse de facturation"
      -else
        =f.inputs do
          = f.input :particular_bill_id, :collection => [], :as => :select, :include_blank => false, :label => "Adresse de facturation"
      
    .columns.span_6
      %h3 Adresse de livraison
  
      -if @p_customer_sheet.p_customer
        =f.inputs do
          = f.input :particular_send_id, :collection => @p_customer_sheet.p_customer.particulars.all, :as => :select, :member_label => :address_line, :include_blank => false, :label => "Adresse de livraison"
      -else
        =f.inputs do
          = f.input :particular_send_id, :collection => [], :as => :select, :include_blank => false, :label => "Adresse de facturation"
          
    .clear
  
  


  = f.input :wish_date, :label => "Date de livraison souhaitée :", :as => :date
  
  = f.input :customer_ref, :label => "Référence commande client :"
  
  
  .price_lines_form
    =f.semantic_fields_for :price_lines do |f|
      =render :partial => "admin/price_lines/form", :locals => {:form => f}
  
  %p= link_to_add_fields "Ajouter une ligne", f, :price_lines
  
  
  .price_line_block_footer
    = f.input :ct_tot_discount_percent, :label => "Réduction pied de page (%) :", :input_html => {:class => "input_price_line_block_ct_tot_discount_percent"}
    = f.input :ct_tot_fdp_ht, :label => "Frais de port personnalisés :"
    

  -if false
  
    .price_line_block_footer
      =qi_js_field(f, :price_line_block, :weight_tot, :label => "Poids :")
  
      =qi_js_field(f, :price_line_block, :tot_lines_ht, :label => "Total lignes HT :")
      = f.input :ct_tot_discount_percent, :label => "Réduction pied de page (%) :", :input_html => {:class => "input_price_line_block_ct_tot_discount_percent"}
      =qi_js_field(f, :price_line_block, :tot_discount_ht, :label => "Remise générale HT :")
      =qi_js_field(f, :price_line_block, :tot_discount_tva, :label => "Remise générale (TVA) :")
      =qi_js_field(f, :price_line_block, :tot_discount_ttc, :label => "Remise générale (TTC) :")
      =# f.input :ct_tot_fdp_ht, :label => "Frais de port personnalisés :"
      =qi_js_field(f, :price_line_block, :tot_fdp_ht, :label => "Total frais de port :")
      =qi_js_field(f, :price_line_block, :tot_fdp_tva, :label => "Frais de port TVA :")
      =qi_js_field(f, :price_line_block, :tot_fdp_ttc, :label => "Frais de port TTC :")
      =qi_js_field(f, :price_line_block, :tot_amount_ht, :label => "Total HT :")
      =qi_js_field(f, :price_line_block, :tot_amount_tva, :label => "Total TVA :")
      =qi_js_field(f, :price_line_block, :tot_amount_ttc, :label => "Total TTC :")
  
    
  
  -if false
    = f.input :cc_accounting_zone_id, :label => "cc_accounting_zone_id :" 
    = f.input :ac_accounting_zone_name, :label => "ac_accounting_zone_name :" 
    = f.input :cc_accounting_zone_name, :label => "cc_accounting_zone_name :" 
    = f.input :movement_type, :label => "movement_type :" 
    = f.input :accounting, :label => "accounting :" 
    = f.input :ac_tot_lines_ht, :label => "ac_tot_lines_ht :" 
    = f.input :cc_tot_lines_ht, :label => "cc_tot_lines_ht :" 
    = f.input :ac_tot_lines_tva, :label => "ac_tot_lines_tva :" 
    = f.input :cc_tot_lines_tva, :label => "cc_tot_lines_tva :" 
    = f.input :ac_tot_lines_ttc, :label => "ac_tot_lines_ttc :" 
    = f.input :cc_tot_lines_ttc, :label => "cc_tot_lines_ttc :" 
    = f.input :tot_discount_custom_percent, :label => "tot_discount_custom_percent :" 
    = f.input :tot_discount_custom_value, :label => "tot_discount_custom_value :" 
    = f.input :ac_tot_discount_ht, :label => "ac_tot_discount_ht :" 
    = f.input :cc_tot_discount_ht, :label => "cc_tot_discount_ht :" 
    = f.input :ac_tot_discount_tva, :label => "ac_tot_discount_tva :" 
    = f.input :cc_tot_discount_tva, :label => "cc_tot_discount_tva :" 
    = f.input :ac_tot_discount_ttc, :label => "ac_tot_discount_ttc :" 
    = f.input :cc_tot_discount_ttc, :label => "cc_tot_discount_ttc :" 
    = f.input :ac_tot_amount_af_discount_ht, :label => "ac_tot_amount_af_discount_ht :" 
    = f.input :cc_tot_amount_af_discount_ht, :label => "cc_tot_amount_af_discount_ht :" 
    = f.input :ac_tot_amount_af_discount_tva, :label => "ac_tot_amount_af_discount_tva :" 
    = f.input :cc_tot_amount_af_discount_tva, :label => "cc_tot_amount_af_discount_tva :" 
    = f.input :ac_tot_amount_af_discount_ttc, :label => "ac_tot_amount_af_discount_ttc :" 
    = f.input :cc_tot_amount_af_discount_ttc, :label => "cc_tot_amount_af_discount_ttc :" 
    = f.input :gen_discount_custom_percent, :label => "gen_discount_custom_percent :" 
    = f.input :gen_discount_custom_value, :label => "gen_discount_custom_value :" 
    = f.input :ac_gen_discount_percent, :label => "ac_gen_discount_percent :" 
    = f.input :cc_gen_discount_percent, :label => "cc_gen_discount_percent :" 
    = f.input :ac_tot_gen_discount_ht, :label => "ac_tot_gen_discount_ht :" 
    = f.input :cc_tot_gen_discount_ht, :label => "cc_tot_gen_discount_ht :" 
    = f.input :ac_tot_gen_discount_tva, :label => "ac_tot_gen_discount_tva :" 
    = f.input :cc_tot_gen_discount_tva, :label => "cc_tot_gen_discount_tva :" 
    = f.input :ac_tot_gen_discount_ttc, :label => "ac_tot_gen_discount_ttc :" 
    = f.input :cc_tot_gen_discount_ttc, :label => "cc_tot_gen_discount_ttc :" 
    = f.input :ac_tot_amount_ht, :label => "ac_tot_amount_ht :" 
    = f.input :cc_tot_amount_ht, :label => "cc_tot_amount_ht :" 
    = f.input :ac_tot_amount_tva, :label => "ac_tot_amount_tva :" 
    = f.input :cc_tot_amount_tva, :label => "cc_tot_amount_tva :" 
    = f.input :ac_tot_amount_ttc, :label => "ac_tot_amount_ttc :" 
    = f.input :cc_tot_amount_ttc, :label => "cc_tot_amount_ttc :" 
        
      
      