SQA feedback

This commit is contained in:
phyusin
2018-03-19 09:17:12 +06:30
parent 7524ab75ad
commit e55ff8b5e0
4 changed files with 26 additions and 10 deletions

4
app/views/oqs/edit/index.html.erb Executable file → Normal file
View File

@@ -112,6 +112,8 @@ $(document).ready(function(){
var remarks = $("textarea[name='remarks']").val();
var order_items_id = $(this).attr('data-id');
var params = { 'order_items_id': order_items_id, 'qty_weight': qty_weight, 'remarks': remarks }
var booking_id = '<%= @booking.booking_id %>';
$.ajax({
type: 'POST',
url: '/oqs/' + order_items_id,
@@ -121,6 +123,8 @@ $(document).ready(function(){
<% if !@link_type.nil? %>
<% if @link_type == 'oqs' %>
window.location.href = '/oqs';
<% elsif @link_type == 'pending' %>
window.location.href = '/origami/quick_service/pending_order/'+booking_id;
<% else %>
<% if !@dining_type.nil? %>
<% if @dining_type == 'Table' %>

10
app/views/origami/pending_order/show.html.erb Executable file → Normal file
View File

@@ -100,7 +100,7 @@
@order_items.each do |order_item|
sub_total = sub_total + order_item.price %>
<input type="hidden" id="sale_id" value="<%= @bookings.booking_id %>">
<tr>
<tr class="edit_order" data-id='<%= order_item.order_items_id %>'>
<td class='item-name'><%= order_item.item_name %></td>
<td class='item-attr'><%= order_item.qty %></td>
<td class='item-attr'><%= order_item.price %></td>
@@ -289,5 +289,13 @@ $(document).ready(function(){
window.location.href = linkURL;
});
}
/*edit order in oqs*/
$('.edit_order').on('click',function(){
var assigned_order_item_id = $(this).attr('data-id');
if((assigned_order_item_id!=undefined) && (assigned_order_item_id!='')){
window.location.href = '/oqs/'+ assigned_order_item_id + "/edit/pending";
}
});
});
</script>

5
app/views/origami/split_bill/index.html.erb Executable file → Normal file
View File

@@ -60,7 +60,7 @@
<% if order_item.include? ('all_order') %>
<% order_item['all_order'].each do |odr_item| %>
<%
order_item_count = order_item_count.to_i + 1
order_item_count = order_item_count.to_i + 1
sub_total += odr_item['qty'].to_f * odr_item['price'].to_f
%>
<tr class="item-row" id=<%= odr_item['order_items_id'] %> >
@@ -389,7 +389,6 @@
$('#order_item_split').on('click',function () {
var cnt_order_item = "<%= order_item_count %>";
var order_items = get_selected_order_items();// Selected Order Items
var cnt_items = parseInt(cnt_order_item) - parseInt(order_items.length);
if (order_items.length > 0){
// if(cnt_items > 0){
@@ -425,6 +424,7 @@
$.each(orders, function(key,value){
if($("a[href$='#"+value.order_id+"']").parent().hasClass('selected-split-item')){
$("a[href$='#"+value.order_id+"']").parent().removeClass('selected-split-item');
$(".item-row").removeClass('selected-split-item');
}
});
}
@@ -623,6 +623,7 @@ function orderItemSplitBillProcess(cnt_items){
if(cnt_items == 0){
booking_id = json_booking.booking_id;
}
console.log(booking_id);
var order_ids = [];
var arr_order_ids = [];