.qi_header .right -if false = link_to ic(:minus)+' Sortie de stock', new_admin_stock_movement_path(:movement_type => "deb"), :class => "btn btn-primary bgbd-documents", :remote => true = link_to ic(:plus)+' Entrée de stock', new_admin_stock_movement_path(:movement_type => "cred"), :class => "btn btn-primary bgbd-documents", :remote => true %h1 Résumé des stocks .qi_search_row =form_tag "", :method => "get", :onsubmit => "" do %table.qi_search_row_top %tr %td Produit : %td %input.form-control{:name => "p_product_ref", :class => "p_product_ref_autocomplete_input", :type => "text", :value => params[:p_product_ref]} = hidden_field_tag "p_product_ref_id".to_sym, params[:p_product_ref_id], :class => "p_product_ref_id" :javascript $( function() { $('.p_product_ref_autocomplete_input').autocomplete({ source: function( request, response ) { $.ajax( { url: "/admin/p_product_refs/autocomplete.json", dataType: "json", data: { search: request.term, //enabled: true, p_customer_id: $(".p_customer_id").val() }, success: function(data){ arr = jQuery.map( data, function( item ) { return { label: item.member_label, value: item.member_label, id: item.id } }); response(arr) } } ); }, minLength: 2, select: function( event, ui ) { $(this).next(".p_product_ref_id").val(ui.item.id) form = $(this).closest(".price_line_form") //return false } }); } ); %td Catégorie : %td =select_tag("search[p_product_cat_id]", options_for_select([["",""],["Aucune","null"]]+PProductCat.order(:name).all.map{|a| [a.name, a.id]}, params[:search][:p_product_cat_id]), {:class => 'form-control'}) =link_to ic(:search)+" Rechercher", "#", :class => "btn btn-default btn-qi-search", :onclick => "$(this).closest('form').submit();$(this).html('...');return false;" .clear .qi_pannel.padding.new_table_container / .table-slider / .inner /
.table-area .table-area-inner .freezeTable %table.table.table-striped.table-hover.table-bordered.data_table %thead.header %tr %th ID / %th Code %th Produit %th Variante %th Unités en stock -if false %th Unités sorties %th Sorties (€) %tbody -@p_product_refs.each do |p| -@line_stocks = LineStock.where(p_product_ref_id: p.id) %tr %td=p.id %td=p.name %td=p.ct_sub_name %td=@line_stocks.sum(:qte_available) -if false %td=@line_stocks.sum(:qte_used) %td=number_to_currency @line_stocks.sum(:cc_price_ht_used)