Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -233,25 +233,23 @@ class Api::OrdersController < Api::ApiController
|
||||
printer = PrintSetting.all
|
||||
|
||||
unique_code="OrderItemPdf"
|
||||
if !order_slim_pdf.empty?
|
||||
if !printer.empty?
|
||||
printer.each do |printer_setting|
|
||||
if printer_setting.unique_code == 'OrderItemPdf'
|
||||
unique_code="OrderItemPdf"
|
||||
elsif printer_setting.unique_code == 'OrderItemSlimPdf'
|
||||
unique_code="OrderItemSlimPdf"
|
||||
elsif printer_setting.unique_code == 'OrderSetItemPdf'
|
||||
unique_code="OrderSetItemPdf"
|
||||
elsif printer_setting.unique_code == 'OrderItemSlimCustomisePdf'
|
||||
unique_code="OrderItemSlimCustomisePdf"
|
||||
elsif printer_setting.unique_code == 'OrderItemCustomisePdf'
|
||||
unique_code="OrderItemCustomisePdf"
|
||||
elsif printer_setting.unique_code == 'OrderSetItemCustomisePdf'
|
||||
unique_code="OrderSetItemCustomisePdf"
|
||||
end
|
||||
end
|
||||
if !printer.empty?
|
||||
printer.each do |printer_setting|
|
||||
if printer_setting.unique_code == 'OrderItemPdf'
|
||||
unique_code="OrderItemPdf"
|
||||
elsif printer_setting.unique_code == 'OrderItemSlimPdf'
|
||||
unique_code="OrderItemSlimPdf"
|
||||
elsif printer_setting.unique_code == 'OrderSetItemPdf'
|
||||
unique_code="OrderSetItemPdf"
|
||||
elsif printer_setting.unique_code == 'OrderItemSlimCustomisePdf'
|
||||
unique_code="OrderItemSlimCustomisePdf"
|
||||
elsif printer_setting.unique_code == 'OrderItemCustomisePdf'
|
||||
unique_code="OrderItemCustomisePdf"
|
||||
elsif printer_setting.unique_code == 'OrderSetItemCustomisePdf'
|
||||
unique_code="OrderSetItemCustomisePdf"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
||||
|
||||
@@ -211,7 +211,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<!-- <div class="card">
|
||||
<div class="card-header">
|
||||
<div><strong id="order-title">Promo Code</strong></div>
|
||||
</div>
|
||||
@@ -233,7 +233,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
@@ -432,6 +432,9 @@ var cashier_type = "<%= @cashier_type %>";
|
||||
// Pay Discount for Payment
|
||||
$("#pay-discount").on('click', function(e){
|
||||
e.preventDefault();
|
||||
if($('#pay-discount').is(":visible")) {
|
||||
$('#pay-discount').prop("disabled",true);
|
||||
}
|
||||
$("#loading_wrapper").show();
|
||||
var sale_id = $('#sale-id').text();
|
||||
var discount_items = JSON.stringify(get_discount_item_rows());
|
||||
|
||||
@@ -869,6 +869,10 @@
|
||||
|
||||
// Bill Request
|
||||
$('#request_bills').click(function () {
|
||||
if($('#request_bills').is(":visible")) {
|
||||
$('#request_bills').prop("disabled",true);
|
||||
}
|
||||
|
||||
var order_id = $('#save_order_id').attr('data-order');
|
||||
var ajax_url = "/origami/" + order_id + "/request_bills";
|
||||
$.ajax({
|
||||
@@ -893,8 +897,11 @@
|
||||
});
|
||||
|
||||
$('#move').on('click', function () {
|
||||
var dining_id = "<%= @dining.id %>";
|
||||
window.location.href = '/origami/table/' + dining_id + "/movetable";
|
||||
if($('#move').is(":visible")) {
|
||||
$('#move').prop("disabled",true);
|
||||
}
|
||||
var dining_id = "<%= @dining.id %>";
|
||||
window.location.href = '/origami/table/' + dining_id + "/movetable";
|
||||
})
|
||||
|
||||
$('#back').on('click', function () {
|
||||
|
||||
@@ -308,6 +308,9 @@ var cashier_type = "<%= @cashier_type %>";
|
||||
// Calculate Other Charges for Payment
|
||||
$("#charge_other").on('click', function(e){
|
||||
e.preventDefault();
|
||||
if($('#charge_other').is(":visible")) {
|
||||
$('#charge_other').prop("disabled",true);
|
||||
}
|
||||
var sale_id = $('#sale-id').text();
|
||||
var sub_total = $('#order-sub-total').text();
|
||||
var other_charges_items = JSON.stringify(get_other_item_rows());
|
||||
|
||||
@@ -468,7 +468,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="mr-2 m-t-5 btn-lg btn-block bg-red waves-effect print_receipt"> Print
|
||||
<button type="button" class="mr-2 m-t-5 btn-lg btn-block bg-red waves-effect print_receipt" id="print_receipt"> Print
|
||||
</button>
|
||||
<button type="button" class="btn-lg btn-block bg-blue waves-effect btn_pdf_close" data-dismiss="modal">
|
||||
CLOSE
|
||||
@@ -1045,11 +1045,16 @@ var pdf_view = '<%=@pdf_view%>';
|
||||
|
||||
//print pdf function
|
||||
// $(".print_receipt").on('click',function(){
|
||||
$(document).on('touchstart click', '.print_receipt', function(event){
|
||||
$("#print_receipt").on('click touchstart', function(event){
|
||||
$(this).off("click touchstart touchend");
|
||||
print_receipt();
|
||||
});
|
||||
|
||||
function print_receipt() {
|
||||
if($('#pay').is(":visible")) {
|
||||
$('#pay').prop("disabled",true);
|
||||
}
|
||||
|
||||
var sale_id = $('#sale_id').text();
|
||||
var filename = $("#filename").val();
|
||||
var printer_name = $("#printer_name").val();
|
||||
|
||||
@@ -870,6 +870,9 @@ $('#pay').on('click',function() {
|
||||
});
|
||||
// Bill Request
|
||||
$('#request_bills').click(function() {
|
||||
if($('#request_bills').is(":visible")) {
|
||||
$('#request_bills').prop("disabled",true);
|
||||
}
|
||||
var order_id = $('#save_order_id').attr('data-order');
|
||||
var ajax_url = "/origami/" + order_id + "/request_bills";
|
||||
$.ajax({
|
||||
@@ -894,6 +897,9 @@ $('#split_bills').click(function(){
|
||||
});
|
||||
|
||||
$('#move').on('click',function(){
|
||||
if($('#move').is(":visible")) {
|
||||
$('#move').prop("disabled",true);
|
||||
}
|
||||
var dining_id = "<%= @room.id %>"
|
||||
window.location.href = '/origami/table/'+ dining_id + "/moveroom";
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user