check required for oqs and cashier terminal

This commit is contained in:
phyusin
2017-10-27 12:02:38 +06:30
parent 8f5d24a2e3
commit 0653bfab53
3 changed files with 6 additions and 1 deletions

View File

@@ -3,4 +3,7 @@ class CashierTerminal < ApplicationRecord
has_many :zones, through: :cashier_terminal_by_zones
scope :available, -> {where(is_currently_login: false)}
# validations
validates_presence_of :name, :printer_name
end

View File

@@ -10,6 +10,9 @@ class OrderQueueStation < ApplicationRecord
scope :active, -> {where(is_active: true)}
# validations
validates_presence_of :station_name, :printer_name
def process_order (order, table_id)
oqs_stations = OrderQueueStation.active
dining=DiningFacility.find(table_id)

View File

@@ -858,7 +858,6 @@ end
def self.hourly_sales(today)
query= Sale.select("grand_total")
.where('payment_status="paid" and sale_status = "completed" and DATE_FORMAT(receipt_date,"%Y-%m-%d") = ?',today)
.group("date_format(receipt_date, '%I %p')")
end
def self.employee_sales(today)