Merge branch 'split_bill' of bitbucket.org:code2lab/sxrestaurant into quick_service
This commit is contained in:
@@ -123,6 +123,12 @@ class Origami::HomeController < BaseOrigamiController
|
|||||||
#for bank integration
|
#for bank integration
|
||||||
@checkout_time = Lookup.collection_of('checkout_time')
|
@checkout_time = Lookup.collection_of('checkout_time')
|
||||||
@checkout_alert_time = Lookup.collection_of('checkout_alert_time')
|
@checkout_alert_time = Lookup.collection_of('checkout_alert_time')
|
||||||
|
|
||||||
|
lookup_spit_bill = Lookup.collection_of('split_bill')
|
||||||
|
@split_bill = 0
|
||||||
|
if !lookup_spit_bill[0].nil?
|
||||||
|
@split_bill = lookup_spit_bill[0][1]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#Shop Name in Navbor
|
#Shop Name in Navbor
|
||||||
|
|||||||
@@ -93,10 +93,10 @@ class Origami::SurveysController < BaseOrigamiController
|
|||||||
if @type != "quick_service"
|
if @type != "quick_service"
|
||||||
dining_facility = DiningFacility.find(params[:dining_id])
|
dining_facility = DiningFacility.find(params[:dining_id])
|
||||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(dining_facility.zone_id)
|
cashier_zone = CashierTerminalByZone.find_by_zone_id(dining_facility.zone_id)
|
||||||
cashier_zone = cashier_zone.cashier_terminal_id
|
cashier_terminal_id = cashier_zone.cashier_terminal_id
|
||||||
else
|
else
|
||||||
shift = ShiftSale.find(sale.shift_sale_id)
|
shift = ShiftSale.find(sale.shift_sale_id)
|
||||||
cashier_zone = shift.cashier_terminal_id
|
cashier_terminal_id = shift.cashier_terminal_id
|
||||||
end
|
end
|
||||||
|
|
||||||
shift_by_terminal = ShiftSale.find_by_cashier_terminal_id_and_shift_closed_at(cashier_terminal_id,nil)
|
shift_by_terminal = ShiftSale.find_by_cashier_terminal_id_and_shift_closed_at(cashier_terminal_id,nil)
|
||||||
@@ -115,7 +115,7 @@ class Origami::SurveysController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
|
|
||||||
survey.receipt_no = params[:receipt_no]
|
survey.receipt_no = params[:receipt_no]
|
||||||
survey.shift_id = shift_by_terminal.id
|
survey.shift_id = shift_by_terminal.id
|
||||||
survey.created_by = current_user.name
|
survey.created_by = current_user.name
|
||||||
survey.total_customer = params[:total_customer]
|
survey.total_customer = params[:total_customer]
|
||||||
survey.total_amount = params[:total_amount]
|
survey.total_amount = params[:total_amount]
|
||||||
|
|||||||
@@ -517,7 +517,7 @@
|
|||||||
// window.location.href = '/origami/room/' + dining_id;
|
// window.location.href = '/origami/room/' + dining_id;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
window.location.href = '/origami/sale/' + split_sale_id + "/payment";
|
window.location.href = '/origami/sale/' + split_sale_id + "/cashier/payment";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -538,7 +538,7 @@
|
|||||||
// }else{
|
// }else{
|
||||||
// window.location.href = '/origami/room/' + dining_id;
|
// window.location.href = '/origami/room/' + dining_id;
|
||||||
// }
|
// }
|
||||||
window.location.href = '/origami/sale/' + split_sale_id + "/payment";
|
window.location.href = '/origami/sale/' + split_sale_id + "/cashier/payment";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,13 +73,13 @@
|
|||||||
<div class="hidden" id="newTemplate" >
|
<div class="hidden" id="newTemplate" >
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<%if !@dining_facility.nil?%>
|
<%if !@dining_facility.nil? %>
|
||||||
<input type="hidden" name="table_id" value="<%= @dining_facility.id %>">
|
<input type="hidden" name="table_id" id="table_id" value="<%= @dining_facility.id %>">
|
||||||
<input type="hidden" name="table_type" value="<%= @table_type %>">
|
<input type="hidden" name="table_type" id="table_type" value="<%= @table_type %>">
|
||||||
<%= f.input :dining_name, :as => :hidden, :input_html => { :value => @dining_facility.name } %>
|
<%= f.input :dining_name, :as => :hidden, :input_html => { :value => @dining_facility.name } %>
|
||||||
<%else%>
|
<%else%>
|
||||||
<input type="hidden" name="table_id" value="0">
|
<input type="hidden" name="table_id" id="table_id" value="0">
|
||||||
<input type="hidden" name="table_type" value="0">
|
<input type="hidden" name="table_type" id="table_type" value="0">
|
||||||
<%= f.input :dining_name, :as => :hidden, :input_html => { :value => 0 } %>
|
<%= f.input :dining_name, :as => :hidden, :input_html => { :value => 0 } %>
|
||||||
<%end%>
|
<%end%>
|
||||||
<input type="hidden" name="sale_id" value="<%=@id%>">
|
<input type="hidden" name="sale_id" value="<%=@id%>">
|
||||||
@@ -275,17 +275,17 @@ var cashier_type = "<%= @cashier_type %>";
|
|||||||
});
|
});
|
||||||
// click back button for redirect
|
// click back button for redirect
|
||||||
$('#back').on('click',function(){
|
$('#back').on('click',function(){
|
||||||
table_type = $('#table_type').val()
|
var table_type = $('#table_type').val();
|
||||||
table_id = $('#table_id').val()
|
var table_id = $('#table_id').val();
|
||||||
|
|
||||||
if (cashier_type == "quick_service") {
|
if (cashier_type == "quick_service") {
|
||||||
window.location.href = '/origami/sale/<%= @id %>/<%= @cashier_type %>/payment/';
|
window.location.href = '/origami/sale/<%= @id %>/<%= @cashier_type %>/payment/';
|
||||||
}else{
|
}else{
|
||||||
if(table_type == "Table"){
|
if(table_type == "Table"){
|
||||||
window.location.href = "/origami/table/" + table_id
|
window.location.href = "/origami/table/" + table_id;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
window.location.href = "/origami/room/" + table_id
|
window.location.href = "/origami/room/" + table_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user