add cashier zone in ui

This commit is contained in:
Yan
2017-10-23 10:53:22 +06:30
parent 649f50bd5e
commit 95ef534b04
7 changed files with 10 additions and 8 deletions

View File

@@ -70,6 +70,6 @@ class Settings::CashierTerminalsController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def settings_cashier_terminal_params
params.require(:cashier_terminal).permit(:name, :is_active, :is_currently_login, :auto_print_receipt, :printer_name, :header, :footer, :font, :font_size, :show_tax, :show_cashier, :show_guest_info)
params.require(:cashier_terminal).permit(:name, :is_active, :is_currently_login, :auto_print_receipt, :printer_name, :header, :footer, :font, :font_size, :show_tax, :show_cashier, :show_guest_info,{ zone_ids: [] })
end
end

View File

@@ -73,11 +73,6 @@ class Settings::OrderQueueStationsController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def settings_order_queue_station_params
# <<<<<<< HEAD
# params.require(:order_queue_station).permit(:station_name, :is_active, :auto_print, :processing_items, :print_copy, :printer_name, :font_size, :cut_per_item, :use_alternate_name, :created_by)
# =======
# Don't Know { zone_ids: [] }
params.require(:order_queue_station).permit(:station_name, :is_active, :processing_items, :auto_print, :print_copy, :printer_name, :font_size, :cut_per_item, :use_alternate_name, :created_by,{ zone_ids: [] })
# >>>>>>> b093a993ba002c92659bbb34338c55c031c11d87
end
end

View File

@@ -1,2 +1,4 @@
class CashierTerminal < ApplicationRecord
has_many :cashier_terminal_by_zones
has_many :zones, through: :cashier_terminal_by_zones
end

View File

@@ -1,2 +1,4 @@
class CashierTerminalByZone < ApplicationRecord
belongs_to :zone
belongs_to :cashier_terminal
end

View File

@@ -3,6 +3,7 @@ class Zone < ApplicationRecord
has_many :tables, dependent: :destroy
has_many :rooms, dependent: :destroy
has_many :order_queue_stations
has_many :cashier_terminals
# validations
validates_presence_of :name, :created_by

View File

@@ -8,6 +8,8 @@
<%= f.input :is_active %>
<%= f.input :is_currently_login %>
<%= f.input :auto_print_receipt %>
<%= f.label "Select Zones", :class => 'control-label' %>
<%= f.collection_check_boxes :zone_ids , Zone.all, :id, :name , :class => 'checkbox'%>
<%= f.input :printer_name %>
<%= f.input :font %>
<%= f.input :font_size %>

View File

@@ -1,8 +1,8 @@
class CreateCashierTerminalByZones < ActiveRecord::Migration[5.1]
def change
create_table :cashier_terminal_by_zones do |t|
t.integer :cashier_terminal_id
t.integer :zone_id
t.references :cashier_terminal, :null => false
t.references :zone, :null => false
t.timestamps
end