

.qi_header
  .right
    =raw @p_ship_tour.state_html
  %h1
    Tournées
    %span
      Tournée du 
      =l @p_ship_tour.start_at, :format => :date


=semantic_form_for [:admin, @p_ship_tour], :url => ship_return_save_admin_p_ship_tour_path(@p_ship_tour), :html => {:method => :post} , :remote => false, :data => {:confirm => "Attention, une fois validée les données ne pourront plus être modifiées."} do |f|
  =#f.input :code

  =f.inputs do
  
  
    =f.semantic_fields_for :p_ship_tour_trucks do |p_ship_tour_truck|
      -if !p_ship_tour_truck.object.p_truck.remorque
        .qi_row
          .qi_pannel.qi_plain.padding
      
            %h3
              =p_ship_tour_truck.object.p_truck.name
       
            =#p_ship_tour_truck.input :p_truck_id
            =#form.input :comment
            =p_ship_tour_truck.semantic_fields_for :p_volucompteurs do |p_volucompteur|
      
              %table{:style => "width:100%;"}
                %tr
                  %td
                    =p_volucompteur.hidden_field :p_truck_id
             
                    =p_volucompteur.input :start_vol, :label => "Volume départ :"
                  %td
            
                    =p_volucompteur.input :end_vol, :label => "Volume arrivé :"
                    
            
              
              -if p_volucompteur.object.write_why
                %table{:style => "width:100%;"}
                  %tr
                    %td
                      %p
                        Delta :
                        %strong=p_volucompteur.object.delta_calc_ok
                      
                    %td
            
                      =p_volucompteur.input :delta_cause, :label => "Explication du delta :", :input_html => {:rows => 2}
            
            
            =p_ship_tour_truck.semantic_fields_for :p_ship_tour_truck_sheet_lines do |p_ship_tour_truck_sheet_line|
              %hr
              %table{:style => "width:100%;"}
                %tr
                  %td
                    =render p_ship_tour_truck_sheet_line.object.p_sheet_line
                  %td{:style => "width:200px"}
                    -p_ship_tour_truck_sheet_line.object.to_return = true
                    =p_ship_tour_truck_sheet_line.hidden_field :to_return
            
                    =p_ship_tour_truck_sheet_line.input :qte_shiped, :label => "Quantitée livrée :"
                  %td{:style => "padding-left:10px;width:200px"}
                    %br
                    =p_ship_tour_truck_sheet_line.input :canceled, :label => "livraison annulée ?"
                  %td
                    =p_ship_tour_truck_sheet_line.input :raison, :label => "Raison", :input_html => {:rows => 2}
                  

                
                  
  .qi_row
    .qi_pannel.qi_plain.padding{:style => "padding:30px 20px;text-align:center"}

      =f.submit "sauvegarder", :class => "btn btn-primary"
      
      

:scss
  table{
    td{
      vertical-align:top;
    }
  }