Cloud mode in reprint

This commit is contained in:
San Wai Lwin
2018-06-07 16:11:34 +06:30
parent af5b4cc9c8
commit 13e11bf777
3 changed files with 24 additions and 4 deletions

View File

@@ -18,6 +18,7 @@
<a class="nav-link" data-toggle="tab" href="#orders" role="tab">Orders</a>
</li>
</ul>
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
<!-- Nav tabs - End -->
<div id="custom-slimscroll">
<div class="tab-content">
@@ -423,8 +424,18 @@ $(document).on('click', '.access_modal', function(event){
$('#re-print').click(function() {
var sale_id = $('#sale_id').val();
window.location.href = '/origami/'+ sale_id + "/reprint"
var ajax_url = '/origami/'+ sale_id + "/reprint"
// return false;
$.ajax({
type: "GET",
url: ajax_url,
success: function (result) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
location.reload();
}
});
});
</script>