Sha256: 9c047d4a69c1b2e8e062d02588be3a0b7b5b99fab4b1f41e6e36296f48540c5b

Contents?: true

Size: 1.67 KB

Versions: 2

Compression:

Stored size: 1.67 KB

Contents

%table.pure-table.pure-table-bordered
  %thead
    %tr
      %th(style="width: 5%;") Product ID
      %th(style="width: 50%;") Product Name
      %th(style="width: 10%;") Stock (at order- time) / min stock
      %th(style="width: 20%;") Order
      %th(style="width: 5%;")
        %i.fa.fa-cube
      %th(style="width: 10%;") Stock/ Sales history
  %tbody
    - order_items.each do |order_item|
      %tr
        %td
          - if order_item.local_product
            = order_item.local_product.product_id
          - else
            No local product!
        %td
          = local_product_link order_item.local_product
        %td
          = order_item.current_stock
          \/
          = order_item.min_stock
          - last_order_item = order_item.order_item_same_product(order_item.updated_at).first
          - if last_order_item.present? && last_order_item.num_wished
            %br
            %button.pure-button.reorder(data-order_item_id="#{order_item.id}" data-num_wished="#{last_order_item.num_wished}")
              = last_order_item.order.updated_at.strftime("%Y-%m-%d")
              %br
              = last_order_item.num_wished
              \/
              = last_order_item.num_ordered
        %td
          - if order_item.remote_product_id.present?
            = haml "widgets/_qty_wished_input".to_sym, locals: {product: order_item.local_product}
          - else
            No remote product
        %td= order_item.local_product.packsize
        %td
          - stock_url = "/product/#{order_item.local_product.id}/stock_sales_plot"
          %a.stock_show_action{:href => "", :data => {url: stock_url, product: order_item.local_product.name}}
            Stock/Sales

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rawbotz-0.1.4 lib/rawbotz/views/order/_item_table.haml
rawbotz-0.1.3 lib/rawbotz/views/order/_item_table.haml