add link for oqs in origami

This commit is contained in:
phyusin
2018-02-22 18:51:57 +06:30
parent 8d03fab703
commit 7cbb67fd30
20 changed files with 257 additions and 109 deletions

View File

@@ -288,19 +288,39 @@
sub_total = sub_total + (order_item.price * order_item.qty)
# unless order_item.price == 0 %>
<tr>
<td><%= count %></td>
<td class='item-name'>
<%= order_item.item_name %>
<% if !order_item.set_menu_items.nil?
order_item.set_menu_items.each do |item_instance| %>
<br><span class="font-13"><%= item_instance %></span>
<% end
end %>
</td>
<td class='item-attr'><%= order_item.qty %></td>
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
</tr>
<% if !@assigned_order_items.nil? %>
<% @assigned_order_items.each do |assigned_order_item| %>
<% if assigned_order_item.include? (order_item.order_items_id) %>
<tr class="edit_order" data-id='<%= assigned_order_item[order_item.order_items_id] %>'>
<td><%= count %></td>
<td class='item-name'>
<%= order_item.item_name %>
<% if !order_item.set_menu_items.nil?
order_item.set_menu_items.each do |item_instance| %>
<br><span class="font-13"><%= item_instance %></span>
<% end
end %>
</td>
<td class='item-attr'><%= order_item.qty %></td>
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
</tr>
<% end %>
<% end %>
<% else %>
<tr>
<td><%= count %></td>
<td class='item-name'>
<%= order_item.item_name %>
<% if !order_item.set_menu_items.nil?
order_item.set_menu_items.each do |item_instance| %>
<br><span class="font-13"><%= item_instance %></span>
<% end
end %>
</td>
<td class='item-attr'><%= order_item.qty %></td>
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
</tr>
<% end %>
<%
# end
@@ -427,7 +447,6 @@
<%= t("views.btn.back") %>
</button>
<button type="button" id="add_order" class="btn btn-block bg-blue waves-effect"><%= t("views.btn.add") %> <%= t("views.right_panel.detail.order") %></button>
<% if current_login_employee.role != "waiter" %>
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect"><%= t("views.right_panel.detail.survey") %></button>
<% if @dining.status != "available" %>
<% if @status_order == 'order' && @status_sale != 'sale' %>
@@ -447,18 +466,23 @@
<!-- <button type="button" class="btn btn-block bg-blue waves-effect" disabled> Void</button> -->
<% end %>
<% if @status_sale == 'sale' %>
<% if current_login_employee.role != "waiter" %>
<button type="button" id="commissions" class="btn btn-block bg-blue waves-effect">Commissions</button>
<button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button>
<% end %>
<button type="button" id="customer" class="btn btn-block bg-blue waves-effect">Customer</button>
<% if current_login_employee.role != "waiter" %>
<button type="button" class="btn btn-block bg-blue waves-effect" id='edit' <%= (can? :edit, :sale_edit)? ' ': 'disabled=' %> active="true">Edit</button>
<button type="button" id="void" class="btn btn-block bg-blue waves-effect" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> active="true"> Void</button>
<button type="button" id="discount" class="btn btn-block bg-blue waves-effect" <%= (can? :index, :discount)? ' ': 'disabled=' %> active="true">Discount</button>
<button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect">Charges</button>
<% end %>
<% if !@split_bill.nil? %>
<% if @split_bill == '1' %>
<button type="button" id="split_bills" class="btn btn-block bg-blue waves-effect">Split Bill</button>
<% end %>
<% end %>
<% if current_login_employee.role != "waiter" %>
<!-- first bill not used in cloud -->
<% if ENV["SERVER_MODE"] == "cloud" %>
<button type="button" id="first_bill" class="btn btn-block bg-blue waves-effect">First Bill</button>
@@ -471,6 +495,7 @@
<% end %>
<button type="button" id="pay" class="btn btn-block bg-blue waves-effect">Pay</button>
<% end %>
<% end %>
<!-- Cashier Buttons -->
<!-- <button type="button" id="re-print" class="btn btn-block bg-blue waves-effect" >Re.Print</button> -->
@@ -508,7 +533,6 @@
</div>
</div>
</div>
<% end %>
</div>
</div>
</div>
@@ -897,4 +921,13 @@
}
});
});
/*edit order in oqs*/
$('.edit_order').on('click',function(){
var assigned_order_item_id = $(this).attr('data-id');
var dining_id = "<%= @dining.id %>";
if((assigned_order_item_id!=undefined) && (assigned_order_item_id!='')){
window.location.href = '/oqs/'+ assigned_order_item_id + "/edit/"+dining_id;
}
});
</script>