diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb
index e1b88f85..5f24494f 100755
--- a/app/views/origami/home/show.html.erb
+++ b/app/views/origami/home/show.html.erb
@@ -759,30 +759,41 @@
return false;
});
});
+
// Print for first bill
$("#first_bill").on('click', function () {
- var sale_id = $('#sale_id').val();
- var ajax_url = "/origami/sale/" + sale_id + "/first_bill";
- var server_mode =
- $.ajax({
- type: "GET",
- url: ajax_url,
- success: function (result) {
- receipt_no = ($("#receipt_no").html()).trim();
- if((receipt_no!=undefined) && (receipt_no!=""))
- createReceiptNoInFirstBillData(receipt_no,"");
+ 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) {
+ 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
- if ($("#server_mode").val() == "cloud") {
- code2lab.printFile(result.filepath.substr(6), result.printer_url);
- }
-
- // console.log(result);
- // code2lab.printBill(result.filepath, result.printer_model, result.printer_url);
- location.reload();
+ $.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();
}
- });
+ });
+ }
+ });
});
// click select option icon for add