Working supplier dashboard
This commit is contained in:
@@ -9,3 +9,5 @@ Qsupplier.App.List = DS.Model.extend
|
||||
table_number: attr 'number'
|
||||
table: DS.belongsTo('Qsupplier.App.Table', inverse: 'active_list')
|
||||
orders: DS.hasMany('Qsupplier.App.Order')
|
||||
section: DS.belongsTo('Qsupplier.App.Section')
|
||||
section_id: attr('string')
|
||||
|
||||
@@ -4,8 +4,14 @@ Qsupplier.App.Order = DS.Model.extend
|
||||
list: DS.belongsTo('Qsupplier.App.List')
|
||||
total_amount: attr('number')
|
||||
product_orders: attr('object')
|
||||
section: DS.belongsTo('Qsupplier.App.Section')
|
||||
section_id: attr('string')
|
||||
|
||||
active: (-> @get('state') == 'active').property('state')
|
||||
delivered: (-> @get('state') == 'delivered').property('state')
|
||||
placed: (-> @get('state') == 'placed').property('state')
|
||||
needs_supplier_attention: (-> @get('state') == 'placed' || @get('state') == 'active').property('state')
|
||||
|
||||
display: (->
|
||||
@get('product_orders').map((po)-> "#{po.product_name} (#{po.quantity})").join(',')
|
||||
).property('product_orders')
|
||||
|
||||
Reference in New Issue
Block a user