Add payment structure
This commit is contained in:
@@ -17,6 +17,7 @@ class List
|
||||
belongs_to :table
|
||||
belongs_to :supplier
|
||||
belongs_to :section
|
||||
has_many :list_payments
|
||||
has_and_belongs_to_many :users, storing_keys: true
|
||||
has_and_belongs_to_many :employees, storing_keys: true
|
||||
|
||||
@@ -274,6 +275,10 @@ class List
|
||||
state == 'active'
|
||||
end
|
||||
|
||||
def closed?
|
||||
state == 'closed'
|
||||
end
|
||||
|
||||
def place_order(product_orders: [], user: nil, employee: nil)
|
||||
return false unless product_orders.any?
|
||||
order = Order.create list: self, supplier: supplier, user: user, employee: employee, section_id: section_id, table_id: table_id
|
||||
|
||||
Reference in New Issue
Block a user