=semantic_form_for [:admin, @p_product_cat], :remote => true do |f|

  .content
    =f.inputs do
    
      = f.input :code, :label => "Code :" 
    
      = f.input :name, :label => "Nom :" 
      
      =# f.input :tva_rate_ids, :collection => TvaRate.order("accounting_zone_id ASC, rate ASC").all, :as => :check_boxes, :member_label => :member_label, :label => "Taux de TVA :"
      
      
      %input#p_product_tva_rate_ids_none{:name => "p_product_cat[tva_rate_ids][]", :type => "hidden", :value => ""}/
      
      %table{:style => "width:100%"}
        %tr
          -AccountingZone.all.each do |az|
            %td{:style => "vertical-align:top;"}
              .check_boxes.input.optional.form-group
                %label.control-label 
                  ="Taux de TVA (#{az.name}):"
              
              -TvaRate.where(:accounting_zone_id => az.id).order("rate ASC").all.each do |tr|
                .checkbox
                  %label.choice{:for => "p_product_cat_tva_rate_ids_#{tr.id}"}
                    %input#p_product_cat_tva_rate_ids{:id => tr.id, :checked => ("checked" if f.object.tva_rate_ids.include?(tr.id)), :name => "p_product_cat[tva_rate_ids][]", :type => "checkbox", :value => tr.id, :onchange => "$(this).closest('td').find('input').not(this).prop('checked', false); "}
                    =tr.member_label
      
      
      
      =# f.input :purchase_account, :label => "Compte achat :" 
      = f.input :sale_account, :label => "Compte vente :" 
      
     
  .actions=f.submit "sauvegarder", :class => "btn btn-primary"
  