20 lines
600 B
CoffeeScript
20 lines
600 B
CoffeeScript
class List
|
|
constructor: (@attributes)->
|
|
id: -> @attributes.id || @attributes._id
|
|
table_number: -> @attributes.table_number
|
|
total_amount: -> @attributes.total_amount
|
|
section_title: -> @attributes.section_title
|
|
needs_help: -> @attributes.needs_help
|
|
needs_payment: -> @attributes.needs_payment
|
|
active: -> @attributes.state == 'active'
|
|
products: -> @attributes.products || []
|
|
supplier_name: -> @attributes.supplier_name
|
|
created_at: -> @attributes.created_at
|
|
display: ->
|
|
txt = @supplier_name()
|
|
txt += ' - '
|
|
txt += Quser.format_date(@created_at())
|
|
txt
|
|
|
|
@List = List
|