Commit d1dbca7c authored by Chanelle Lunod's avatar Chanelle Lunod

Initial commit

parent 7e168abf
......@@ -41,7 +41,6 @@
<% if trans.quantity == nil %>
<% trans.quantity == 0 %>
<% end %>
<% @supplies += trans.quantity %>
<% end %>
<% end %>
......@@ -50,16 +49,14 @@
<td>
<% @orders = 0 %>
<% product.transactions.each do |trans| %>
<% if trans.mode == "ORDER" %>
<% if trans.mode == "Order" %>
<% if trans.quantity == nil %>
<% transaction.quantity == 0 %>
<% trans.quantity == 0 %>
<% end %>
<% @orders += trans.quantity %>
<% end %>
<% end %>
<%= "(#{@orders.abs})" %>
<%= @orders %>
</td>
<td>
<% @total = 0 %>
......@@ -113,7 +110,6 @@
<th>Supply</th>
<th>Order</th>
<th>Total</th>
<th>Created At</th>
<th colspan="6"></th>
</thead>
<tbody>
......@@ -163,10 +159,15 @@
<%= @total %>
</td>
<td>
<%= link_to "Add Supply", new_product_supply_path(product), class: "btn btn-primary" %>
</td>
<td>
<%= link_to "Add Order", new_product_order_path(product), class: "btn btn-primary" %>
<% if product.status == "Active" %>
<td>
<%= link_to "Add Supply", new_product_supply_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>
</tr>
<% 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