From dac1a58b646fcfafb52ee82066269b41a1c6ccd2 Mon Sep 17 00:00:00 2001 From: phyusin Date: Fri, 6 Apr 2018 10:45:14 +0630 Subject: [PATCH] print settings --- app/assets/stylesheets/origami.scss | 7 ++++++- app/models/print_setting.rb | 2 +- app/views/print_settings/_form.html.erb | 2 ++ db/migrate/20170628103624_create_print_settings.rb | 4 +++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/origami.scss b/app/assets/stylesheets/origami.scss index f882e526..792eb4bd 100755 --- a/app/assets/stylesheets/origami.scss +++ b/app/assets/stylesheets/origami.scss @@ -431,4 +431,9 @@ iframe { width: 150%; height: 100%; } -/* End iframe */ \ No newline at end of file +/* End iframe */ + +/* section class for webview */ +.section-margin { + +} \ No newline at end of file diff --git a/app/models/print_setting.rb b/app/models/print_setting.rb index a3cfc597..0760b59f 100755 --- a/app/models/print_setting.rb +++ b/app/models/print_setting.rb @@ -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") diff --git a/app/views/print_settings/_form.html.erb b/app/views/print_settings/_form.html.erb index bec1b931..4f88df50 100755 --- a/app/views/print_settings/_form.html.erb +++ b/app/views/print_settings/_form.html.erb @@ -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 %> diff --git a/db/migrate/20170628103624_create_print_settings.rb b/db/migrate/20170628103624_create_print_settings.rb index b95e4d2f..a5bb3000 100755 --- a/db/migrate/20170628103624_create_print_settings.rb +++ b/db/migrate/20170628103624_create_print_settings.rb @@ -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