first bill for table invoice
This commit is contained in:
@@ -322,25 +322,62 @@ $(document).ready(function(){
|
|||||||
// });
|
// });
|
||||||
|
|
||||||
// Print for first bill
|
// Print for first bill
|
||||||
$("#first_bill").on('click', function () {
|
// $("#first_bill").on('click', function () {
|
||||||
var sale_id = '<%= @sale.id %>';
|
// var sale_id = '<%= @sale.id %>';
|
||||||
var ajax_url = "/origami/sale/" + sale_id + "/first_bill";
|
// 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",
|
type: "GET",
|
||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
receipt_no = ($("#receipt_no").html()).trim();
|
receipt_no = ($("#receipt_no").html()).trim();
|
||||||
if((receipt_no!=undefined) && (receipt_no!=""))
|
if((receipt_no!=undefined) && (receipt_no!=""))
|
||||||
createReceiptNoInFirstBillData(receipt_no,"");
|
createReceiptNoInFirstBillData(receipt_no,"");
|
||||||
|
|
||||||
// For Server Print - from jade
|
// For Server Print - from jade
|
||||||
if ($("#server_mode").val() == "cloud") {
|
if ($("#server_mode").val() == "cloud") {
|
||||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||||
}
|
}
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$(".choose_payment").on('click', function () {
|
$(".choose_payment").on('click', function () {
|
||||||
$( "#loading_wrapper").show();
|
$( "#loading_wrapper").show();
|
||||||
|
|||||||
Reference in New Issue
Block a user