first bill for table invoice

This commit is contained in:
Aung Myo
2018-08-30 10:53:19 +06:30
parent bf5d7cfd7a
commit 21c3e0c0dc

View File

@@ -322,25 +322,62 @@ $(document).ready(function(){
// });
// Print for first bill
$("#first_bill").on('click', function () {
var sale_id = '<%= @sale.id %>';
var ajax_url = "/origami/sale/" + sale_id + "/first_bill";
// $("#first_bill").on('click', function () {
// var sale_id = '<%= @sale.id %>';
// var ajax_url = "/origami/sale/" + sale_id + "/first_bill";
$.ajax({
// $.ajax({
// type: "GET",
// url: ajax_url,
// success: function (result) {
// receipt_no = ($("#receipt_no").html()).trim();
// if((receipt_no!=undefined) && (receipt_no!=""))
// createReceiptNoInFirstBillData(receipt_no,"");
// // For Server Print - from jade
// if ($("#server_mode").val() == "cloud") {
// code2lab.printFile(result.filepath.substr(6), result.printer_url);
// }
// location.reload();
// }
// });
// });
// Print for first bill
$("#first_bill").on('click', function () {
swal({
title: "Alert",
text: "Are you sure want to print First Bill?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, print it!",
closeOnConfirm: false
}, function (isConfirm) {
$('.confirm').off("click touchstart touchend");
$('.confirm').attr("disabled","disabled");
if (isConfirm) {
var sale_id = '<%= @sale.id %>';
var ajax_url = "/origami/sale/" + sale_id + "/first_bill";
$.ajax({
type: "GET",
url: ajax_url,
success: function (result) {
receipt_no = ($("#receipt_no").html()).trim();
if((receipt_no!=undefined) && (receipt_no!=""))
createReceiptNoInFirstBillData(receipt_no,"");
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
location.reload();
}
});
});
}
});
}
});
});
$(".choose_payment").on('click', function () {
$( "#loading_wrapper").show();