update table box
This commit is contained in:
@@ -49,6 +49,8 @@ class Origami::CustomersController < BaseOrigamiController
|
|||||||
def add_customer
|
def add_customer
|
||||||
|
|
||||||
@sale_id = params[:sale_id]
|
@sale_id = params[:sale_id]
|
||||||
|
@cashier_type = params[:type]
|
||||||
|
|
||||||
if(@sale_id[0,3] == "SAL")
|
if(@sale_id[0,3] == "SAL")
|
||||||
@booking = Booking.find_by_sale_id(@sale_id)
|
@booking = Booking.find_by_sale_id(@sale_id)
|
||||||
@dining_facility = DiningFacility.find(@booking.dining_facility_id)
|
@dining_facility = DiningFacility.find(@booking.dining_facility_id)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ class Origami::DiscountsController < BaseOrigamiController
|
|||||||
#discount page show from origami index with selected order
|
#discount page show from origami index with selected order
|
||||||
def index
|
def index
|
||||||
sale_id = params[:id]
|
sale_id = params[:id]
|
||||||
|
@cashier_type = params[:type]
|
||||||
if Sale.exists?(sale_id)
|
if Sale.exists?(sale_id)
|
||||||
@sale_data = Sale.find(sale_id)
|
@sale_data = Sale.find(sale_id)
|
||||||
@table = DiningFacility.find(@sale_data.bookings[0].dining_facility_id)
|
@table = DiningFacility.find(@sale_data.bookings[0].dining_facility_id)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ class Origami::OtherChargesController < BaseOrigamiController
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
sale_id = params[:sale_id]
|
sale_id = params[:sale_id]
|
||||||
|
@cashier_type = params[:type]
|
||||||
if Sale.exists?(sale_id)
|
if Sale.exists?(sale_id)
|
||||||
@sale_data = Sale.find(sale_id)
|
@sale_data = Sale.find(sale_id)
|
||||||
@table = DiningFacility.find(@sale_data.bookings[0].dining_facility_id)
|
@table = DiningFacility.find(@sale_data.bookings[0].dining_facility_id)
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ class Origami::QuickServiceController < ApplicationController
|
|||||||
|
|
||||||
def index
|
def index
|
||||||
@menu = MenuCategory.all.active
|
@menu = MenuCategory.all.active
|
||||||
@dining = DiningFacility.all.active
|
@dining = DiningFacility.all.active
|
||||||
@customer = Customer.all
|
@customer = Customer.all
|
||||||
|
@tables = Table.all.active.order('status desc')
|
||||||
|
@rooms = Room.all.active.order('status desc')
|
||||||
# @tables = Table.all.active.order('zone_id asc').group("zone_id")
|
# @tables = Table.all.active.order('zone_id asc').group("zone_id")
|
||||||
# @rooms = Room.all.active.order('zone_id asc').group("zone_id")
|
# @rooms = Room.all.active.order('zone_id asc').group("zone_id")
|
||||||
# @all_table = Table.all.active.order('status desc')
|
# @all_table = Table.all.active.order('status desc')
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ class Origami::SaleEditController < BaseOrigamiController
|
|||||||
authorize_resource class: false
|
authorize_resource class: false
|
||||||
# Index for sale item void OR edit
|
# Index for sale item void OR edit
|
||||||
def edit
|
def edit
|
||||||
sale_id = params[:sale_id]
|
sale_id = params[:sale_id]
|
||||||
@table_id = params[:table_id]
|
@table_id = params[:table_id]
|
||||||
@saleobj = Sale.find(sale_id)
|
@cashier_type = params[:type]
|
||||||
|
@saleobj = Sale.find(sale_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
# create item void. make duplicate old record and update qty and price
|
# create item void. make duplicate old record and update qty and price
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ class Origami::SurveysController < BaseOrigamiController
|
|||||||
def new
|
def new
|
||||||
@survey = Survey.new
|
@survey = Survey.new
|
||||||
@id = params[:id]
|
@id = params[:id]
|
||||||
|
@cashier_type = params[:type]
|
||||||
|
|
||||||
if(@id[0,3] == "SAL")
|
if(@id[0,3] == "SAL")
|
||||||
@sale = Sale.find(@id)
|
@sale = Sale.find(@id)
|
||||||
@@ -20,8 +21,14 @@ class Origami::SurveysController < BaseOrigamiController
|
|||||||
|
|
||||||
def create
|
def create
|
||||||
@dining_facility = DiningFacility.find(params[:table_id])
|
@dining_facility = DiningFacility.find(params[:table_id])
|
||||||
@url = "/origami/"+@dining_facility.type.downcase+"/"+params[:table_id]
|
|
||||||
|
@type = params[:cashier_type]
|
||||||
|
@sale_id = params[:sale_id]
|
||||||
|
if @type == "quick_service"
|
||||||
|
@url = "/origami/sale/"+@sale_id+"/"+@type+"/payment"
|
||||||
|
else
|
||||||
|
@url = "/origami/"+@dining_facility.type.downcase+"/"+params[:table_id]
|
||||||
|
end
|
||||||
@survey = Survey.new(survey_params)
|
@survey = Survey.new(survey_params)
|
||||||
@survey.foreigner = params["survey"]["foreigner"].to_json
|
@survey.foreigner = params["survey"]["foreigner"].to_json
|
||||||
# respond_to do |format|
|
# respond_to do |format|
|
||||||
|
|||||||
@@ -75,12 +75,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- <div class="col-md-3">Table -</div> -->
|
<!-- <div class="col-md-3">Table -</div> -->
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select class="form-control m-t--5" id="table_id" name="table_id" >
|
<a class="btn btn-block bg-blue waves-effect" data-toggle="modal" data-target="#TableModal">Select Table</a>
|
||||||
<option value="">Select Table</option>
|
|
||||||
<% @dining.each do |table| %>
|
|
||||||
<option value="<%= table.id %>" data-type="<%=table.type%>"><%= table.name %></option>
|
|
||||||
<%end %>
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% else %>
|
<% else %>
|
||||||
@@ -120,7 +115,7 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<% if type %>
|
<% if type %>
|
||||||
<div class="row clearfix">
|
<div class="row clearfix hidden">
|
||||||
<div class="col-md-4 ">
|
<div class="col-md-4 ">
|
||||||
<strong id="order-title" class="font-14">Customer</strong>
|
<strong id="order-title" class="font-14">Customer</strong>
|
||||||
</div>
|
</div>
|
||||||
@@ -232,7 +227,6 @@
|
|||||||
<div class="col-md-7 item-detail">
|
<div class="col-md-7 item-detail">
|
||||||
<h5>Attributes</h5>
|
<h5>Attributes</h5>
|
||||||
<div class="attributes-list">
|
<div class="attributes-list">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<h5>Options</h5>
|
<h5>Options</h5>
|
||||||
@@ -246,11 +240,7 @@
|
|||||||
<div class="mr-auto">
|
<div class="mr-auto">
|
||||||
<h4 class=" pull-left">Total : <span id="total_price"></span></h4>
|
<h4 class=" pull-left">Total : <span id="total_price"></span></h4>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<button type="button" class="btn btn-default " data-dismiss="modal" id="close">Close</button>
|
<button type="button" class="btn btn-default " data-dismiss="modal" id="close">Close</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -333,4 +323,43 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="modal fade" id="TableModal" tabindex="-1" role="dialog">
|
||||||
|
<div class="modal-dialog" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 class="modal-title" id="TableModalLabel">Select Table</h4>
|
||||||
|
<button type="button" class="close" id="close" data-dismiss="modal" aria-hidden="true" style="font-size: 20px;color:#fff;">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<h5>Table</h5>
|
||||||
|
<div class="card-columns">
|
||||||
|
<% @tables.each do |table| %>
|
||||||
|
<div class="card tables text-white" data-id="<%= table.name %>">
|
||||||
|
<div class="card-block">
|
||||||
|
<%= table.name %>
|
||||||
|
<span class="float-right font-12"><%= table.name %></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<h5>Room</h5>
|
||||||
|
<div class="card-columns">
|
||||||
|
<% @rooms.each do |room| %>
|
||||||
|
<div class="card tables text-white" data-id="<%= room.name %>">
|
||||||
|
<div class="card-block">
|
||||||
|
<%= room.name %>
|
||||||
|
<span class="float-right font-12"><%= room.name %></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer p-r-30">
|
||||||
|
<button type="button" class="btn btn-link btn-danger waves-effect" data-dismiss="modal">CLOSE</button>
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-link bg-blue waves-effect choose_payment">SAVE</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -258,6 +258,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
var cashier_type = "<%= @cashier_type %>";
|
||||||
$(function() {
|
$(function() {
|
||||||
/*$('.datepicker').datepicker({
|
/*$('.datepicker').datepicker({
|
||||||
setDate: '12-12-1999',
|
setDate: '12-12-1999',
|
||||||
@@ -435,11 +436,16 @@
|
|||||||
{
|
{
|
||||||
var id = $("#table_id").val();
|
var id = $("#table_id").val();
|
||||||
var type = $("#type").val();
|
var type = $("#type").val();
|
||||||
if (type=="Table") {
|
if (cashier_type == "quick_service") {
|
||||||
window.location.href = '/origami/table/'+id
|
window.location.href = '/origami/table/'+id
|
||||||
|
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/payment/';
|
||||||
}else{
|
}else{
|
||||||
window.location.href = '/origami/room/'+id
|
if (type=="Table") {
|
||||||
}
|
window.location.href = '/origami/table/'+id
|
||||||
|
}else{
|
||||||
|
window.location.href = '/origami/room/'+id
|
||||||
|
}
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
swal("Alert!", "Record not found!", "error");
|
swal("Alert!", "Record not found!", "error");
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|||||||
@@ -225,18 +225,22 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
var cashier_type = "<%= @cashier_type %>";
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
$('#back').on('click',function(){
|
$('#back').on('click',function(){
|
||||||
var id = $("#table_id").text();
|
var id = $("#table_id").text();
|
||||||
var type = $("#table_type").text();
|
var type = $("#table_type").text();
|
||||||
console.log(id);
|
var sale_id = $('#sale-id').text();
|
||||||
console.log(type);
|
if (cashier_type=="quick_service") {
|
||||||
if (type=="Table") {
|
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/payment/';
|
||||||
window.location.href = '/origami/table/'+id
|
|
||||||
}else{
|
}else{
|
||||||
window.location.href = '/origami/room/'+id
|
if (type=="Table") {
|
||||||
}
|
window.location.href = '/origami/table/'+id
|
||||||
|
}else{
|
||||||
|
window.location.href = '/origami/room/'+id
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
$(".cashier_number").on('click', function(event){
|
$(".cashier_number").on('click', function(event){
|
||||||
@@ -404,11 +408,15 @@
|
|||||||
title: "Information!",
|
title: "Information!",
|
||||||
text: result.status,
|
text: result.status,
|
||||||
}, function () {
|
}, function () {
|
||||||
if(result.table_type == "Table"){
|
if (cashier_type=="quick_service") {
|
||||||
window.location.href = "/origami/table/" + result.table_id
|
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/payment/';
|
||||||
}
|
}else{
|
||||||
else {
|
if(result.table_type == "Table"){
|
||||||
window.location.href = "/origami/room/" + result.table_id
|
window.location.href = "/origami/table/" + result.table_id
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
window.location.href = "/origami/room/" + result.table_id
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -451,12 +459,16 @@
|
|||||||
text: result.status,
|
text: result.status,
|
||||||
type: "success",
|
type: "success",
|
||||||
}, function () {
|
}, function () {
|
||||||
if(result.table_type == "Table"){
|
if (cashier_type=="quick_service") {
|
||||||
window.location.href = "/origami/table/" + result.table_id
|
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/payment/';
|
||||||
}
|
}else{
|
||||||
else {
|
if(result.table_type == "Table"){
|
||||||
window.location.href = "/origami/room/" + result.table_id
|
window.location.href = "/origami/table/" + result.table_id
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
window.location.href = "/origami/room/" + result.table_id
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -474,12 +486,16 @@
|
|||||||
text: result.status,
|
text: result.status,
|
||||||
type: "success",
|
type: "success",
|
||||||
}, function () {
|
}, function () {
|
||||||
if(result.table_type == "Table"){
|
if (cashier_type=="quick_service") {
|
||||||
window.location.href = "/origami/table/" + result.table_id
|
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/payment/';
|
||||||
}
|
}else{
|
||||||
else {
|
if(result.table_type == "Table"){
|
||||||
window.location.href = "/origami/room/" + result.table_id
|
window.location.href = "/origami/table/" + result.table_id
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
window.location.href = "/origami/room/" + result.table_id
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -519,12 +535,16 @@
|
|||||||
confirmButtonText: 'OK',
|
confirmButtonText: 'OK',
|
||||||
confirmButtonColor: btn_color,
|
confirmButtonColor: btn_color,
|
||||||
}, function () {
|
}, function () {
|
||||||
if(result.table_type == "Table"){
|
if (cashier_type=="quick_service") {
|
||||||
window.location.href = "/origami/table/" + result.table_id
|
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/payment/';
|
||||||
}
|
}else{
|
||||||
else {
|
if(result.table_type == "Table"){
|
||||||
window.location.href = "/origami/room/" + result.table_id
|
window.location.href = "/origami/table/" + result.table_id
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
window.location.href = "/origami/room/" + result.table_id
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -467,6 +467,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
|
cashier_type = "cashier"
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
/* start check first bill or not*/
|
/* start check first bill or not*/
|
||||||
var receipt_no = "";
|
var receipt_no = "";
|
||||||
@@ -547,7 +548,7 @@
|
|||||||
}
|
}
|
||||||
var table_id = $('.tables').attr("data-id");
|
var table_id = $('.tables').attr("data-id");
|
||||||
|
|
||||||
window.location.href = '/origami/' + sale_id + "/customers"
|
window.location.href = '/origami/' + sale_id+"/"+cashier_type + "/customers"
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -568,7 +569,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sale_id != "") {
|
if (sale_id != "") {
|
||||||
window.location.href = '/origami/' + sale_id + '/other_charges'
|
window.location.href = '/origami/' + sale_id + "/"+cashier_type+ '/other_charges'
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
swal ( "Oops" , "Please select an table!" , "warning" );
|
swal ( "Oops" , "Please select an table!" , "warning" );
|
||||||
@@ -589,7 +590,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sale_id != "") {
|
if (sale_id != "") {
|
||||||
window.location.href = '/origami/' + sale_id + '/discount'
|
window.location.href = '/origami/' + sale_id+ "/"+cashier_type+'/discount'
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
swal ( "Oops" , "Please select an table!" , "warning" );
|
swal ( "Oops" , "Please select an table!" , "warning" );
|
||||||
@@ -758,7 +759,7 @@
|
|||||||
var dining_id = "<%= @dining.id %>"
|
var dining_id = "<%= @dining.id %>"
|
||||||
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
||||||
if ($(this).attr('active')=== "true") {
|
if ($(this).attr('active')=== "true") {
|
||||||
window.location.href = '/origami/table/' + dining_id + "/sale/" + sale_id + "/edit";
|
window.location.href = '/origami/table/' + dining_id + "/sale/" + sale_id + "/"+cashier_type +"/edit";
|
||||||
}else{
|
}else{
|
||||||
swal("Opps","You are not authorized for void","warning")
|
swal("Opps","You are not authorized for void","warning")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,6 +204,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
var cashier_type = "<%= @cashier_type %>";
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$(".cashier_number").on('click', function(event){
|
$(".cashier_number").on('click', function(event){
|
||||||
if(event.handled !== true) {
|
if(event.handled !== true) {
|
||||||
@@ -313,12 +315,16 @@
|
|||||||
title: "Information!",
|
title: "Information!",
|
||||||
text: "Success",
|
text: "Success",
|
||||||
}, function () {
|
}, function () {
|
||||||
if(result.table_type == "Table"){
|
if (cashier_type=="quick_service") {
|
||||||
window.location.href = "/origami/table/" + result.table_id
|
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/payment/';
|
||||||
}
|
}else{
|
||||||
else {
|
if(result.table_type == "Table"){
|
||||||
window.location.href = "/origami/room/" + result.table_id
|
window.location.href = "/origami/table/" + result.table_id
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
window.location.href = "/origami/room/" + result.table_id
|
||||||
|
}
|
||||||
|
}s
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -297,7 +297,7 @@
|
|||||||
<button type="button" class="btn bg-red btn-block" id="void" active="<%= can? :overall_void, :void %>"> Void </button>
|
<button type="button" class="btn bg-red btn-block" id="void" active="<%= can? :overall_void, :void %>"> Void </button>
|
||||||
<% if @cashier_type=="quick_service" %>
|
<% if @cashier_type=="quick_service" %>
|
||||||
<hr>
|
<hr>
|
||||||
<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>
|
|
||||||
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect"><%= t("views.right_panel.detail.survey") %></button>
|
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect"><%= t("views.right_panel.detail.survey") %></button>
|
||||||
<button type="button" id="customer" class="btn btn-block bg-blue waves-effect" >Customer</button>
|
<button type="button" id="customer" class="btn btn-block bg-blue waves-effect" >Customer</button>
|
||||||
<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" class="btn btn-block bg-blue waves-effect" id='edit' <%= (can? :edit, :sale_edit)? ' ': 'disabled=' %> active="true">Edit</button>
|
||||||
@@ -383,7 +383,7 @@ var cashier_type = "<%= @cashier_type %>";
|
|||||||
var sale_id = $('#save_order_id').attr('data-order');
|
var sale_id = $('#save_order_id').attr('data-order');
|
||||||
}
|
}
|
||||||
var table_id = $('.tables').attr("data-id");
|
var table_id = $('.tables').attr("data-id");
|
||||||
window.location.href = '/origami/' + sale_id + "/customers"
|
window.location.href = '/origami/' + sale_id + "/"+cashier_type+"/customers"
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add Other Charges
|
// Add Other Charges
|
||||||
@@ -395,7 +395,7 @@ var cashier_type = "<%= @cashier_type %>";
|
|||||||
var sale_id = $('#save_order_id').attr('data-order');
|
var sale_id = $('#save_order_id').attr('data-order');
|
||||||
}
|
}
|
||||||
if (sale_id != "") {
|
if (sale_id != "") {
|
||||||
window.location.href = '/origami/' + sale_id + '/other_charges'
|
window.location.href = '/origami/' + sale_id +"/"+cashier_type+ '/other_charges'
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
swal ( "Oops" , "Please select an table!" , "warning" );
|
swal ( "Oops" , "Please select an table!" , "warning" );
|
||||||
@@ -413,7 +413,7 @@ var cashier_type = "<%= @cashier_type %>";
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sale_id != "") {
|
if (sale_id != "") {
|
||||||
window.location.href = '/origami/' + sale_id + '/discount'
|
window.location.href = '/origami/' + sale_id + "/"+cashier_type+'/discount'
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
swal ( "Oops" , "Please select an table!" , "warning" );
|
swal ( "Oops" , "Please select an table!" , "warning" );
|
||||||
@@ -426,9 +426,9 @@ var cashier_type = "<%= @cashier_type %>";
|
|||||||
|
|
||||||
$('#edit').on('click', function () {
|
$('#edit').on('click', function () {
|
||||||
var dining_id = "<%= @dining.id %>"
|
var dining_id = "<%= @dining.id %>"
|
||||||
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
var sale_id = $('#sale_id').text();
|
||||||
if ($(this).attr('active')=== "true") {
|
if ($(this).attr('active')=== "true") {
|
||||||
window.location.href = '/origami/table/' + dining_id + "/sale/" + sale_id + "/edit";
|
window.location.href = '/origami/table/' + dining_id + "/sale/" + sale_id + "/"+cashier_type+"/edit";
|
||||||
}else{
|
}else{
|
||||||
swal("Opps","You are not authorized for void","warning")
|
swal("Opps","You are not authorized for void","warning")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,15 +128,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
|
var cashier_type = "<%= @cashier_type %>";
|
||||||
// Bill Request
|
// Bill Request
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
$(".update").on('click', function () {
|
$(".update").on('click', function () {
|
||||||
var sale_item_id = $(this).attr('data-id');
|
var sale_item_id = $(this).attr('data-id');
|
||||||
var qty = $('#' + sale_item_id + "_qty").val();
|
var qty = $('#' + sale_item_id + "_qty").val();
|
||||||
var price = $('#' + sale_item_id + "_price").val();
|
var price = $('#' + sale_item_id + "_price").val();
|
||||||
console.log(qty + "|" + price)
|
console.log(qty + "|" + price)
|
||||||
var ajax_url = "/origami/item_edit";
|
var ajax_url = "/origami/item_edit";
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
@@ -196,7 +197,12 @@
|
|||||||
|
|
||||||
$('#back').on('click', function () {
|
$('#back').on('click', function () {
|
||||||
var table_id = '<%= @table_id %>'
|
var table_id = '<%= @table_id %>'
|
||||||
window.location.href = '/origami/table/' + table_id;
|
var sale_id = "<%= @saleobj.sale_id %>"
|
||||||
|
if (cashier_type=="quick_service") {
|
||||||
|
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/payment/';
|
||||||
|
}else{
|
||||||
|
window.location.href = '/origami/table/' + table_id;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#cancel_all_void').on('click', function () {
|
$('#cancel_all_void').on('click', function () {
|
||||||
@@ -221,7 +227,12 @@
|
|||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
data: 'sale_id=' + sale_id,
|
data: 'sale_id=' + sale_id,
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
window.location.href = '/origami/table/' + table_id;
|
if (cashier_type=="quick_service") {
|
||||||
|
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/payment/';
|
||||||
|
}else{
|
||||||
|
window.location.href = '/origami/table/' + table_id;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -42,6 +42,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="hidden" name="table_id" value="<%=@dining_facility.id%>">
|
<input type="hidden" name="table_id" value="<%=@dining_facility.id%>">
|
||||||
|
<input type="hidden" name="sale_id" value="<%=@id%>">
|
||||||
|
<input type="hidden" name="cashier_type" value="<%=@cashier_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 } %>
|
||||||
<%= f.input :created_by, :as => :hidden, :input_html => { :value => current_login_employee.name } %>
|
<%= f.input :created_by, :as => :hidden, :input_html => { :value => current_login_employee.name } %>
|
||||||
<%= f.input :receipt_no, :as => :hidden, :input_html => { :value => @receipt_no} %>
|
<%= f.input :receipt_no, :as => :hidden, :input_html => { :value => @receipt_no} %>
|
||||||
@@ -145,6 +147,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
var cashier_type = "<%= @cashier_type %>";
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
//click add button for new row
|
//click add button for new row
|
||||||
$('#addForeigner').on('click',function(){
|
$('#addForeigner').on('click',function(){
|
||||||
@@ -223,17 +226,21 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// click back button for redirect
|
// click back button for redirect
|
||||||
$('#back').on('click',function(){
|
$('#back').on('click',function(){
|
||||||
table_type = '<%=@table_type%>';
|
table_type = '<%=@table_type%>';
|
||||||
table_id = '<%=@dining_facility.id%>';
|
table_id = '<%=@dining_facility.id%>';
|
||||||
|
|
||||||
|
if (cashier_type == "quick_service") {
|
||||||
|
window.location.href = '/origami/sale/<%= @id %>/<%= @cashier_type %>/payment/';
|
||||||
|
}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
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ scope "(:locale)", locale: /en|mm/ do
|
|||||||
resources :customers #add customer type
|
resources :customers #add customer type
|
||||||
end
|
end
|
||||||
post 'moving' => "movetable#moving"
|
post 'moving' => "movetable#moving"
|
||||||
get "/table/:table_id/sale/:sale_id/edit" => "sale_edit#edit"
|
get "/table/:table_id/sale/:sale_id/:type/edit" => "sale_edit#edit"
|
||||||
post 'item_void' => "sale_edit#item_void"
|
post 'item_void' => "sale_edit#item_void"
|
||||||
post 'item_foc' => "sale_edit#item_foc"
|
post 'item_foc' => "sale_edit#item_foc"
|
||||||
post 'item_edit' => "sale_edit#item_edit"
|
post 'item_edit' => "sale_edit#item_edit"
|
||||||
@@ -124,11 +124,11 @@ scope "(:locale)", locale: /en|mm/ do
|
|||||||
# post '/:booking_id' => 'home#item_show'
|
# post '/:booking_id' => 'home#item_show'
|
||||||
|
|
||||||
# Other Charges
|
# Other Charges
|
||||||
get "/:sale_id/other_charges" => "other_charges#index"
|
get "/:sale_id/:type/other_charges" => "other_charges#index"
|
||||||
post "/:sale_id/other_charges" => "other_charges#create"
|
post "/:sale_id/other_charges" => "other_charges#create"
|
||||||
|
|
||||||
# Discount
|
# Discount
|
||||||
get "/:id/discount" => "discounts#index"
|
get "/:id/:type/discount" => "discounts#index"
|
||||||
post "/:id/discount" => "discounts#create"
|
post "/:id/discount" => "discounts#create"
|
||||||
get "/:id/remove_all_discount" => "discounts#remove_all_discount"
|
get "/:id/remove_all_discount" => "discounts#remove_all_discount"
|
||||||
post "/:id/remove_discount_items" => "discounts#remove_discount_items"
|
post "/:id/remove_discount_items" => "discounts#remove_discount_items"
|
||||||
@@ -191,9 +191,9 @@ scope "(:locale)", locale: /en|mm/ do
|
|||||||
|
|
||||||
#---------Add Customer --------------#
|
#---------Add Customer --------------#
|
||||||
#resources :customers
|
#resources :customers
|
||||||
get '/:sale_id/customers', to: "customers#add_customer"
|
get '/:sale_id/:type/customers', to: "customers#add_customer"
|
||||||
get '/:customer_id/get_customer' => 'home#get_customer', :as => "show_customer_details"
|
get '/:customer_id/get_customer' => 'home#get_customer', :as => "show_customer_details"
|
||||||
post '/:sale_id/update_sale', to: "customers#update_sale_by_customer" # update customer id in sale table
|
post '/:sale_id/:type/update_sale', to: "customers#update_sale_by_customer" # update customer id in sale table
|
||||||
|
|
||||||
post '/:sale_id/get_customer' => "customers#get_customer"
|
post '/:sale_id/get_customer' => "customers#get_customer"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user