-
-
Notifications
You must be signed in to change notification settings - Fork 584
Expand file tree
/
Copy pathshow.html.erb
More file actions
172 lines (169 loc) · 5.43 KB
/
Copy pathshow.html.erb
File metadata and controls
172 lines (169 loc) · 5.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<% content_for :title, "Items - #{@item.name} - Inventory - #{current_organization.name}" %>
<h1>
Item Information
<small>for <%= @item.name %></small>
</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><%= link_to(dashboard_path) do %>
<i class="fa fa-dashboard"></i> Home
<% end %>
</li>
<li class="breadcrumb-item"><%= link_to "All Item Types", items_path %></li>
<li class="breadcrumb-item"><a href="#"><%= @item.name %></a></li>
</ol>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<!-- Default box -->
<div class="card">
<div class="card-body p-0">
<table class="table">
<tbody>
<tr>
<th>Base Item</th>
<td><%= @item.base_item.name %></td>
</tr>
<tr>
<th>Name</th>
<td><%= @item.name %></td>
</tr>
<tr>
<th>Category</th>
<td><%= @item&.item_category&.name %></td>
</tr>
<tr>
<th>Value Per Item</th>
<td>$<%= @item.value_in_dollars || 0 %></td>
</tr>
<tr>
<th>Quantity per Individual</th>
<td><%= @item.distribution_quantity || 0 %></td>
</tr>
<tr>
<th>On hand minimum quantity</th>
<td><%= @item.on_hand_minimum_quantity || 0 %></td>
</tr>
<tr>
<th>On hand recommended quantity</th>
<td><%= @item.on_hand_recommended_quantity || 0 %></td>
</tr>
<tr>
<th>Package Size</th>
<td><%= @item.package_size || 0 %></td>
</tr>
<tr>
<th>Custom Units</th>
<% item_units = @item.request_units&.pluck("item_units.name") %>
<td><%= item_units&.join("; ") %></td>
</tr>
<tr>
<th>Item is visible to partners</th>
<td><%= @item.visible_to_partners ? 'Yes' : 'No' %></td>
</tr>
<tr>
<th>Additional Information (Bank Use Only)</th>
<td><%= @item.additional_info %></td>
</tr>
</tbody>
</table>
</div>
<!-- /.card-body -->
<!-- /.card-footer-->
</div>
<!-- /.card -->
</div>
</div>
</div>
</section>
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<!-- Default box -->
<div class="card card-info">
<div class="card-header">
<h2 class="card-title">This Item Is Contained In These Inventories</h2>
</div>
<div class="card-body p-0">
<% if @storage_locations_containing.present? %>
<h4></h4>
<table class="table">
<thead>
<tr>
<th>Storage location</th>
<th>Quantity</th>
</tr>
</thead>
<tbody>
<% total = 0; @storage_locations_containing.each do |storage|
location_quantity = if @inventory
@inventory.quantity_for(item_id: @item.id, storage_location: storage.id)
else
storage.item_total(@item)
end
total += location_quantity %>
<tr>
<td><%= link_to storage.name, storage_location_path(storage) %></td>
<td class="text-left"><%= location_quantity %></td>
</tr>
<% end %>
<tr>
<td class="text-left">Total</td>
<td class="text-left"><%= total %></td>
</tr>
</tbody>
</table>
<% end %>
</div>
<!-- /.card-footer-->
</div>
<!-- /.card -->
</div>
</div>
</div>
</section>
<% if @barcodes_for.present? %>
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<!-- Default box -->
<div class="card card-primary">
<div class="card-header">
<h2 class="card-title">Barcodes Associated With This Item</h2>
</div>
<div class="card-body p-0">
<table class="table">
<thead>
<tr>
<th>Barcode value</th>
<th>Quantity</th>
</tr>
</thead>
<tbody>
<% @barcodes_for.each do |barcode_item| %>
<tr>
<td><%= link_to barcode_item.value, barcode_item_path(barcode_item) %></td>
<td><%= barcode_item.quantity %></td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
</div>
</div>
</div>
</div>
</div>
</section>