Commit d1dbca7c authored by Chanelle Lunod's avatar Chanelle Lunod

Initial commit

parent 7e168abf
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
<% if trans.quantity == nil %> <% if trans.quantity == nil %>
<% trans.quantity == 0 %> <% trans.quantity == 0 %>
<% end %> <% end %>
<% @supplies += trans.quantity %> <% @supplies += trans.quantity %>
<% end %> <% end %>
<% end %> <% end %>
...@@ -50,16 +49,14 @@ ...@@ -50,16 +49,14 @@
<td> <td>
<% @orders = 0 %> <% @orders = 0 %>
<% product.transactions.each do |trans| %> <% product.transactions.each do |trans| %>
<% if trans.mode == "ORDER" %> <% if trans.mode == "Order" %>
<% if trans.quantity == nil %> <% if trans.quantity == nil %>
<% transaction.quantity == 0 %> <% trans.quantity == 0 %>
<% end %> <% end %>
<% @orders += trans.quantity %> <% @orders += trans.quantity %>
<% end %> <% end %>
<% end %> <% end %>
<%= "(#{@orders.abs})" %> <%= @orders %>
</td> </td>
<td> <td>
<% @total = 0 %> <% @total = 0 %>
...@@ -113,7 +110,6 @@ ...@@ -113,7 +110,6 @@
<th>Supply</th> <th>Supply</th>
<th>Order</th> <th>Order</th>
<th>Total</th> <th>Total</th>
<th>Created At</th>
<th colspan="6"></th> <th colspan="6"></th>
</thead> </thead>
<tbody> <tbody>
...@@ -163,10 +159,15 @@ ...@@ -163,10 +159,15 @@
<%= @total %> <%= @total %>
</td> </td>
<td> <td>
<%= link_to "Add Supply", new_product_supply_path(product), class: "btn btn-primary" %> <% if product.status == "Active" %>
</td> <td>
<td> <%= link_to "Add Supply", new_product_supply_path(product), class: "btn btn-primary" %>
<%= link_to "Add Order", new_product_order_path(product), class: "btn btn-primary" %> </td>
<td>
<%= link_to "Add Order", new_product_order_path(product), class: "btn btn-primary" %>
</td>
<% else %>
<% end %>
</td> </td>
</tr> </tr>
<% end%> <% end%>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment