- | <%= result.sale_id rescue '-' %> |
- <%= result.sale_item_id rescue '-' %> |
- <%= result.commissioner.name rescue '-' %> |
- <%= result.commission.menu_item.name rescue '-' %> |
- <%= sprintf "%.2f", result.qty.to_f.to_d rescue '-' %> |
- <%= sprintf "%.2f", result.price.to_f.to_d rescue '-' %> |
- <%= sprintf "%.2f", result.amount.to_f.to_d rescue '-' %> |
- <%= result.updated_at.strftime("%e %b %Y %I:%M%p") rescue '-' %> |
+ <%= result.stock_check.reason rescue '-' %> |
+ <%= Employee.find(result.stock_check.check_by).name rescue '-' %> |
+
+ <% menu_item = MenuItemInstance.find_by_item_instance_code(result.item_code)%>
+ <% if menu_item.nil? %>
+ <%= Product.find_by_item_code(result.item_code).name rescue "-" %>
+ <% else %>
+ <%= menu_item.menu_item.name rescue "-" %>
+ - <%= menu_item.item_instance_name rescue "-" %>
+ <% end %>
+ |
+ <%= result.stock_count rescue '-' %> |
+ <%= result.stock_balance rescue '-' %> |
+ <%= result.different rescue '-' %> |
+ <%= result.remark rescue '-' %> |
+ <%= result.created_at.strftime('%e %b %Y %I:%M %p') rescue '-' %> |
- <% total_qty += result.qty.to_f %>
- <% total_price += result.price.to_f %>
- <% total_amount += result.amount.to_f %>
+ <% !result.stock_count.nil? ? total_stock_count += result.stock_count : total_stock_count += 0 %>
+ <% !result.stock_balance.nil? ? total_stock_balance += result.stock_balance : total_stock_balance += 0 %>
+ <% !result.different.nil? ? total_different += result.different : total_different += 0 %>
<% end %>
- |
- <%= sprintf("%.2f", total_qty) rescue '-' %> |
- <%= sprintf("%.2f", total_price) rescue '-' %> |
- <%= sprintf("%.2f", total_amount) rescue '-' %> |
- |
+ |
+ <%= total_stock_count rescue '-' %> |
+ <%= total_stock_balance rescue '-' %> |
+ <%= total_different rescue '-' %> |
+ |