diff --git a/app/helpers/spree/admin/orders_helper.rb b/app/helpers/spree/admin/orders_helper.rb index 8a93ff2f54..ae1877688b 100644 --- a/app/helpers/spree/admin/orders_helper.rb +++ b/app/helpers/spree/admin/orders_helper.rb @@ -120,6 +120,14 @@ module Spree method: :put, icon: "icon-#{event}", data: { confirm: confirm_message }) end + + def quantity_field_tag(manifest_item) + html_options = { min: 0, class: "line_item_quantity", size: 5 } + unless manifest_item.variant.on_demand + html_options.merge!(max: manifest_item.variant.on_hand + manifest_item.quantity) + end + number_field_tag :quantity, manifest_item.quantity, html_options + end end end end diff --git a/app/views/spree/admin/orders/_shipment_manifest.html.haml b/app/views/spree/admin/orders/_shipment_manifest.html.haml index 6f6b37cc26..5393b4a5d3 100644 --- a/app/views/spree/admin/orders/_shipment_manifest.html.haml +++ b/app/views/spree/admin/orders/_shipment_manifest.html.haml @@ -14,9 +14,7 @@ = "#{count} x #{t(state.humanize.downcase, scope: [:spree, :shipment_states], default: [:missing, "none"])}" - unless shipment.shipped? %td.item-qty-edit.hidden - - html_options = { :min => 0, :class => "line_item_quantity", :size => 5 } - - html_options.merge!({ :max => item.variant.on_hand + item.quantity }) unless item.variant.on_demand - = number_field_tag :quantity, item.quantity, html_options + = quantity_field_tag(item) %td.item-total.align-center = line_item_shipment_price(line_item, item.quantity)