inventorymaster 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/inventorymaster/products.js +4 -0
- data/app/controllers/inventorymaster/products_controller.rb +15 -3
- data/app/models/inventorymaster/product.rb +1 -0
- data/app/views/inventorymaster/products/index.html.erb +37 -8
- data/app/views/inventorymaster/products/show.html.erb +4 -5
- data/config/routes.rb +11 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40cccffa7646893ddd398a1afaa35a7456d8c08e
|
4
|
+
data.tar.gz: 22043dec86c0c22a835d646d0cd2d7132b5f9237
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 559902a0fa2b2e43b5390b6fd69129d7b6cb93973d3edec959d72affd9ce3481443aa8274cfd25a59620fc262073edd50b656912bbbb6dbaec61fbba33cb1479
|
7
|
+
data.tar.gz: b1016ab24d98624094a5e7c607e2ad3a3d4645d6fe95c6c7dbe99478da64f4ddbe70a9fecc003e17ed30633182860ff32b78836a35b7199092214ea8216d3cc6
|
@@ -5,10 +5,18 @@ module Inventorymaster
|
|
5
5
|
before_action :set_product, only: [:show, :edit, :update, :destroy]
|
6
6
|
#autocomplete Inventorymaster::Product, :name
|
7
7
|
# GET /products
|
8
|
-
def index
|
9
|
-
|
10
|
-
|
8
|
+
#def index
|
9
|
+
#@products = Product.all.page(params[:page]).order(:name)
|
10
|
+
# @product = Product.new
|
11
|
+
# end
|
12
|
+
|
13
|
+
def index
|
14
|
+
if params[:query].present?
|
15
|
+
@products = Product.search(params[:query], page: params[:page])
|
16
|
+
else
|
17
|
+
@products = Product.all.page params[:page]
|
11
18
|
end
|
19
|
+
end
|
12
20
|
|
13
21
|
# GET /products/1
|
14
22
|
def show
|
@@ -69,6 +77,10 @@ module Inventorymaster
|
|
69
77
|
redirect_to products_url, notice: 'Product was successfully destroyed.'
|
70
78
|
end
|
71
79
|
|
80
|
+
def autocomplete
|
81
|
+
render json: Product.search(params[:query], autocomplete: true, limit: 10).map(&:name)
|
82
|
+
end
|
83
|
+
|
72
84
|
private
|
73
85
|
# Use callbacks to share common setup or constraints between actions.
|
74
86
|
def set_product
|
@@ -1,6 +1,33 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
|
2
|
+
<div class="container">
|
3
|
+
<div class="row">
|
4
|
+
<%= form_tag products_path, :class=> "form-inline", method: :get do%>
|
5
|
+
<div class="col-md-12">
|
6
|
+
<div class="input-group" id="adv-search">
|
7
|
+
<div class="input-group-btn">
|
8
|
+
<div class="btn-group" role="group">
|
9
|
+
<% if params[:query].present?%>
|
10
|
+
<%= link_to "limpar", products_path, :class=> "btn btn-default"%>
|
11
|
+
<%end%>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
<%= text_field_tag :query, params[:query], :class=> "form-control", :id=> "product_search", :autocomplete=> "off"%>
|
15
|
+
<div class="input-group-btn">
|
16
|
+
<div class="btn-group" role="group">
|
17
|
+
<%= submit_tag "Pesquisar", :class=> "btn btn-primary"%>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
</div>
|
3
24
|
</div>
|
25
|
+
<%end%>
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
4
31
|
|
5
32
|
|
6
33
|
|
@@ -13,10 +40,10 @@
|
|
13
40
|
<tr>
|
14
41
|
<th>Nome</th>
|
15
42
|
<th>SKU</th>
|
16
|
-
<th
|
17
|
-
<th>Area</th>
|
43
|
+
<th>Área</th>
|
18
44
|
<th>Fabricante</th>
|
19
|
-
<th>
|
45
|
+
<th>EM</th>
|
46
|
+
<th>EA</th>
|
20
47
|
<th colspan="3"></th>
|
21
48
|
</tr>
|
22
49
|
</thead>
|
@@ -38,11 +65,11 @@
|
|
38
65
|
<%end%>
|
39
66
|
|
40
67
|
<td><%= product.name %></td>
|
41
|
-
<td
|
42
|
-
<td><%if product.upc.present?%><%= product.upc %><%else%>-<%end%></td>
|
68
|
+
<td><%if product.sku.present?%><%= product.sku %><%else%>-<%end%></td>
|
43
69
|
<td><%= product.area.name unless product.area.nil? %></td>
|
44
70
|
<td><%= product.manufacturer.name unless product.manufacturer.nil?%></td>
|
45
|
-
<td><%= product.minimum_stock_count %></td>
|
71
|
+
<td><span class="label label-warning"><%= product.minimum_stock_count %></span></td>
|
72
|
+
<td><span class="label label-primary"><%= product.ammount %></span></td>
|
46
73
|
<td><%= link_to 'Detalhar', product ,:class=>"btn btn-xs btn-default"%></td>
|
47
74
|
<td><%= link_to 'Editar', edit_product_path(product) ,:class=>"btn btn-xs btn-warning"%></td>
|
48
75
|
<td><%= link_to 'Deletar', product, method: :delete, data: { confirm: 'Voce tem Certeza?' },:class=>"btn btn-xs btn-danger" %></td>
|
@@ -53,3 +80,5 @@
|
|
53
80
|
<br>
|
54
81
|
<center><%= paginate @products %></center>
|
55
82
|
|
83
|
+
<span class="label label-warning">EM - Estoque Mínimo</span>
|
84
|
+
<span class="label label-primary">EA - Estoque Atual</span>
|
@@ -3,16 +3,16 @@
|
|
3
3
|
<%= hidden_field_tag 'product_id',nil,:value => @product.id%>
|
4
4
|
<%= hidden_field_tag 'kind',nil,:value => "Entrada"%>
|
5
5
|
<%= submit_tag("+ Entrada", :class => 'btn btn-small btn-success') %>
|
6
|
-
<% end %>
|
6
|
+
<% end %>
|
7
7
|
|
8
8
|
<%= form_tag({:controller=>'transactions',:action=>'new'}, {:method => :get}) do %>
|
9
9
|
<%= hidden_field_tag 'product_id',nil,:value => @product.id%>
|
10
10
|
<%= hidden_field_tag 'kind',nil,:value => "Saida"%>
|
11
11
|
<%= submit_tag("+ Saida", :class => 'btn btn-small btn-danger') %>
|
12
|
-
<% end %>
|
12
|
+
<% end %>
|
13
13
|
<p>
|
14
14
|
<strong>Quantidade em Estoque:</strong>
|
15
|
-
|
15
|
+
<span class="label label-primary"><%= @product.ammount %></span>
|
16
16
|
</p>
|
17
17
|
<p>
|
18
18
|
<strong>Nome:</strong>
|
@@ -61,7 +61,6 @@
|
|
61
61
|
<tr>
|
62
62
|
<td>Tipo</td>
|
63
63
|
<td>Data</td>
|
64
|
-
<td>Localização</td>
|
65
64
|
<td>Usuário</td>
|
66
65
|
<td>UPC</td>
|
67
66
|
<td>Custo Unitario</td>
|
@@ -82,7 +81,7 @@
|
|
82
81
|
<td><%=transaction.average_cost%></td>
|
83
82
|
<td><%=transaction.reason%></td>
|
84
83
|
</tr>
|
85
|
-
|
84
|
+
|
86
85
|
<%end%>
|
87
86
|
</table>
|
88
87
|
|
data/config/routes.rb
CHANGED
@@ -4,9 +4,9 @@ Inventorymaster::Engine.routes.draw do
|
|
4
4
|
get ':transactions/:id', to: 'transactions#new', on: :member
|
5
5
|
end
|
6
6
|
|
7
|
-
resources :products do
|
8
|
-
get :autocomplete_product_name, :on => :collection
|
9
|
-
end
|
7
|
+
#resources :products do
|
8
|
+
#get :autocomplete_product_name, :on => :collection
|
9
|
+
#end
|
10
10
|
resources :settings
|
11
11
|
resources :manufacturers
|
12
12
|
resources :areas
|
@@ -15,4 +15,12 @@ end
|
|
15
15
|
#get '/transactions/new/:id' =>'transactions#new'
|
16
16
|
|
17
17
|
|
18
|
+
|
19
|
+
resources :products do
|
20
|
+
collection do
|
21
|
+
post :import
|
22
|
+
get :autocomplete # <= add this line
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
18
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inventorymaster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jcottobboni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: searchkick
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -226,7 +226,7 @@ files:
|
|
226
226
|
- test/models/inventorymaster/transaction_test.rb
|
227
227
|
- test/models/inventorymaster/transaction_type_test.rb
|
228
228
|
- test/test_helper.rb
|
229
|
-
homepage:
|
229
|
+
homepage: https://github.com/jcottobboni/inventorymaster
|
230
230
|
licenses:
|
231
231
|
- MIT
|
232
232
|
metadata: {}
|