

=semantic_form_for [:public, @p_customer_sheet], :remote => false do |form|

  .addresses
    %p
      =link_to ic(:address_book)+" Gérer mes adresses", public_particulars_path
    .columns.span_6
      %h3
        =qit('billing-address', 'Adresse de facturation')

      -if @p_customer_sheet.p_customer
        =form.inputs do
          = form.input :particular_bill_id, :collection => @p_customer_sheet.p_customer.particulars.all, :as => :select, :member_label => :address_line, :include_blank => false, :label => =qit('billing-address')
      -else
        =form.inputs do
          = form.input :particular_bill_id, :collection => [], :as => :select, :include_blank => false, :label => "Adresse de facturation"
      -if @p_customer_sheet.particular_bill and @p_customer_sheet.particular_bill.errors.size > 0
        .alert.alert-danger
          Cette adresse n'est pas valide, veuillez la renseigner ou
          la compléter
          =link_to "la compléter", edit_public_particular_path(:id => @p_customer_sheet.particular_bill_id, :order => true)
          ou
          =link_to "en créer une nouvelle.", new_public_particular_path(:order => true)
    .columns.span_6
      %h3
        =qit('delivery-address', 'Adresse de livraison')
      -if @p_customer_sheet.p_customer
        =form.inputs do
          = form.input :particular_send_id, :collection => @p_customer_sheet.p_customer.particulars.all, :as => :select, :member_label => :address_line, :include_blank => false, :label => =qit('delivery-address')
      -else
        =form.inputs do
          = form.input :particular_send_id, :collection => [], :as => :select, :include_blank => false, :label => "Adresse de facturation"
      -if @p_customer_sheet.particular_send and @p_customer_sheet.particular_send.errors.size > 0
        .alert.alert-danger
          Cette adresse n'est pas valide, veuillez la renseigner ou
          la compléter
          =link_to "la compléter", edit_public_particular_path(:id => @p_customer_sheet.particular_bill_id, :order => true)
          ou
          =link_to "en créer une nouvelle.", new_public_particular_path(:order => true)

    .clear



    =form.input :p_payment_type_id, :label => "Mode de paiement :", :collection => PPaymentType.all, :as => :radio


    =form.submit qit('save', "Sauvegarder"), :class => "btn btn-primary"
