Fix bugs and improvements
fix payment outstanding with amount <= 0 fix payment outstanding with other payments
This commit is contained in:
@@ -4,11 +4,11 @@ class DiningFacility < ApplicationRecord
|
||||
has_one :dining_charge
|
||||
has_one :cashier_terminal_by_zone, foreign_key: "zone_id", primary_key: "zone_id"
|
||||
has_one :cashier_terminal, through: :cashier_terminal_by_zone
|
||||
has_one :current_shift, through: :cashier_terminal
|
||||
has_many :order_queue_process_by_zones, foreign_key: "zone_id", primary_key: "zone_id"
|
||||
has_many :order_queue_stations, -> { where(is_active: true) }, through: :order_queue_process_by_zones
|
||||
|
||||
has_many :bookings
|
||||
|
||||
has_many :current_bookings, -> { left_joins(:sale).assign.within_time_limit.merge(Booking.where(checkout_at: nil).or(Booking.merge(Sale.where(sale_status: ['new', nil])))) }, class_name: "Booking"
|
||||
has_one :current_checkin_booking, -> { left_joins(:sale).assign.within_time_limit.merge(Sale.where(sale_status: nil)) }, class_name: "Booking"
|
||||
has_one :current_checkout_booking, -> { left_joins(:sale).assign.within_time_limit.where.not(checkout_at: nil).merge(Sale.where(sale_status: 'new')) }, class_name: "Booking"
|
||||
|
||||
Reference in New Issue
Block a user