receipt bill order podf
This commit is contained in:
@@ -496,7 +496,7 @@ function callback_url(callback,ref_no,order_id,status,min_type,time,exptime,reas
|
||||
// data: {url: callback, ref_no: ref_no, status: status, waiting_time: waiting_time, min_type: type, reason: reject_reason},
|
||||
// dataType: "json",
|
||||
// success: function(data) {
|
||||
// if(data.status){
|
||||
// if(data.status){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
@@ -517,17 +517,30 @@ function callback_url(callback,ref_no,order_id,status,min_type,time,exptime,reas
|
||||
window.location.href = '/origami/order_reservation';
|
||||
});
|
||||
}else{
|
||||
|
||||
//PDF lightbox data
|
||||
var pdfPath = "/en/pdfjs/minimal?file=" + result.filename.substring(6);
|
||||
$("#sale_id").val(result.sale_id);
|
||||
$("#sale_receipt_no").val(result.receipt_no);
|
||||
$("#filename").val(result.filename);
|
||||
$("#printer_name").val(result.printer_name);
|
||||
$("#receipt_pdf").attr("src", pdfPath);
|
||||
if(result.filename){
|
||||
//PDF lightbox data
|
||||
var pdfPath = "/en/pdfjs/minimal?file=" + result.filename.substring(6);
|
||||
$("#sale_id").val(result.sale_id);
|
||||
$("#sale_receipt_no").val(result.receipt_no);
|
||||
$("#filename").val(result.filename);
|
||||
$("#printer_name").val(result.printer_name);
|
||||
$("#receipt_pdf").attr("src", pdfPath);
|
||||
|
||||
$("#receciptpdfModal").modal({show : true, backdrop : false, keyboard : false});
|
||||
$("#receiptpdfModalLabel").text("Receipt: " + result.receipt_no);
|
||||
$("#receiptpdfModal").modal({show : true, backdrop : false, keyboard : false});
|
||||
$("#receiptpdfModalLabel").text("Receipt: " + result.receipt_no);
|
||||
}else{
|
||||
swal({
|
||||
title: 'Information',
|
||||
text: "Order has been "+data.message,
|
||||
type: 'success',
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/order_reservation';
|
||||
});
|
||||
}
|
||||
}
|
||||
}else{
|
||||
swal({
|
||||
@@ -707,14 +720,24 @@ function print_receipt(){
|
||||
data: params,
|
||||
success:function(result){
|
||||
// For Server Print - from jade
|
||||
if ($("#server_mode").val() == "cloud") {
|
||||
if(typeof code2lab != 'undefined'){
|
||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||
}
|
||||
}
|
||||
else{
|
||||
payment_success_alert();
|
||||
if ($("#server_mode").val() == "cloud") {
|
||||
if(typeof code2lab != 'undefined'){
|
||||
code2lab.printFile(result.filepath.substr(6), result.printer_url);
|
||||
}
|
||||
}
|
||||
else{
|
||||
swal({
|
||||
title: "Print Success",
|
||||
text: "Complete Order",
|
||||
type: 'success',
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/order_reservation';
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user