diff --git a/app/views/origami/pending_order/completed_sale.html.erb b/app/views/origami/pending_order/completed_sale.html.erb
index 821414b3..1b7194f5 100644
--- a/app/views/origami/pending_order/completed_sale.html.erb
+++ b/app/views/origami/pending_order/completed_sale.html.erb
@@ -174,7 +174,7 @@
<% if @sale.sale_status != 'void' && @sale.sale_status != 'waste' && @sale.sale_status != 'spoile' %>
<% if current_user.role == "cashier" %>
Void
- Re.Print
+ Re.Print
<% else %>
@@ -257,21 +257,21 @@ $(document).ready(function(){
var sale_id = $(this).attr("data-id");
window.location.href = '/origami/quick_service/completed_sale/' + sale_id;
})
- // $('#reprint').on('click', function () {
- // var sale_id = $('#sale_id').val();
- // var ajax_url = '/origami/'+ sale_id + "/reprint"
+ $('#reprint').on('click', function () {
+ var sale_id = $('#sale_id').val();
+ var ajax_url = '/origami/'+ sale_id + "/reprint"
- // $.ajax({
- // type: "GET",
- // url: ajax_url,
- // success: function (result) {
- // if ($("#server_mode").val() == "cloud") {
- // code2lab.printFile(result.filepath.substr(6), result.printer_url);
- // }
- // location.reload();
- // }
- // });
- // });
+ $.ajax({
+ type: "GET",
+ url: ajax_url,
+ success: function (result) {
+ if ($("#server_mode").val() == "cloud") {
+ code2lab.printFile(result.filepath.substr(6), result.printer_url);
+ }
+ location.reload();
+ }
+ });
+ });
$('#back').on('click', function () {
window.location.href = '/origami/quick_service/pending_order';
});
diff --git a/app/views/origami/sales/show.html.erb b/app/views/origami/sales/show.html.erb
index 86b013af..9ca1cd72 100755
--- a/app/views/origami/sales/show.html.erb
+++ b/app/views/origami/sales/show.html.erb
@@ -258,10 +258,10 @@
<% if @sale.sale_status != 'void' && @sale.sale_status != 'waste' && @sale.sale_status != 'spoile' %>
<% if current_login_employee.role == "cashier" %>
Void
- Re.Print
+ Re.Print
<% else %>
-
+
<% end %>
<% end %>
@@ -369,6 +369,22 @@ $(document).ready(function(){
})
});
+$('#reprint').on('click', function () {
+ var sale_id = $('#sale_id').val();
+ var ajax_url = '/origami/'+ sale_id + "/reprint"
+
+ $.ajax({
+ type: "GET",
+ url: ajax_url,
+ success: function (result) {
+ if ($("#server_mode").val() == "cloud") {
+ code2lab.printFile(result.filepath.substr(6), result.printer_url);
+ }
+ location.reload();
+ }
+ });
+ });
+
$('#pay').on('click',function() {
var sale_id = $('#sale_id').val();
window.location.href = '/origami/sale/'+ sale_id + "/payment";