<%= notice %>


<% @promotions.each do |pro| %> <% if Employee.exists?(pro.created_by) %> <% else %> <% end %> <% end %>
Promotion Code Start Date End Date Start Time End Time Promotion Day Original Product Created By Created At
<%= link_to pro.promo_code, settings_promotion_path(pro) %> <%= pro.promo_start_date %> <%= pro.promo_end_date %> <%= pro.promo_start_hour.utc.strftime("%I:%M %P") rescue "-" %> <%= pro.promo_end_hour.utc.strftime("%I:%M %P") rescue "-" %> <%= pro.promo_day %> <%= MenuItem.find_by_item_code(pro.original_product).name rescue "-"%> <%= Employee.find(pro.created_by).name %><%= pro.created_by %><%= pro.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %> <%= link_to 'Edit', edit_settings_promotion_path(pro) %> <%= link_to 'Destroy', settings_promotion_path(pro), method: :delete, data: { confirm: 'Are you sure?' } %>