Merge branch 'august_spring' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Yan
2017-08-31 18:09:35 +06:30
8 changed files with 190 additions and 167 deletions

View File

@@ -39,7 +39,13 @@
<td><%= pro.promo_end_hour.utc.strftime("%I:%M %P") rescue "-" %></td>
<td><%= pro.promo_day %></td>
<td>
<%= MenuItem.find_by_item_code(pro.original_product).name rescue "-"%>
<% item = MenuItemInstance.find_by_item_instance_code(pro.original_product)%>
<% if item.nil? %>
<%= Product.find_by_item_code(pro.original_product).name rescue "-" %>
<% else %>
<%= item.menu_item.name rescue "-" %>
- <%= item.item_instance_name rescue "-" %>
<% end %>
</td>
<% if Employee.exists?(pro.created_by) %>
<td><%= Employee.find(pro.created_by).name %></td>

View File

@@ -10,7 +10,11 @@
<%= render 'form', promotion: @promotion %>
</div>
<script>
$("#promotion_promo_code").val(Math.random().toString(36).slice(5) + Math.random().toString(36).slice(5));
var r_id = Math.random().toString(36).slice(5);
if(r_id.length > 16){
r_id = r_id.substring(0, 15);
}
$("#promotion_promo_code").val(r_id);
// $( "#fromtime" ).timepicker();
// $( "#totime" ).timepicker({ 'scrollDefault': 'now' });
</script>