First Bill Click Alert
This commit is contained in:
@@ -759,30 +759,41 @@
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Print for first bill
|
// Print for first bill
|
||||||
$("#first_bill").on('click', function () {
|
$("#first_bill").on('click', function () {
|
||||||
var sale_id = $('#sale_id').val();
|
|
||||||
var ajax_url = "/origami/sale/" + sale_id + "/first_bill";
|
|
||||||
var server_mode =
|
|
||||||
|
|
||||||
$.ajax({
|
swal({
|
||||||
type: "GET",
|
title: "Alert",
|
||||||
url: ajax_url,
|
text: "Are you sure want to print First Bill?",
|
||||||
success: function (result) {
|
type: "warning",
|
||||||
receipt_no = ($("#receipt_no").html()).trim();
|
showCancelButton: true,
|
||||||
if((receipt_no!=undefined) && (receipt_no!=""))
|
confirmButtonColor: "#DD6B55",
|
||||||
createReceiptNoInFirstBillData(receipt_no,"");
|
confirmButtonText: "Yes, print it!",
|
||||||
|
closeOnConfirm: false
|
||||||
|
}, function (isConfirm) {
|
||||||
|
if (isConfirm) {
|
||||||
|
var sale_id = $('#sale_id').val();
|
||||||
|
var ajax_url = "/origami/sale/" + sale_id + "/first_bill";
|
||||||
|
var server_mode =
|
||||||
|
|
||||||
// For Server Print - from jade
|
$.ajax({
|
||||||
if ($("#server_mode").val() == "cloud") {
|
type: "GET",
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
url: ajax_url,
|
||||||
}
|
success: function (result) {
|
||||||
|
receipt_no = ($("#receipt_no").html()).trim();
|
||||||
|
if((receipt_no!=undefined) && (receipt_no!=""))
|
||||||
|
createReceiptNoInFirstBillData(receipt_no,"");
|
||||||
|
|
||||||
// console.log(result);
|
// For Server Print - from jade
|
||||||
// code2lab.printBill(result.filepath, result.printer_model, result.printer_url);
|
if ($("#server_mode").val() == "cloud") {
|
||||||
location.reload();
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
|
}
|
||||||
|
location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// click select option icon for add
|
// click select option icon for add
|
||||||
|
|||||||
Reference in New Issue
Block a user