Modified reprint color and click event
This commit is contained in:
@@ -174,7 +174,7 @@
|
|||||||
<% if @sale.sale_status != 'void' && @sale.sale_status != 'waste' && @sale.sale_status != 'spoile' %>
|
<% if @sale.sale_status != 'void' && @sale.sale_status != 'waste' && @sale.sale_status != 'spoile' %>
|
||||||
<% if current_user.role == "cashier" %>
|
<% if current_user.role == "cashier" %>
|
||||||
<a class="btn btn-block bg-red waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
|
<a class="btn btn-block bg-red waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
|
||||||
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="reprints"> Re.Print</a>
|
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="reprint"> Re.Print</a>
|
||||||
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<button type="button" class="btn bg-red btn-block" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void </button>
|
<button type="button" class="btn bg-red btn-block" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void </button>
|
||||||
@@ -257,21 +257,21 @@ $(document).ready(function(){
|
|||||||
var sale_id = $(this).attr("data-id");
|
var sale_id = $(this).attr("data-id");
|
||||||
window.location.href = '/origami/quick_service/completed_sale/' + sale_id;
|
window.location.href = '/origami/quick_service/completed_sale/' + sale_id;
|
||||||
})
|
})
|
||||||
// $('#reprint').on('click', function () {
|
$('#reprint').on('click', function () {
|
||||||
// var sale_id = $('#sale_id').val();
|
var sale_id = $('#sale_id').val();
|
||||||
// var ajax_url = '/origami/'+ sale_id + "/reprint"
|
var ajax_url = '/origami/'+ sale_id + "/reprint"
|
||||||
|
|
||||||
// $.ajax({
|
$.ajax({
|
||||||
// type: "GET",
|
type: "GET",
|
||||||
// url: ajax_url,
|
url: ajax_url,
|
||||||
// success: function (result) {
|
success: function (result) {
|
||||||
// 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();
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// });
|
});
|
||||||
$('#back').on('click', function () {
|
$('#back').on('click', function () {
|
||||||
window.location.href = '/origami/quick_service/pending_order';
|
window.location.href = '/origami/quick_service/pending_order';
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -258,10 +258,10 @@
|
|||||||
<% if @sale.sale_status != 'void' && @sale.sale_status != 'waste' && @sale.sale_status != 'spoile' %>
|
<% if @sale.sale_status != 'void' && @sale.sale_status != 'waste' && @sale.sale_status != 'spoile' %>
|
||||||
<% if current_login_employee.role == "cashier" %>
|
<% if current_login_employee.role == "cashier" %>
|
||||||
<a class="btn btn-block bg-danger waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
|
<a class="btn btn-block bg-danger waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
|
||||||
<a class="btn btn-block bg-red waves-effect access_modal" data-toggle="modal" data-type="reprint"> Re.Print</a>
|
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="reprint"> Re.Print</a>
|
||||||
<% else %>
|
<% else %>
|
||||||
<button type="button" id="void" class="btn bg-danger btn-block">VOID</button>
|
<button type="button" id="void" class="btn bg-danger btn-block">VOID</button>
|
||||||
<button type="button" id="re-print" class="btn bg-blue btn-block">Re.Print</button>
|
<button type="button" id="reprint" class="btn bg-blue btn-block">Re.Print</button>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% 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() {
|
$('#pay').on('click',function() {
|
||||||
var sale_id = $('#sale_id').val();
|
var sale_id = $('#sale_id').val();
|
||||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||||
|
|||||||
Reference in New Issue
Block a user