print settings

This commit is contained in:
phyusin
2018-04-06 10:45:14 +06:30
parent 55e2a06422
commit dac1a58b64
4 changed files with 12 additions and 3 deletions

View File

@@ -431,4 +431,9 @@ iframe {
width: 150%;
height: 100%;
}
/* End iframe */
/* End iframe */
/* section class for webview */
.section-margin {
}

View File

@@ -1,6 +1,6 @@
class PrintSetting < ApplicationRecord
# validations
validates_presence_of :name, :unique_code, :printer_name, :brand_name, :api_settings, :page_width, :page_height, :print_copies
validates_presence_of :name, :unique_code, :printer_name, :brand_name, :api_settings, :page_width, :page_height, :print_copies, :header_font_size, :item_font_size
def self.get_precision_delimiter
PrintSetting.find_by_unique_code("ReceiptBillPdf")

View File

@@ -11,6 +11,8 @@
<%= f.input :unique_code %>
<%= f.input :template %>
<%= f.input :font %>
<%= f.input :header_font_size %>
<%= f.input :item_font_size %>
<%= f.input :printer_name, :as => :select, :collection => Printer::PrinterWorker.printers, include_blank: false %>
<%= f.input :brand_name %>
<%= f.input :printer_type %>

View File

@@ -4,7 +4,9 @@ class CreatePrintSettings < ActiveRecord::Migration[5.1]
t.string :name, :null => false
t.string :unique_code, :null => false
t.string :template
t.string :font, :default => ""
t.string :font, :default => ""
t.integer :header_font_size, :null => false, :default => 11
t.integer :item_font_size, :null => false, :default => 9
t.string :printer_name, :null => false
t.string :api_settings
t.string :brand_name