= haml "orders/menu".to_sym %h2 Packlist for order #{@order.supplier.name} from #{@order.created_at} - if @order.supplier == settings.supplier && !@order.remote_order_link.present? .ui-state-error = error_icon This order is not linked up to a remote order, thus no refunds or extra items are shown. %a.button.pure-button(href="/order/#{@order.id}/link_to_remote") Link to a remote order %center Last changed #{@order.updated_at} = haml "order/_head".to_sym, locals: {order: @order} %br %table.pure-table.pure-table-striped %thead %tr %th = products_icon Product %th = shelve_icon Shelve %th = order_icon Quantity Ordered - if !@refunds.empty? || !@orphans.empty? %th %i.fa.fa-times-circle-o Refunded %th = stock_icon Quantity Stocked %tbody - @order.order_items.where("num_ordered > 0").sort_by{|i| i.local_product.name}.each do |p| %tr %td=p.local_product.name %td=p.local_product.shelve_nr %td = p.num_ordered - if refund = @refunds[p.local_product.product_id] ( = refund.qty_ordered ) - if !@refunds.empty? %td - if remote_line = @refunds[p.local_product.product_id] = @refunds[p.local_product.product_id].qty_refunded %td=p.num_stocked - if !@orphans.empty? %tr %td(colspan=4) %center %b = error_icon Orphans (not ordered via rawbotz): = error_icon - @orphans.each do |orphan| %tr %td = orphan[0] %td %td(title="Quantity ordered") = orphan[1] %td(title="Quantity refunded") = orphan[2] %td %br