diff --git a/app/controllers/print_settings_controller.rb b/app/controllers/print_settings_controller.rb index 8efb9dd5..5bf654ef 100644 --- a/app/controllers/print_settings_controller.rb +++ b/app/controllers/print_settings_controller.rb @@ -70,6 +70,6 @@ class PrintSettingsController < ApplicationController # Never trust parameters from the scary internet, only allow the white list through. def print_setting_params - params.require(:print_setting).permit(:name, :unique_code, :template, :db_name, :db_type, :db_username, :db_password, :printer_name, :api_settings, :page_width, :page_height, :print_copies,:precision,:delimiter,:heading_space) + params.require(:print_setting).permit(:name, :unique_code, :template, :printer_name, :api_settings, :page_width, :page_height, :print_copies,:precision,:delimiter,:heading_space) end end diff --git a/app/models/ability.rb b/app/models/ability.rb index 1938fb45..444795dd 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -41,8 +41,8 @@ class Ability can :index, :void_sale can :get_customer, Customer - can :add_customer, Customer - can :update_sale_by_customer, Customer + can :add_customer, Customer + can :update_sale_by_customer, Customer can :index, :other_charge can :create, :other_charge @@ -57,7 +57,7 @@ class Ability can :reprint, :payment can :rounding_adj, :payment - can :move_dining, :movetable + can :move_dining, :movetable can :moving, :movetable can :move_dining, :moveroom @@ -71,14 +71,14 @@ class Ability can :overall_void, :void elsif user.role == "cashier" - + # can :overall_void, :void can :read, Order can :update, Order - - can :read, Sale - can :update, Sale + + can :read, Sale + can :update, Sale can :get_customer, Customer can :add_customer, Customer can :update_sale_by_customer, Customer @@ -97,7 +97,7 @@ class Ability can :reprint, :payment can :rounding_adj, :payment - can :move_dining, :movetable + can :move_dining, :movetable can :moving, :movetable can :move_dining, :moveroom @@ -108,7 +108,7 @@ class Ability can :reprint, :payment can :manage, DiningQueue - + elsif user.role == "account" can :index, :dailysale @@ -128,6 +128,13 @@ class Ability can :apply_void, :sale_edit can :overall_void, :void + can :first_bill, :payment + can :citem_edit, :sale_edit + can :item_void_cancel, :sale_edit + can :cancel_all_void, :sale_edit + can :apply_void, :sale_edit + can :overall_void, :void + can :first_bill, :payment can :create, :payment can :show, :payment diff --git a/app/pdf/close_cashier_pdf.rb b/app/pdf/close_cashier_pdf.rb index 4eadf007..133d9c48 100644 --- a/app/pdf/close_cashier_pdf.rb +++ b/app/pdf/close_cashier_pdf.rb @@ -1,8 +1,8 @@ class CloseCashierPdf < Prawn::Document attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width,:text_width def initialize(printer_settings, shift_sale,shop_details,sale_taxes) - self.page_width = 210 - self.page_height = 7000 + self.page_width = PrintSetting.where("name = ?","Close Cashier").first.page_width + self.page_height = PrintSetting.where("name = ?","Close Cashier").first.page_height self.margin = 5 self.price_width = 40 self.qty_width = 20 diff --git a/app/pdf/crm_order_pdf.rb b/app/pdf/crm_order_pdf.rb index 55d08ecc..a7f85098 100644 --- a/app/pdf/crm_order_pdf.rb +++ b/app/pdf/crm_order_pdf.rb @@ -1,8 +1,8 @@ class CrmOrderPdf < Prawn::Document attr_accessor :receipt_width,:price_column_width,:p_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_column_width,:item_description_width def initialize(booking,order_items,printer_settings) - self.p_width = 200 - self.page_height = 1450 + self.page_width = PrintSetting.where("name = ?","CRM Order").first.page_width + self.page_height = PrintSetting.where("name = ?","CRM Order").first.page_height self.margin = 10 # self.price_width = self.p_width / 2 self.price_width=80 diff --git a/app/pdf/order_item_pdf.rb b/app/pdf/order_item_pdf.rb index 20a4537c..7b2e350b 100644 --- a/app/pdf/order_item_pdf.rb +++ b/app/pdf/order_item_pdf.rb @@ -2,8 +2,8 @@ class OrderItemPdf < Prawn::Document include ActionView::Helpers::NumberHelper attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width def initialize(print_settings,order_item, print_status, options, alt_name) - self.page_width = 185 - self.page_height = 1450 + self.page_width = PrintSetting.where("name = ?","OrderItemPdf").first.page_width + self.page_height = PrintSetting.where("name = ?","OrderItemPdf").first.page_height self.margin = 0 self.price_width = 40 # No Need for item self.qty_width = 40 diff --git a/app/pdf/order_summary_pdf.rb b/app/pdf/order_summary_pdf.rb index 244fbdfa..902c68ad 100644 --- a/app/pdf/order_summary_pdf.rb +++ b/app/pdf/order_summary_pdf.rb @@ -2,8 +2,8 @@ class OrderSummaryPdf < Prawn::Document include ActionView::Helpers::NumberHelper attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width def initialize(print_settings,order, print_status, order_items = nil,alt_name) - self.page_width = 190 - self.page_height = 1450 + self.page_width = PrintSetting.where("name = ?","Order Summary").first.page_width + self.page_height = PrintSetting.where("name = ?","Order Summary").first.page_height self.margin = 0 self.price_width = 40 # No Need for item self.qty_width = 40 diff --git a/app/pdf/queue_no_pdf.rb b/app/pdf/queue_no_pdf.rb index 0963f55e..cda410ca 100644 --- a/app/pdf/queue_no_pdf.rb +++ b/app/pdf/queue_no_pdf.rb @@ -1,8 +1,8 @@ class QueueNoPdf < Prawn::Document attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width def initialize(printer_settings, queue) - self.page_width = 210 - self.page_height = 1450 + self.page_width = PrintSetting.where("name = ?","Queue No").first.page_width + self.page_height = PrintSetting.where("name = ?","Queue No").first.page_height self.margin = 5 self.price_width = 35 self.qty_width = 20 diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index 2dca6d16..3027fb60 100644 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -2,8 +2,8 @@ class ReceiptBillPdf < Prawn::Document include ActionView::Helpers::NumberHelper attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width, :description_width, :price_num_width def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status) - self.page_width = 210 - self.page_height = 1450 + self.page_width = PrintSetting.where("name = ?","Receipt Bill").first.page_width + self.page_height = PrintSetting.where("name = ?","Receipt Bill").first.page_height self.margin = 5 self.price_width = 40 self.qty_width = 20 diff --git a/app/views/print_settings/_form.html.erb b/app/views/print_settings/_form.html.erb index ba703aae..f9079f99 100644 --- a/app/views/print_settings/_form.html.erb +++ b/app/views/print_settings/_form.html.erb @@ -5,10 +5,6 @@ <%= f.input :name %> <%= f.input :unique_code %> <%= f.input :template %> - <%= f.input :db_name %> - <%= f.input :db_type %> - <%= f.input :db_username %> - <%= f.input :db_password %> <%= f.input :printer_name %> <%= f.input :api_settings %> <%= f.input :page_width %> diff --git a/app/views/print_settings/index.html.erb b/app/views/print_settings/index.html.erb index 9c8ce0b0..c16a28c2 100644 --- a/app/views/print_settings/index.html.erb +++ b/app/views/print_settings/index.html.erb @@ -16,11 +16,7 @@ Name Unique code - + Template Printer name Api settings Page width @@ -38,11 +34,7 @@ <%= print_setting.name %> <%= print_setting.unique_code %> - + <%= print_setting.template %> <%= print_setting.printer_name %> <%= print_setting.api_settings %> <%= print_setting.page_width %> diff --git a/app/views/print_settings/show.html.erb b/app/views/print_settings/show.html.erb index 71d74950..46126c4b 100644 --- a/app/views/print_settings/show.html.erb +++ b/app/views/print_settings/show.html.erb @@ -29,22 +29,6 @@ Template <%= @print_setting.template %> - - Db name - <%= @print_setting.db_name %> - - - Db type - <%= @print_setting.db_type %> - - - Db username - <%= @print_setting.db_username %> - - - Db password - <%= @print_setting.db_password %> - Printer name <%= @print_setting.printer_name %> diff --git a/db/migrate/20170814041543_remove_d_bcols_from_print_settings.rb b/db/migrate/20170814041543_remove_d_bcols_from_print_settings.rb new file mode 100644 index 00000000..48a7de5d --- /dev/null +++ b/db/migrate/20170814041543_remove_d_bcols_from_print_settings.rb @@ -0,0 +1,8 @@ +class RemoveDBcolsFromPrintSettings < ActiveRecord::Migration[5.1] + def change + remove_column :print_settings, :db_name, :string + remove_column :print_settings, :db_type, :string + remove_column :print_settings, :db_username, :string + remove_column :print_settings, :db_password, :string + end +end