print settings ActionCable

This commit is contained in:
Thein Lin Kyaw
2020-08-18 16:11:17 +06:30
parent 583d7ee473
commit 5dfdc7353e
25 changed files with 1050 additions and 802 deletions

View File

@@ -280,7 +280,7 @@
</div>
</div>
</div>
<%= print_settings %>
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
<span class="hidden" id="member_discount"><%= @membership.discount%></span>
<span class="hidden" id="membership_id"><%= @sale.customer.membership_id rescue 0%></span>
@@ -405,10 +405,12 @@
url: ajax_url,
data: "remark="+ remark + "&sale_id=" + sale_id+ "&access_code=" + access_code,
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);
if (!$('#print_settings').data('action-cable')) {
// For Server Print - from jade
if ($("#server_mode").val() == "cloud") {
if(typeof code2lab != 'undefined'){
code2lab.printFile(result.filepath.substr(6), result.printer_url);
}
}
}
window.location.href = '/transactions/sales/';