This repository has been archived on 2021-11-24. You can view files and clone it, but cannot push or open issues or pull requests.
phone_app/app/views/admin/line_stocks/stock_resume.html.haml
2021-11-18 17:47:00 +01:00

111 lines
3.8 KiB
Plaintext

.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
/ <form class="range-field">
/ <input type="range" min="0" max="100" step="0.1" class="range" value="0" />
/ </form>
.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)