change print settings for cloud

This commit is contained in:
phyusin
2018-05-10 13:59:19 +06:30
parent d1baaaa78f
commit a2e7ef0e5a
5 changed files with 49 additions and 6 deletions

View File

@@ -12,7 +12,11 @@
<%= f.input :auto_print_receipt %>
<%= f.label "Select Zones", :class => 'control-label' %>
<%= f.collection_check_boxes :zone_ids , Zone.all, :id, :name , :class => 'checkbox form-group'%>
<%= f.input :printer_name, :as => :select, :collection => Printer::PrinterWorker.printers, include_blank: false %>
<% if(@server_mode != 'cloud') %>
<%= f.input :printer_name, :as => :select, :collection => Printer::PrinterWorker.printers, include_blank: false %>
<% else %>
<%= f.input :printer_name, :as => :select, :collection => [], include_blank: false %>
<% end %>
<%= f.input :font %>
<%= f.input :font_size %>
<%= f.input :show_tax %>
@@ -58,4 +62,20 @@
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
var serverMode = "<%= @server_mode %>";
if(serverMode == 'cloud'){
var printers = code2lab.getPrinters();
var printerInfo = JSON.parse([printers]);
var select = $("#cashier_terminal_printer_name");
$.each(printerInfo, function(key, value) {
$('#cashier_terminal_printer_name')
.append($("<option></option>")
.attr("value",value.target)
.text(value.deviceName));
});
}
});
</script>

View File

@@ -15,8 +15,11 @@ div.form-inputs span{
<div class="form-inputs p-l-15">
<%= f.input :station_name %>
<%= f.input :is_active %>
<%= f.input :printer_name, :as => :select, :collection => Printer::PrinterWorker.printers, include_blank: false %>
<% if(@server_mode != 'cloud') %>
<%= f.input :printer_name, :as => :select, :collection => Printer::PrinterWorker.printers, include_blank: false %>
<% else %>
<%= f.input :printer_name, :as => :select, :collection => [], include_blank: false %>
<% end %>
<!-- <%= f.input :font_size %> -->
<%= f.input :print_copy %>
<%= f.hidden_field :processing_items %>
@@ -63,4 +66,20 @@ div.form-inputs span{
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
var serverMode = "<%= @server_mode %>";
if(serverMode == 'cloud'){
var printers = code2lab.getPrinters();
var printerInfo = JSON.parse([printers]);
var select = $("#order_queue_station_printer_name");
$.each(printerInfo, function(key, value) {
$('#order_queue_station_printer_name')
.append($("<option></option>")
.attr("value",value.target)
.text(value.deviceName));
});
}
});
</script>