update workflow
This commit is contained in:
@@ -57,8 +57,8 @@ root.Qrammer =
|
||||
else
|
||||
eval(res)
|
||||
return
|
||||
alert(res['message']) if res['message'] && !res['ok']
|
||||
alert(res['message']) if res['message'] && res['ok']
|
||||
window.location = '/' if res['message'] && !res['ok']
|
||||
window.location = '/view_active_list' if res['ok']
|
||||
load_active_order_list: (supplier_id) ->
|
||||
$.get('/suppliers/'+supplier_id+'/active_order_list.json', (res) ->
|
||||
body = $('#active-orders-table tbody')
|
||||
@@ -119,7 +119,29 @@ root.Qrammer =
|
||||
row.append(td_buttons)
|
||||
#foot.append('<tr><td></td><td class="currency"><strong>'+Qrammer.currency(res.total_amount)+'</strong></td></tr>');
|
||||
)
|
||||
|
||||
active_user_list: (list_id) ->
|
||||
$.get('/lists/'+list_id+'/current.json', (res) ->
|
||||
body = $('#active-list-table tbody')
|
||||
foot = $('#active-list-table tfoot')
|
||||
body.find('tr').remove()
|
||||
foot.find('tr').remove()
|
||||
if !res.orders && !res.orders.length
|
||||
alert('No orders in list')
|
||||
return
|
||||
for order in res.orders
|
||||
order_txts = []
|
||||
row = $('<tr></tr>').appendTo(body)
|
||||
row.addClass(order.state)
|
||||
#if(order.state == 'placed') row.addClass('info');
|
||||
#if(order.state == 'delivered') row.addClass('success');
|
||||
row.addClass('error') if order.state == 'cancelled'
|
||||
for product in order.products
|
||||
order_txts.push(product.name + ' (' + product['number'] + ')')
|
||||
row.append($('<td></td>').text(order_txts.join(', ')))
|
||||
row.append($('<td class="currency"></td>').html(Qrammer.currency(order.total_amount)))
|
||||
foot.append('<tr><td></td><td class="currency"><strong>'+Qrammer.currency(res.total_amount)+'</strong></td></tr>')
|
||||
)
|
||||
|
||||
build_product_list_as_modal: ->
|
||||
wrapper = $('<div class="modal"></div>')
|
||||
callback_wrapper = ->
|
||||
|
||||
Reference in New Issue
Block a user