solidus_backend 2.4.2 → 2.5.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of solidus_backend might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/README.md +7 -7
- data/Rakefile +19 -13
- data/app/assets/javascripts/spree/backend.js +5 -17
- data/app/assets/javascripts/spree/backend/adjustments.js +26 -0
- data/app/assets/javascripts/spree/backend/admin.js +14 -78
- data/app/assets/javascripts/spree/backend/backbone-overrides.js +25 -0
- data/app/assets/javascripts/spree/backend/calculator.js +1 -1
- data/app/assets/javascripts/spree/backend/checkouts/edit.js +1 -1
- data/app/assets/javascripts/spree/backend/collections/index.js +1 -0
- data/app/assets/javascripts/spree/backend/collections/shipments.js +6 -0
- data/app/assets/javascripts/spree/backend/components/editable_table.js +5 -0
- data/app/assets/javascripts/spree/backend/components/number_with_currency.js +1 -1
- data/app/assets/javascripts/spree/backend/components/sortable_table.js +29 -0
- data/app/assets/javascripts/spree/backend/components/tabs.js +67 -0
- data/app/assets/javascripts/spree/backend/components/tooltips.js +19 -24
- data/app/assets/javascripts/spree/backend/datepicker.js +55 -0
- data/app/assets/javascripts/spree/backend/flash.js +20 -0
- data/app/assets/javascripts/spree/backend/gateway.js +22 -0
- data/app/assets/javascripts/spree/backend/handlebars_extensions.js +8 -0
- data/app/assets/javascripts/spree/backend/images/index.js +8 -0
- data/app/assets/javascripts/spree/backend/models/index.js +3 -0
- data/app/assets/javascripts/spree/backend/models/line_item.js +4 -0
- data/app/assets/javascripts/spree/backend/models/order.js +2 -1
- data/app/assets/javascripts/spree/backend/models/payment.js +5 -0
- data/app/assets/javascripts/spree/backend/models/shipment.js +27 -0
- data/app/assets/javascripts/spree/backend/models/stock_item.js +6 -0
- data/app/assets/javascripts/spree/backend/namespaces.js +5 -1
- data/app/assets/javascripts/spree/backend/navigation.js +14 -0
- data/app/assets/javascripts/spree/backend/option_type_autocomplete.js +1 -1
- data/app/assets/javascripts/spree/backend/option_value_picker.js +1 -0
- data/app/assets/javascripts/spree/backend/orders/cart.js +1 -1
- data/app/assets/javascripts/spree/backend/orders/edit.js +2 -2
- data/app/assets/javascripts/spree/backend/payments/edit.js +16 -0
- data/app/assets/javascripts/spree/backend/payments/new.js +1 -1
- data/app/assets/javascripts/spree/backend/product_picker.js +1 -1
- data/app/assets/javascripts/spree/backend/progress.js +9 -0
- data/app/assets/javascripts/spree/backend/promotions.js +35 -0
- data/app/assets/javascripts/spree/backend/promotions/activation.js +1 -1
- data/app/assets/javascripts/spree/backend/returns/return_item_selection.js +1 -1
- data/app/assets/javascripts/spree/backend/routes.js +0 -12
- data/app/assets/javascripts/spree/backend/shipments.js +35 -68
- data/app/assets/javascripts/spree/backend/stock_location.js +23 -0
- data/app/assets/javascripts/spree/backend/stock_management.js +22 -0
- data/app/assets/javascripts/spree/backend/store_credits.js +25 -0
- data/app/assets/javascripts/spree/backend/style_guide.js +3 -0
- data/app/assets/javascripts/spree/backend/taxon_autocomplete.js +1 -1
- data/app/assets/javascripts/spree/backend/taxonomy.js +121 -0
- data/app/assets/javascripts/spree/backend/taxons.js +75 -0
- data/app/assets/javascripts/spree/backend/templates/index.js +2 -2
- data/app/assets/javascripts/spree/backend/templates/orders/line_item.hbs +7 -5
- data/app/assets/javascripts/spree/backend/templates/orders/shipment_tracking.hbs +24 -0
- data/app/assets/javascripts/spree/backend/templates/orders/shipping_method.hbs +34 -0
- data/app/assets/javascripts/spree/backend/templates/promotions/calculators/fields/tiered_flat_rate.hbs +7 -3
- data/app/assets/javascripts/spree/backend/templates/promotions/calculators/fields/tiered_percent.hbs +6 -2
- data/app/assets/javascripts/spree/backend/templates/stock_items/stock_location_stock_item.hbs +3 -1
- data/app/assets/javascripts/spree/backend/templates/variants/autocomplete_stock.hbs +10 -5
- data/app/assets/javascripts/spree/backend/templates/variants/split.hbs +5 -3
- data/app/assets/javascripts/spree/backend/translation.js +11 -0
- data/app/assets/javascripts/spree/backend/turbolinks-integration.js +21 -0
- data/app/assets/javascripts/spree/backend/user_picker.js +1 -1
- data/app/assets/javascripts/spree/backend/variant_autocomplete.js +60 -0
- data/app/assets/javascripts/spree/backend/views/calculators/tiered.js +54 -0
- data/app/assets/javascripts/spree/backend/views/cart/line_item_row.js +2 -1
- data/app/assets/javascripts/spree/backend/views/index.js +7 -0
- data/app/assets/javascripts/spree/backend/views/order/shipment_tracking.js +46 -0
- data/app/assets/javascripts/spree/backend/views/order/shipping_method.js +57 -0
- data/app/assets/javascripts/spree/backend/views/payment/payment_row.js +36 -0
- data/app/assets/javascripts/spree/backend/views/promotions/option_values_rule.js +79 -0
- data/app/assets/javascripts/spree/backend/views/state_select.js +6 -6
- data/app/assets/javascripts/spree/backend/views/stock/add_stock_item.js +63 -0
- data/app/assets/javascripts/spree/backend/views/stock/edit_stock_item_row.js +68 -0
- data/app/assets/javascripts/spree/backend/views/tables/editable_table.js +15 -0
- data/app/assets/javascripts/spree/backend/views/tables/editable_table_row.js +61 -0
- data/app/assets/javascripts/spree/backend/zone.js +1 -1
- data/app/assets/stylesheets/spree/backend.css +1 -2
- data/app/assets/stylesheets/spree/backend/components/_messages.scss +4 -1
- data/app/assets/stylesheets/spree/backend/components/_navigation.scss +4 -2
- data/app/assets/stylesheets/spree/backend/components/_number_with_currency.scss +8 -2
- data/app/assets/stylesheets/spree/backend/components/_progress.scss +4 -0
- data/app/assets/stylesheets/spree/backend/components/_tabs.scss +4 -2
- data/app/assets/stylesheets/spree/backend/globals/mixins/_line_through.scss +2 -1
- data/app/assets/stylesheets/spree/backend/plugins/_select2.scss +32 -7
- data/app/assets/stylesheets/spree/backend/plugins/_sortable.scss +3 -0
- data/app/assets/stylesheets/spree/backend/sections/_orders.scss +4 -20
- data/app/assets/stylesheets/spree/backend/sections/_products.scss +0 -1
- data/app/assets/stylesheets/spree/backend/sections/_promotions.scss +15 -7
- data/app/assets/stylesheets/spree/backend/sections/_store_credits.scss +17 -6
- data/app/assets/stylesheets/spree/backend/sections/_style_guide.scss +8 -4
- data/app/assets/stylesheets/spree/backend/sections/_taxonomies.scss +5 -19
- data/app/assets/stylesheets/spree/backend/sections/_variants.scss +5 -0
- data/app/assets/stylesheets/spree/backend/shared/_forms.scss +13 -17
- data/app/assets/stylesheets/spree/backend/shared/_layout.scss +9 -3
- data/app/assets/stylesheets/spree/backend/shared/_tables.scss +3 -27
- data/app/assets/stylesheets/spree/backend/spree_admin.scss +2 -6
- data/app/controllers/spree/admin/base_controller.rb +2 -3
- data/app/controllers/spree/admin/cancellations_controller.rb +3 -3
- data/app/controllers/spree/admin/images_controller.rb +1 -1
- data/app/controllers/spree/admin/option_types_controller.rb +1 -2
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +2 -2
- data/app/controllers/spree/admin/orders_controller.rb +11 -11
- data/app/controllers/spree/admin/payment_methods_controller.rb +5 -6
- data/app/controllers/spree/admin/payments_controller.rb +5 -5
- data/app/controllers/spree/admin/products_controller.rb +4 -6
- data/app/controllers/spree/admin/promotion_actions_controller.rb +4 -4
- data/app/controllers/spree/admin/promotion_rules_controller.rb +3 -3
- data/app/controllers/spree/admin/promotions_controller.rb +5 -1
- data/app/controllers/spree/admin/reports_controller.rb +2 -2
- data/app/controllers/spree/admin/resource_controller.rb +17 -5
- data/app/controllers/spree/admin/return_authorizations_controller.rb +2 -2
- data/app/controllers/spree/admin/shipping_methods_controller.rb +1 -1
- data/app/controllers/spree/admin/stock_locations_controller.rb +1 -1
- data/app/controllers/spree/admin/store_credits_controller.rb +4 -4
- data/app/controllers/spree/admin/taxons_controller.rb +1 -1
- data/app/controllers/spree/admin/users_controller.rb +6 -6
- data/app/controllers/spree/admin/variants_controller.rb +0 -16
- data/app/helpers/spree/admin/adjustments_helper.rb +2 -2
- data/app/helpers/spree/admin/base_helper.rb +5 -11
- data/app/helpers/spree/admin/navigation_helper.rb +8 -8
- data/app/helpers/spree/admin/orders_helper.rb +2 -2
- data/app/helpers/spree/admin/products_helper.rb +0 -24
- data/app/helpers/spree/admin/store_credit_events_helper.rb +5 -5
- data/app/models/spree/backend_configuration.rb +1 -2
- data/app/views/spree/admin/adjustment_reasons/edit.html.erb +2 -2
- data/app/views/spree/admin/adjustment_reasons/index.html.erb +5 -5
- data/app/views/spree/admin/adjustment_reasons/new.html.erb +3 -3
- data/app/views/spree/admin/adjustments/_adjustments_table.html.erb +2 -2
- data/app/views/spree/admin/adjustments/_form.html.erb +1 -1
- data/app/views/spree/admin/adjustments/edit.html.erb +3 -3
- data/app/views/spree/admin/adjustments/index.html.erb +3 -3
- data/app/views/spree/admin/adjustments/new.html.erb +3 -3
- data/app/views/spree/admin/cancellations/index.html.erb +3 -3
- data/app/views/spree/admin/customer_returns/_reimbursements_table.html.erb +2 -2
- data/app/views/spree/admin/customer_returns/_return_item_decision.html.erb +7 -7
- data/app/views/spree/admin/customer_returns/_return_item_selection.html.erb +2 -2
- data/app/views/spree/admin/customer_returns/edit.html.erb +7 -7
- data/app/views/spree/admin/customer_returns/index.html.erb +4 -4
- data/app/views/spree/admin/customer_returns/new.html.erb +11 -11
- data/app/views/spree/admin/images/_image_row.html.erb +3 -3
- data/app/views/spree/admin/images/_new.html.erb +12 -0
- data/app/views/spree/admin/images/edit.html.erb +4 -4
- data/app/views/spree/admin/images/index.html.erb +7 -5
- data/app/views/spree/admin/images/new.html.erb +1 -12
- data/app/views/spree/admin/log_entries/index.html.erb +2 -2
- data/app/views/spree/admin/option_types/_option_value_fields.html.erb +1 -1
- data/app/views/spree/admin/option_types/edit.html.erb +1 -1
- data/app/views/spree/admin/option_types/index.html.erb +2 -2
- data/app/views/spree/admin/option_types/new.html.erb +1 -1
- data/app/views/spree/admin/orders/_add_product.html.erb +2 -2
- data/app/views/spree/admin/orders/_carton.html.erb +8 -8
- data/app/views/spree/admin/orders/_carton_manifest.html.erb +1 -1
- data/app/views/spree/admin/orders/_order_details.html.erb +4 -4
- data/app/views/spree/admin/orders/_risk_analysis.html.erb +10 -10
- data/app/views/spree/admin/orders/_shipment.html.erb +11 -69
- data/app/views/spree/admin/orders/_shipment_manifest.html.erb +3 -3
- data/app/views/spree/admin/orders/cart.html.erb +2 -2
- data/app/views/spree/admin/orders/confirm.html.erb +6 -6
- data/app/views/spree/admin/orders/confirm/_customer_details.html.erb +3 -3
- data/app/views/spree/admin/orders/confirm/_payments.html.erb +1 -1
- data/app/views/spree/admin/orders/confirm/_shipment.html.erb +2 -2
- data/app/views/spree/admin/orders/confirm/_shipment_manifest.html.erb +1 -1
- data/app/views/spree/admin/orders/confirm_advance.html.erb +3 -3
- data/app/views/spree/admin/orders/customer_details/_form.html.erb +19 -13
- data/app/views/spree/admin/orders/customer_details/edit.html.erb +2 -2
- data/app/views/spree/admin/orders/customer_details/show.html.erb +7 -7
- data/app/views/spree/admin/orders/edit.html.erb +2 -2
- data/app/views/spree/admin/orders/index.html.erb +30 -28
- data/app/views/spree/admin/payment_methods/_form.html.erb +24 -13
- data/app/views/spree/admin/payment_methods/edit.html.erb +2 -2
- data/app/views/spree/admin/payment_methods/index.html.erb +6 -6
- data/app/views/spree/admin/payment_methods/new.html.erb +3 -3
- data/app/views/spree/admin/payments/_capture_events.html.erb +2 -2
- data/app/views/spree/admin/payments/_list.html.erb +33 -13
- data/app/views/spree/admin/payments/credit.html.erb +1 -1
- data/app/views/spree/admin/payments/index.html.erb +3 -3
- data/app/views/spree/admin/payments/new.html.erb +4 -4
- data/app/views/spree/admin/payments/show.html.erb +2 -2
- data/app/views/spree/admin/payments/source_forms/_gateway.html.erb +22 -23
- data/app/views/spree/admin/payments/source_views/_gateway.html.erb +1 -1
- data/app/views/spree/admin/payments/source_views/_storecredit.html.erb +1 -1
- data/app/views/spree/admin/prices/_form.html.erb +1 -2
- data/app/views/spree/admin/prices/edit.html.erb +1 -1
- data/app/views/spree/admin/prices/index.html.erb +2 -2
- data/app/views/spree/admin/prices/new.html.erb +1 -1
- data/app/views/spree/admin/product_properties/_product_property_fields.html.erb +1 -1
- data/app/views/spree/admin/product_properties/index.html.erb +7 -14
- data/app/views/spree/admin/products/_form.html.erb +17 -14
- data/app/views/spree/admin/products/edit.html.erb +2 -2
- data/app/views/spree/admin/products/index.html.erb +6 -6
- data/app/views/spree/admin/products/new.html.erb +5 -59
- data/app/views/spree/admin/promotion_categories/index.html.erb +1 -1
- data/app/views/spree/admin/promotion_categories/new.html.erb +1 -1
- data/app/views/spree/admin/promotion_code_batches/index.html.erb +8 -8
- data/app/views/spree/admin/promotion_code_batches/new.html.erb +1 -1
- data/app/views/spree/admin/promotion_codes/index.html.erb +1 -1
- data/app/views/spree/admin/promotions/_actions.html.erb +6 -6
- data/app/views/spree/admin/promotions/_form.html.erb +13 -4
- data/app/views/spree/admin/promotions/_promotion_rule.html.erb +1 -1
- data/app/views/spree/admin/promotions/_rules.html.erb +8 -8
- data/app/views/spree/admin/promotions/actions/_create_quantity_adjustments.html.erb +4 -10
- data/app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb +25 -29
- data/app/views/spree/admin/promotions/calculators/_default_fields.html.erb +5 -4
- data/app/views/spree/admin/promotions/calculators/distributed_amount/_fields.html.erb +6 -4
- data/app/views/spree/admin/promotions/calculators/flat_rate/_fields.html.erb +6 -4
- data/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb +5 -5
- data/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb +5 -5
- data/app/views/spree/admin/promotions/edit.html.erb +1 -1
- data/app/views/spree/admin/promotions/index.html.erb +7 -7
- data/app/views/spree/admin/promotions/new.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_item_total.html.erb +10 -12
- data/app/views/spree/admin/promotions/rules/_nth_order.html.erb +8 -10
- data/app/views/spree/admin/promotions/rules/_option_value.html.erb +10 -14
- data/app/views/spree/admin/promotions/rules/_product.html.erb +12 -10
- data/app/views/spree/admin/promotions/rules/_taxon.html.erb +9 -15
- data/app/views/spree/admin/promotions/rules/_user.html.erb +3 -5
- data/app/views/spree/admin/promotions/rules/_user_role.html.erb +3 -3
- data/app/views/spree/admin/properties/index.html.erb +5 -5
- data/app/views/spree/admin/properties/new.html.erb +1 -1
- data/app/views/spree/admin/refund_reasons/edit.html.erb +2 -2
- data/app/views/spree/admin/refund_reasons/index.html.erb +5 -5
- data/app/views/spree/admin/refund_reasons/new.html.erb +3 -3
- data/app/views/spree/admin/refund_reasons/shared/_form.html.erb +1 -1
- data/app/views/spree/admin/refunds/edit.html.erb +3 -3
- data/app/views/spree/admin/refunds/new.html.erb +4 -4
- data/app/views/spree/admin/reimbursement_types/index.html.erb +2 -2
- data/app/views/spree/admin/reimbursements/edit.html.erb +9 -9
- data/app/views/spree/admin/reimbursements/index.html.erb +4 -4
- data/app/views/spree/admin/reimbursements/show.html.erb +4 -4
- data/app/views/spree/admin/reports/index.html.erb +3 -3
- data/app/views/spree/admin/reports/sales_total.html.erb +7 -7
- data/app/views/spree/admin/return_authorizations/_form.html.erb +3 -3
- data/app/views/spree/admin/return_authorizations/edit.html.erb +5 -5
- data/app/views/spree/admin/return_authorizations/index.html.erb +4 -4
- data/app/views/spree/admin/return_authorizations/new.html.erb +3 -3
- data/app/views/spree/admin/return_reasons/edit.html.erb +2 -2
- data/app/views/spree/admin/return_reasons/index.html.erb +3 -3
- data/app/views/spree/admin/return_reasons/new.html.erb +3 -3
- data/app/views/spree/admin/shared/_address_form.html.erb +2 -0
- data/app/views/spree/admin/shared/_calculator_fields.html.erb +4 -3
- data/app/views/spree/admin/shared/_edit_resource_links.html.erb +2 -2
- data/app/views/spree/admin/shared/_head.html.erb +13 -5
- data/app/views/spree/admin/shared/_js_locale_data.html.erb +24 -32
- data/app/views/spree/admin/shared/_navigation_footer.html.erb +32 -2
- data/app/views/spree/admin/shared/_new_resource_links.html.erb +2 -2
- data/app/views/spree/admin/shared/_no_objects_found.html.erb +2 -2
- data/app/views/spree/admin/shared/_number_with_currency.html.erb +9 -5
- data/app/views/spree/admin/shared/_order_submenu.html.erb +6 -6
- data/app/views/spree/admin/shared/_order_summary.html.erb +5 -5
- data/app/views/spree/admin/shared/_order_tabs.html.erb +1 -1
- data/app/views/spree/admin/shared/_product_tabs.html.erb +3 -3
- data/app/views/spree/admin/shared/_rebuild_vat_prices_checkbox.html.erb +2 -2
- data/app/views/spree/admin/shared/_refunds.html.erb +2 -2
- data/app/views/spree/admin/shared/_report_order_criteria.html.erb +8 -6
- data/app/views/spree/admin/shared/_spinner.html.erb +1 -1
- data/app/views/spree/admin/shared/_variant_search.html.erb +3 -3
- data/app/views/spree/admin/shared/named_types/_form.html.erb +4 -2
- data/app/views/spree/admin/shared/named_types/_index.html.erb +4 -4
- data/app/views/spree/admin/shared/preference_fields/_boolean.html.erb +9 -8
- data/app/views/spree/admin/shipping_categories/edit.html.erb +3 -3
- data/app/views/spree/admin/shipping_categories/index.html.erb +5 -5
- data/app/views/spree/admin/shipping_categories/new.html.erb +3 -3
- data/app/views/spree/admin/shipping_methods/_form.html.erb +10 -8
- data/app/views/spree/admin/shipping_methods/edit.html.erb +2 -2
- data/app/views/spree/admin/shipping_methods/index.html.erb +5 -5
- data/app/views/spree/admin/shipping_methods/new.html.erb +3 -3
- data/app/views/spree/admin/stock_items/_stock_management.html.erb +7 -7
- data/app/views/spree/admin/stock_items/index.html.erb +4 -4
- data/app/views/spree/admin/stock_locations/_form.html.erb +105 -103
- data/app/views/spree/admin/stock_locations/edit.html.erb +4 -6
- data/app/views/spree/admin/stock_locations/index.html.erb +5 -11
- data/app/views/spree/admin/stock_locations/new.html.erb +5 -7
- data/app/views/spree/admin/stock_movements/index.html.erb +3 -3
- data/app/views/spree/admin/store_credits/_form.html.erb +3 -3
- data/app/views/spree/admin/store_credits/_update_reason_field.html.erb +7 -8
- data/app/views/spree/admin/store_credits/edit_amount.html.erb +10 -6
- data/app/views/spree/admin/store_credits/edit_validity.html.erb +7 -5
- data/app/views/spree/admin/store_credits/index.html.erb +13 -13
- data/app/views/spree/admin/store_credits/new.html.erb +2 -2
- data/app/views/spree/admin/store_credits/show.html.erb +24 -32
- data/app/views/spree/admin/stores/_form.html.erb +1 -1
- data/app/views/spree/admin/stores/edit.html.erb +1 -1
- data/app/views/spree/admin/stores/index.html.erb +1 -1
- data/app/views/spree/admin/stores/new.html.erb +1 -1
- data/app/views/spree/admin/style_guide/topics/forms/_building_forms.html.erb +5 -3
- data/app/views/spree/admin/style_guide/topics/messaging/_loading.html.erb +1 -1
- data/app/views/spree/admin/tax_categories/_form.html.erb +4 -2
- data/app/views/spree/admin/tax_categories/edit.html.erb +2 -2
- data/app/views/spree/admin/tax_categories/index.html.erb +5 -5
- data/app/views/spree/admin/tax_categories/new.html.erb +3 -3
- data/app/views/spree/admin/tax_rates/_form.html.erb +17 -11
- data/app/views/spree/admin/tax_rates/edit.html.erb +2 -2
- data/app/views/spree/admin/tax_rates/index.html.erb +8 -8
- data/app/views/spree/admin/tax_rates/new.html.erb +3 -3
- data/app/views/spree/admin/taxonomies/edit.erb +3 -3
- data/app/views/spree/admin/taxonomies/index.html.erb +2 -2
- data/app/views/spree/admin/taxonomies/new.html.erb +2 -2
- data/app/views/spree/admin/taxons/_form.html.erb +5 -1
- data/app/views/spree/admin/taxons/edit.html.erb +4 -4
- data/app/views/spree/admin/taxons/index.html.erb +7 -7
- data/app/views/spree/admin/users/_addresses_form.html.erb +2 -2
- data/app/views/spree/admin/users/_form.html.erb +10 -5
- data/app/views/spree/admin/users/_sidebar.html.erb +6 -6
- data/app/views/spree/admin/users/_tabs.html.erb +5 -5
- data/app/views/spree/admin/users/edit.html.erb +14 -15
- data/app/views/spree/admin/users/index.html.erb +14 -12
- data/app/views/spree/admin/users/items.html.erb +7 -7
- data/app/views/spree/admin/users/new.html.erb +1 -1
- data/app/views/spree/admin/users/orders.html.erb +7 -7
- data/app/views/spree/admin/variants/_form.html.erb +2 -2
- data/app/views/spree/admin/variants/_table.html.erb +2 -2
- data/app/views/spree/admin/variants/_table_filter.html.erb +5 -5
- data/app/views/spree/admin/variants/index.html.erb +8 -8
- data/app/views/spree/admin/variants/new.html.erb +1 -1
- data/app/views/spree/admin/zones/_form.html.erb +10 -6
- data/app/views/spree/admin/zones/edit.html.erb +1 -1
- data/app/views/spree/admin/zones/index.html.erb +3 -3
- data/app/views/spree/admin/zones/new.html.erb +2 -2
- data/app/views/spree/layouts/admin.html.erb +1 -1
- data/app/views/spree/layouts/admin_style_guide.html.erb +2 -2
- data/config/routes.rb +1 -11
- data/lib/spree/backend.rb +1 -2
- data/solidus_backend.gemspec +1 -3
- data/spec/controllers/spree/admin/cancellations_controller_spec.rb +3 -3
- data/spec/controllers/spree/admin/orders_controller_spec.rb +9 -9
- data/spec/controllers/spree/admin/payment_methods_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/prices_controller_spec.rb +2 -2
- data/spec/controllers/spree/admin/products_controller_spec.rb +2 -1
- data/spec/controllers/spree/admin/promotion_codes_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/promotions_controller_spec.rb +7 -0
- data/spec/controllers/spree/admin/reports_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/resource_controller_spec.rb +2 -2
- data/spec/controllers/spree/admin/search_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/stock_locations_controller_spec.rb +4 -4
- data/spec/controllers/spree/admin/users_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/variants_controller_spec.rb +13 -3
- data/spec/features/admin/configuration/payment_methods_spec.rb +55 -16
- data/spec/features/admin/configuration/shipping_methods_spec.rb +40 -0
- data/spec/features/admin/homepage_spec.rb +25 -8
- data/spec/features/admin/orders/adjustments_spec.rb +2 -2
- data/spec/features/admin/orders/customer_details_spec.rb +24 -9
- data/spec/features/admin/orders/listing_spec.rb +6 -9
- data/spec/features/admin/orders/log_entries_spec.rb +0 -1
- data/spec/features/admin/orders/new_order_spec.rb +8 -2
- data/spec/features/admin/orders/order_details_spec.rb +116 -74
- data/spec/features/admin/orders/payments_spec.rb +7 -10
- data/spec/features/admin/orders/shipments_spec.rb +9 -5
- data/spec/features/admin/payments/store_credits_spec.rb +2 -2
- data/spec/features/admin/products/edit/images_spec.rb +0 -79
- data/spec/features/admin/products/products_spec.rb +3 -6
- data/spec/features/admin/products/variant_spec.rb +17 -0
- data/spec/features/admin/promotion_adjustments_spec.rb +105 -52
- data/spec/features/admin/promotions/option_value_rule_spec.rb +6 -3
- data/spec/features/admin/promotions/tiered_calculator_spec.rb +4 -2
- data/spec/features/admin/users_spec.rb +14 -11
- data/spec/javascripts/translation_spec.js +8 -0
- data/spec/javascripts/views/number_with_currency_spec.js +6 -6
- data/spec/spec_helper.rb +28 -37
- data/spec/teaspoon_env.rb +61 -14
- data/spec/views/spree/admin/shared/navigation_footer_spec.rb +41 -0
- data/vendor/assets/javascripts/solidus_admin/Sortable.js +1540 -0
- data/vendor/assets/javascripts/solidus_admin/bootstrap.js +1878 -1816
- data/vendor/assets/javascripts/solidus_admin/flatpickr/flatpickr.js +2218 -0
- data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_es-MX.js +19 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_alert.scss +7 -4
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_badge.scss +1 -2
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_breadcrumb.scss +4 -4
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_button-group.scss +32 -64
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_buttons.scss +38 -36
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_card.scss +78 -31
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_carousel.scss +6 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_close.scss +8 -3
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_code.scss +4 -12
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_custom-forms.scss +132 -89
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_dropdown.scss +46 -43
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_forms.scss +47 -104
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_functions.scss +8 -12
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_grid.scss +0 -1
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_images.scss +0 -1
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_input-group.scss +103 -120
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_list-group.scss +2 -1
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_mixins.scss +1 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_modal.scss +36 -10
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_nav.scss +7 -7
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_navbar.scss +35 -8
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_pagination.scss +33 -22
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_popover.scss +106 -118
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_print.scss +19 -6
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_progress.scss +5 -4
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_reboot.scss +39 -38
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_root.scss +19 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_tables.scss +40 -28
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_tooltip.scss +65 -57
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_transitions.scss +2 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_type.scss +4 -2
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_variables.scss +546 -489
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/bootstrap-grid.scss +8 -13
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/bootstrap-reboot.scss +7 -4
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/bootstrap.scss +5 -4
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_alert.scss +1 -1
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_background-variant.scss +10 -1
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_badge.scss +2 -2
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_breakpoints.scss +25 -7
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_buttons.scss +50 -24
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_caret.scss +65 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_float.scss +2 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_forms.scss +72 -16
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_gradients.scss +8 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_grid-framework.scss +15 -4
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_grid.scss +10 -5
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_hover.scss +25 -46
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_image.scss +3 -3
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_list-group.scss +10 -15
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_navbar-align.scss +2 -1
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_reset-text.scss +1 -2
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_screen-reader.scss +3 -3
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_text-emphasis.scss +2 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_text-hide.scss +1 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/mixins/_visibility.scss +2 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_align.scss +2 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_background.scss +16 -3
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_borders.scss +10 -3
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_display.scss +13 -28
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_flex.scss +2 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_position.scss +12 -1
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_sizing.scss +2 -0
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_spacing.scss +24 -14
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/utilities/_text.scss +7 -4
- data/vendor/assets/stylesheets/solidus_admin/flatpickr/flatpickr.css +857 -0
- metadata +57 -127
- data/Gemfile +0 -9
- data/app/assets/javascripts/spree/backend/address_states.js +0 -35
- data/app/assets/javascripts/spree/backend/adjustments.js.coffee +0 -17
- data/app/assets/javascripts/spree/backend/backbone-overrides.js.coffee +0 -23
- data/app/assets/javascripts/spree/backend/components/editable_table.js.coffee +0 -3
- data/app/assets/javascripts/spree/backend/components/tabs.coffee +0 -79
- data/app/assets/javascripts/spree/backend/flash.coffee +0 -17
- data/app/assets/javascripts/spree/backend/gateway.js.coffee +0 -21
- data/app/assets/javascripts/spree/backend/images/index.js.coffee +0 -13
- data/app/assets/javascripts/spree/backend/navigation.coffee +0 -10
- data/app/assets/javascripts/spree/backend/number_field_updater.coffee +0 -41
- data/app/assets/javascripts/spree/backend/payments/edit.js.coffee +0 -33
- data/app/assets/javascripts/spree/backend/progress.coffee +0 -7
- data/app/assets/javascripts/spree/backend/promotions.js.coffee +0 -99
- data/app/assets/javascripts/spree/backend/select_payments.js.coffee +0 -0
- data/app/assets/javascripts/spree/backend/states.coffee +0 -22
- data/app/assets/javascripts/spree/backend/stock_management/index_add_forms.coffee +0 -61
- data/app/assets/javascripts/spree/backend/stock_management/index_update_forms.coffee +0 -66
- data/app/assets/javascripts/spree/backend/stock_management/stock_item.coffee +0 -4
- data/app/assets/javascripts/spree/backend/stock_transfers/count_update_forms.coffee +0 -44
- data/app/assets/javascripts/spree/backend/stock_transfers/edit.coffee +0 -6
- data/app/assets/javascripts/spree/backend/stock_transfers/receive.coffee +0 -5
- data/app/assets/javascripts/spree/backend/stock_transfers/received_counter.coffee +0 -9
- data/app/assets/javascripts/spree/backend/stock_transfers/stock_transfer.coffee +0 -17
- data/app/assets/javascripts/spree/backend/stock_transfers/transfer_item.coffee +0 -48
- data/app/assets/javascripts/spree/backend/stock_transfers/transfer_item_deleting.coffee +0 -22
- data/app/assets/javascripts/spree/backend/stock_transfers/variant_form.coffee +0 -128
- data/app/assets/javascripts/spree/backend/store_credits.js.coffee +0 -40
- data/app/assets/javascripts/spree/backend/style_guide.coffee +0 -2
- data/app/assets/javascripts/spree/backend/taxonomy.js.coffee +0 -108
- data/app/assets/javascripts/spree/backend/taxons.js.coffee +0 -73
- data/app/assets/javascripts/spree/backend/templates/promotions/rules/option_values_select.hbs +0 -1
- data/app/assets/javascripts/spree/backend/templates/stock_transfers/transfer_item.hbs +0 -48
- data/app/assets/javascripts/spree/backend/variant_autocomplete.js.coffee +0 -39
- data/app/assets/javascripts/spree/backend/views/tables/editable_table.js.coffee +0 -14
- data/app/assets/javascripts/spree/backend/views/tables/editable_table_row.js.coffee +0 -45
- data/app/assets/stylesheets/spree/backend/components/_date-picker.scss +0 -154
- data/app/assets/stylesheets/spree/backend/components/_number_field_update.scss +0 -13
- data/app/assets/stylesheets/spree/backend/sections/_stock_transfers.scss +0 -7
- data/app/assets/stylesheets/spree/backend/sections/_transfer_items.scss +0 -49
- data/app/controllers/spree/admin/stock_transfers_controller.rb +0 -151
- data/app/helpers/spree/admin/general_settings_helper.rb +0 -13
- data/app/helpers/spree/admin/inventory_settings_helper.rb +0 -9
- data/app/helpers/spree/admin/stock_transfers_helper.rb +0 -35
- data/app/helpers/spree/admin/tables_helper.rb +0 -13
- data/app/helpers/spree/admin/taxons_helper.rb +0 -9
- data/app/views/spree/admin/products/new.js.erb +0 -4
- data/app/views/spree/admin/promotions/rules/_landing_page.html.erb +0 -7
- data/app/views/spree/admin/shared/_number_field_update_actions.html.erb +0 -5
- data/app/views/spree/admin/shared/_number_field_update_cell.html.erb +0 -4
- data/app/views/spree/admin/shared/_stock_sub_menu.html.erb +0 -8
- data/app/views/spree/admin/stock_transfers/_location.html.erb +0 -7
- data/app/views/spree/admin/stock_transfers/_transfer_item_actions.html.erb +0 -9
- data/app/views/spree/admin/stock_transfers/_transfer_item_table.html.erb +0 -72
- data/app/views/spree/admin/stock_transfers/edit.html.erb +0 -52
- data/app/views/spree/admin/stock_transfers/index.html.erb +0 -123
- data/app/views/spree/admin/stock_transfers/new.html.erb +0 -26
- data/app/views/spree/admin/stock_transfers/receive.html.erb +0 -38
- data/app/views/spree/admin/stock_transfers/show.html.erb +0 -50
- data/app/views/spree/admin/stock_transfers/tracking_info.html.erb +0 -46
- data/spec/controllers/spree/admin/stock_transfers_controller_spec.rb +0 -365
- data/spec/features/admin/stock_transfer_spec.rb +0 -115
- data/vendor/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_flat_0_eeeeee_40x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_flat_55_ffffff_40x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_100_f6f6f6_1x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_25_0073ea_1x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_50_dddddd_1x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-icons_0073ea_256x240.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-icons_454545_256x240.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-icons_666666_256x240.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-icons_ff0084_256x240.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
- data/vendor/assets/stylesheets/jquery-ui.datepicker.css.erb +0 -357
@@ -1,52 +0,0 @@
|
|
1
|
-
<% admin_breadcrumb(link_to Spree.t(:stock), spree.admin_stock_items_path) %>
|
2
|
-
<% admin_breadcrumb(link_to plural_resource_name(Spree::StockTransfer), spree.admin_stock_transfers_path) %>
|
3
|
-
<% admin_breadcrumb(@stock_transfer.number) %>
|
4
|
-
|
5
|
-
|
6
|
-
<% content_for :page_actions do %>
|
7
|
-
<li>
|
8
|
-
</li>
|
9
|
-
<li>
|
10
|
-
<%= button_link_to Spree.t(:ready_to_ship),
|
11
|
-
finalize_admin_stock_transfer_path(@stock_transfer),
|
12
|
-
method: 'put',
|
13
|
-
data: { confirm: Spree.t('finalize_stock_transfer.confirm') }
|
14
|
-
%>
|
15
|
-
</li>
|
16
|
-
<% end %>
|
17
|
-
|
18
|
-
<%= form_for [:admin, @stock_transfer] do |f| %>
|
19
|
-
<fieldset class="no-border-top">
|
20
|
-
<div>
|
21
|
-
<label><%= Spree.t(:created_by) %></label>
|
22
|
-
<p><%= @stock_transfer.created_by.email %></p>
|
23
|
-
</div>
|
24
|
-
<%= f.field_container :description do %>
|
25
|
-
<%= f.label :description %>
|
26
|
-
<%= f.text_field :description, value: @stock_transfer.description, maxlength: 255, size: 0, class: 'fullwidth' %>
|
27
|
-
<%= f.error_message_on :description %>
|
28
|
-
<% end %>
|
29
|
-
<%= f.field_container :destination_location do %>
|
30
|
-
<%= f.label :destination_location_id %>
|
31
|
-
<%= f.select :destination_location_id, options_from_collection_for_select(@destination_stock_locations, :id, :name, @stock_transfer.destination_location_id), {include_blank: true}, {class: 'custom-select fullwidth', "data-placeholder" => Spree.t(:select_a_stock_location)} %>
|
32
|
-
<%= f.error_message_on :destination_location %>
|
33
|
-
<% end %>
|
34
|
-
<div class="filter-actions actions" data-hook="buttons">
|
35
|
-
<%= button Spree.t('actions.save') %>
|
36
|
-
</div>
|
37
|
-
</fieldset>
|
38
|
-
<% end %>
|
39
|
-
|
40
|
-
<fieldset id='stock-transfer-edit-variants'>
|
41
|
-
<legend align="center"><%= Spree.t(:variant_to_add) %></legend>
|
42
|
-
<div data-hook="transfer_item_selection">
|
43
|
-
<%= hidden_field_tag :stock_transfer_number, @stock_transfer.number %>
|
44
|
-
<%= hidden_field_tag :variant_display_attributes, @variant_display_attributes.to_json %>
|
45
|
-
<%= text_field_tag :transfer_item_variant_id, "", class: "variant_autocomplete fullwidth" %>
|
46
|
-
</div>
|
47
|
-
</fieldset>
|
48
|
-
|
49
|
-
<fieldset id='stock-transfer-transfer-items'>
|
50
|
-
<legend align="center"><%= Spree.t(:added) %></legend>
|
51
|
-
<%= render partial: 'transfer_item_table', locals: { transfer_items: @stock_transfer.transfer_items, show_expected: true, show_received: false, show_actions: true } %>
|
52
|
-
</fieldset>
|
@@ -1,123 +0,0 @@
|
|
1
|
-
<% admin_breadcrumb(link_to Spree.t(:stock), spree.admin_stock_items_path) %>
|
2
|
-
<% admin_breadcrumb(plural_resource_name(Spree::StockTransfer)) %>
|
3
|
-
|
4
|
-
|
5
|
-
<% content_for :page_actions do %>
|
6
|
-
<% if can? :create, Spree::StockTransfer %>
|
7
|
-
<li>
|
8
|
-
<%= button_link_to Spree.t(:new_stock_transfer), new_admin_stock_transfer_path %>
|
9
|
-
</li>
|
10
|
-
<% end %>
|
11
|
-
<% end %>
|
12
|
-
|
13
|
-
<% content_for :table_filter_title do %>
|
14
|
-
<%= Spree.t(:search) %>
|
15
|
-
<% end %>
|
16
|
-
|
17
|
-
<% content_for :table_filter do %>
|
18
|
-
<div data-hook="admin_stock_transfers_index_search">
|
19
|
-
<%= search_form_for [:admin, @search] do |f| %>
|
20
|
-
<div class="row">
|
21
|
-
<div class="field-block col-3">
|
22
|
-
<div class="field">
|
23
|
-
<%= f.label nil, Spree::StockLocation.model_name.human %>
|
24
|
-
<%= f.select :source_location_id_or_destination_location_id_eq, options_from_collection_for_select(@stock_locations, :id, :name, params[:q][:source_location_id_or_destination_location_id_eq]), {include_blank: true}, {class: 'custom-select fullwidth'} %>
|
25
|
-
</div>
|
26
|
-
</div>
|
27
|
-
|
28
|
-
<div class="field-block col-3">
|
29
|
-
<div class="date-range-filter field">
|
30
|
-
<%= f.label nil, Spree.t(:date_range) %>
|
31
|
-
<div class="date-range-fields input-group">
|
32
|
-
<%= f.text_field :created_at_gt, class: 'datepicker datepicker-from form-control', include_blank: true, value: params[:q][:created_at_gt], placeholder: Spree.t(:start) %>
|
33
|
-
|
34
|
-
<span class="range-divider input-group-addon">
|
35
|
-
<i class="fa fa-arrow-right"></i>
|
36
|
-
</span>
|
37
|
-
|
38
|
-
<%= f.text_field :created_at_lt, class: 'datepicker datepicker-to form-control', include_blank: true, value: params[:q][:created_at_lt], placeholder: Spree.t(:stop) %>
|
39
|
-
</div>
|
40
|
-
</div>
|
41
|
-
</div>
|
42
|
-
|
43
|
-
<div class="field-block col-3">
|
44
|
-
<div class="field">
|
45
|
-
<%= f.label nil, Spree::StockTransfer.human_attribute_name(:number) %>
|
46
|
-
<%= f.text_field :number_cont, value: params[:q][:number_cont] %>
|
47
|
-
</div>
|
48
|
-
</div>
|
49
|
-
|
50
|
-
<div class="field-block col-3">
|
51
|
-
<div class="field checkbox">
|
52
|
-
<label>
|
53
|
-
<%= f.check_box :closed_at_null, { checked: @show_only_open }, '1', '0' %>
|
54
|
-
<%= Spree.t(:show_only_open_transfers) %>
|
55
|
-
</label>
|
56
|
-
</div>
|
57
|
-
</div>
|
58
|
-
</div>
|
59
|
-
|
60
|
-
<div class="clearfix"></div>
|
61
|
-
|
62
|
-
<div class="actions filter-actions">
|
63
|
-
<div data-hook="admin_stock_transfers_index_search_buttons">
|
64
|
-
<%= button Spree.t(:filter_results) %>
|
65
|
-
</div>
|
66
|
-
</div>
|
67
|
-
<% end %>
|
68
|
-
</div>
|
69
|
-
<% end %>
|
70
|
-
|
71
|
-
<%= paginate @stock_transfers, theme: "solidus_admin" %>
|
72
|
-
|
73
|
-
|
74
|
-
<% if @stock_transfers.any? %>
|
75
|
-
<table class="index" id="listing_stock_transfers">
|
76
|
-
<thead>
|
77
|
-
<tr>
|
78
|
-
<th><%= sort_link @search, :number, Spree.t(:number) %></th>
|
79
|
-
<th><%= sort_link @search, :from, Spree.t(:from) %></th>
|
80
|
-
<th><%= sort_link @search, :to, Spree.t(:to) %></th>
|
81
|
-
<th><%= sort_link @search, :expected_items, Spree.t(:expected) %></th>
|
82
|
-
<th><%= sort_link @search, :received_items, Spree.t(:received) %></th>
|
83
|
-
<th><%= sort_link @search, :shipped_at, Spree.t(:shipped) %></th>
|
84
|
-
<th><%= sort_link @search, :status, Spree.t(:status) %></th>
|
85
|
-
<th class="actions"></th>
|
86
|
-
</tr>
|
87
|
-
</thead>
|
88
|
-
<tbody>
|
89
|
-
<% @stock_transfers.each do |stock_transfer| %>
|
90
|
-
<tr id="<%= spree_dom_id stock_transfer %>">
|
91
|
-
<td><%= handle_stock_transfer(stock_transfer) %></td>
|
92
|
-
<td><%= stock_transfer.source_location.name %></td>
|
93
|
-
<td><%= stock_transfer.destination_location.try(:name) %></td>
|
94
|
-
<td><%= stock_transfer.expected_item_count %></td>
|
95
|
-
<td><%= stock_transfer.received_item_count %></td>
|
96
|
-
<td><%= stock_transfer.shipped_at.try(:to_date) %></td>
|
97
|
-
<td>
|
98
|
-
<span class="pill pill-<%= stock_transfer.closed? ? 'complete' : 'pending' %>">
|
99
|
-
<%= Spree.t(stock_transfer.closed? ? :closed : :open) %>
|
100
|
-
</span>
|
101
|
-
</td>
|
102
|
-
<td class="actions">
|
103
|
-
<% if stock_transfer.receivable? && can?(:edit, stock_transfer) %>
|
104
|
-
<%= link_to_with_icon 'download', Spree.t('actions.receive'), receive_admin_stock_transfer_path(stock_transfer), no_text: true, data: { action: 'receive' } %>
|
105
|
-
<% elsif !stock_transfer.closed? && can?(:edit, stock_transfer) %>
|
106
|
-
<%= link_to_with_icon 'edit', Spree.t('actions.edit'), stock_transfer_edit_or_ship_path(stock_transfer), no_text: true, data: { action: 'edit' } %>
|
107
|
-
<% elsif can?(:show, stock_transfer) %>
|
108
|
-
<%= link_to_with_icon 'eye', Spree.t(:show), admin_stock_transfer_path(stock_transfer), no_text: true, data: { action: 'show' } %>
|
109
|
-
<% end %>
|
110
|
-
</td>
|
111
|
-
</tr>
|
112
|
-
<% end %>
|
113
|
-
</tbody>
|
114
|
-
</table>
|
115
|
-
<% else %>
|
116
|
-
<div class="col-9 no-objects-found">
|
117
|
-
<%= render 'spree/admin/shared/no_objects_found',
|
118
|
-
resource: Spree::StockTransfer,
|
119
|
-
new_resource_url: new_object_url %>
|
120
|
-
</div>
|
121
|
-
<% end %>
|
122
|
-
|
123
|
-
<%= paginate @stock_transfers, theme: "solidus_admin" %>
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<% admin_breadcrumb(link_to Spree.t(:stock), spree.admin_stock_items_path) %>
|
2
|
-
<% admin_breadcrumb(link_to plural_resource_name(Spree::StockTransfer), spree.admin_stock_transfers_path) %>
|
3
|
-
<% admin_breadcrumb(Spree.t(:new_stock_transfer)) %>
|
4
|
-
|
5
|
-
|
6
|
-
<% content_for :page_actions do %>
|
7
|
-
<% end %>
|
8
|
-
|
9
|
-
<%= form_for [:admin, @stock_transfer] do |f| %>
|
10
|
-
<fieldset class="no-border-top">
|
11
|
-
<%= f.field_container :source_location do %>
|
12
|
-
<%= f.label :source_location_id %>
|
13
|
-
<%= f.select :source_location_id, options_from_collection_for_select(@source_stock_locations, :id, :name), {include_blank: true}, {class: 'custom-select fullwidth', "data-placeholder" => Spree.t(:select_a_stock_location)} %>
|
14
|
-
<%= f.error_message_on :source_location %>
|
15
|
-
<% end %>
|
16
|
-
<%= f.field_container :description do %>
|
17
|
-
<%= f.label :description %>
|
18
|
-
<%= f.text_field :description, maxlength: 255, size: 0, class: 'fullwidth' %>
|
19
|
-
<%= f.error_message_on :description %>
|
20
|
-
<% end %>
|
21
|
-
<div class="filter-actions actions" data-hook="buttons">
|
22
|
-
<%= button Spree.t(:continue) %>
|
23
|
-
<%= link_to Spree.t('actions.cancel'), admin_stock_transfers_path, class: 'button' %>
|
24
|
-
</div>
|
25
|
-
</fieldset>
|
26
|
-
<% end %>
|
@@ -1,38 +0,0 @@
|
|
1
|
-
<% admin_breadcrumb("#{Spree.t(:receiving)} #{@stock_transfer.number}") %>
|
2
|
-
|
3
|
-
|
4
|
-
<% content_for :page_actions do %>
|
5
|
-
<li>
|
6
|
-
<%= button_link_to Spree.t(:back_to_stock_transfers_list), admin_stock_transfers_path %>
|
7
|
-
</li>
|
8
|
-
<li>
|
9
|
-
<%= button_link_to Spree.t(:close),
|
10
|
-
close_admin_stock_transfer_path(@stock_transfer),
|
11
|
-
method: 'put',
|
12
|
-
data: { confirm: Spree.t('close_stock_transfer.confirm') } %>
|
13
|
-
</li>
|
14
|
-
<% end %>
|
15
|
-
|
16
|
-
<div id='stock_transfer_summary' class='fullwidth'>
|
17
|
-
<%= render 'spree/admin/stock_transfers/location', stock_transfer: @stock_transfer %>
|
18
|
-
<div class='count-summary'>
|
19
|
-
<span id='total-received-quantity'><%= @stock_transfer.received_item_count %></span>
|
20
|
-
/
|
21
|
-
<span><%= @stock_transfer.expected_item_count %></span>
|
22
|
-
<span class='summary-field'><%= Spree.t(:received) %></span>
|
23
|
-
</div>
|
24
|
-
</div>
|
25
|
-
|
26
|
-
<fieldset>
|
27
|
-
<legend align="center"><%= Spree.t(:variant_to_be_received) %></legend>
|
28
|
-
<div data-hook="transfer_item_selection">
|
29
|
-
<%= hidden_field_tag :stock_transfer_number, @stock_transfer.number %>
|
30
|
-
<%= hidden_field_tag :variant_display_attributes, @variant_display_attributes.to_json %>
|
31
|
-
<%= text_field_tag :transfer_item_variant_id, "", class: "variant_autocomplete fullwidth" %>
|
32
|
-
</div>
|
33
|
-
</fieldset>
|
34
|
-
|
35
|
-
<fieldset id='received-transfer-items'>
|
36
|
-
<legend align="center"><%= Spree.t(:received_items) %></legend>
|
37
|
-
<%= render partial: 'transfer_item_table', locals: { transfer_items: @received_items, show_expected: false, show_received: true, show_actions: true } %>
|
38
|
-
</fieldset>
|
@@ -1,50 +0,0 @@
|
|
1
|
-
<% admin_breadcrumb(link_to Spree.t(:stock), spree.admin_stock_items_path) %>
|
2
|
-
<% admin_breadcrumb(Spree::StockTransfer.model_name.human, @stock_transfer.number) %>
|
3
|
-
|
4
|
-
|
5
|
-
<% content_for :page_actions do %>
|
6
|
-
<li>
|
7
|
-
<%= button_link_to Spree.t(:back_to_stock_transfers_list), admin_stock_transfers_path %>
|
8
|
-
</li>
|
9
|
-
<% end %>
|
10
|
-
|
11
|
-
<fieldset class="no-border-bottom">
|
12
|
-
<%= render 'spree/admin/stock_transfers/location', stock_transfer: @stock_transfer %>
|
13
|
-
|
14
|
-
<div>
|
15
|
-
<label><%= Spree::StockTransfer.human_attribute_name(:description) %></label>
|
16
|
-
<p><%= @stock_transfer.description %></p>
|
17
|
-
</div>
|
18
|
-
|
19
|
-
<div class="row">
|
20
|
-
<div class='field-block col-3'>
|
21
|
-
<label><%= Spree::StockTransfer.human_attribute_name(:created_by_id) %></label>
|
22
|
-
<p><%= @stock_transfer.created_by.email %></p>
|
23
|
-
</div>
|
24
|
-
|
25
|
-
<div class='field-block col-2'>
|
26
|
-
<label><%= Spree::StockTransfer.human_attribute_name(:created_at) %></label>
|
27
|
-
<p><%= @stock_transfer.created_at.try(:to_date) %></p>
|
28
|
-
</div>
|
29
|
-
|
30
|
-
<div class='field-block col-2'>
|
31
|
-
<label><%= Spree::StockTransfer.human_attribute_name(:finalized_at) %></label>
|
32
|
-
<p><%= @stock_transfer.finalized_at.try(:to_date) %></p>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div class='field-block col-3'>
|
36
|
-
<label><%= Spree::StockTransfer.human_attribute_name(:finalized_by_id) %></label>
|
37
|
-
<p><%= @stock_transfer.finalized_by.try(:email) %></p>
|
38
|
-
</div>
|
39
|
-
|
40
|
-
<div class='field-block col-2'>
|
41
|
-
<label><%= Spree::StockTransfer.human_attribute_name(:shipped_at) %></label>
|
42
|
-
<p><%= @stock_transfer.shipped_at.try(:to_date) %></p>
|
43
|
-
</div>
|
44
|
-
</div>
|
45
|
-
</fieldset>
|
46
|
-
|
47
|
-
<fieldset>
|
48
|
-
<legend><%= plural_resource_name(Spree::TransferItem) %></legend>
|
49
|
-
<%= render partial: 'transfer_item_table', locals: { transfer_items: @stock_transfer.transfer_items, show_expected: true, show_received: true, show_actions: false } %>
|
50
|
-
</fieldset>
|
@@ -1,46 +0,0 @@
|
|
1
|
-
<% admin_breadcrumb("#{Spree.t('actions.ship')} #{Spree::StockTransfer.model_name.human} \##{@stock_transfer.number}") %>
|
2
|
-
|
3
|
-
|
4
|
-
<% content_for :page_actions do %>
|
5
|
-
<li>
|
6
|
-
<%= button_link_to Spree.t(:back_to_stock_transfers_list), admin_stock_transfers_path %>
|
7
|
-
</li>
|
8
|
-
<li>
|
9
|
-
<%= button_link_to Spree.t('actions.ship'),
|
10
|
-
ship_admin_stock_transfer_path(@stock_transfer),
|
11
|
-
method: 'put',
|
12
|
-
data: { confirm: Spree.t('ship_stock_transfer.confirm') }
|
13
|
-
%>
|
14
|
-
</li>
|
15
|
-
<% end %>
|
16
|
-
|
17
|
-
<div id='stock_transfer_summary' class='fullwidth'>
|
18
|
-
<%= render 'spree/admin/stock_transfers/location', stock_transfer: @stock_transfer %>
|
19
|
-
<div class='shipment-description'>
|
20
|
-
<div class='summary-field creator'><%= Spree::StockTransfer.human_attribute_name(:created_by) %>: <%= @stock_transfer.created_by.email %></div>
|
21
|
-
<div class='summary-field description'><%= @stock_transfer.description %></div>
|
22
|
-
</div>
|
23
|
-
</div>
|
24
|
-
|
25
|
-
<fieldset>
|
26
|
-
<legend align='center'><%= Spree.t(:tracking_info) %></legend>
|
27
|
-
<%= form_for [:admin, @stock_transfer] do |f| %>
|
28
|
-
<div class='field-block'>
|
29
|
-
<div class='field'>
|
30
|
-
<%= f.label :tracking_number %>
|
31
|
-
<%= f.text_field :tracking_number, value: @stock_transfer.tracking_number, maxlength: 255, size: 0, class: 'fullwidth' %>
|
32
|
-
</div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div class='clearfix'></div>
|
36
|
-
|
37
|
-
<div class="actions filter-actions add_tracking_number">
|
38
|
-
<%= f.submit Spree.t('actions.save') %>
|
39
|
-
</div>
|
40
|
-
<% end %>
|
41
|
-
</fieldset>
|
42
|
-
|
43
|
-
<fieldset id='stock-transfer-transfer-items'>
|
44
|
-
<legend align="center"><%= plural_resource_name(Spree::TransferItem) %></legend>
|
45
|
-
<%= render partial: 'transfer_item_table', locals: { transfer_items: @stock_transfer.transfer_items, show_expected: true, show_received: false, show_actions: false } %>
|
46
|
-
</fieldset>
|
@@ -1,365 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Spree
|
4
|
-
describe Admin::StockTransfersController, type: :controller do
|
5
|
-
stub_authorization!
|
6
|
-
|
7
|
-
let(:warehouse) { StockLocation.create(name: "Warehouse") }
|
8
|
-
let(:ny_store) { StockLocation.create(name: "NY Store") }
|
9
|
-
let(:la_store) { StockLocation.create(name: "LA Store") }
|
10
|
-
|
11
|
-
context "#index" do
|
12
|
-
let!(:stock_transfer1) {
|
13
|
-
StockTransfer.create do |transfer|
|
14
|
-
transfer.source_location_id = warehouse.id
|
15
|
-
transfer.destination_location_id = ny_store.id
|
16
|
-
end
|
17
|
-
}
|
18
|
-
|
19
|
-
let!(:stock_transfer2) {
|
20
|
-
StockTransfer.create do |transfer|
|
21
|
-
transfer.source_location_id = warehouse.id
|
22
|
-
transfer.destination_location_id = la_store.id
|
23
|
-
transfer.finalized_at = DateTime.current
|
24
|
-
transfer.closed_at = DateTime.current
|
25
|
-
end
|
26
|
-
}
|
27
|
-
|
28
|
-
describe "stock location filtering" do
|
29
|
-
let(:user) { create(:admin_user) }
|
30
|
-
let(:ability) { Spree::Ability.new(user) }
|
31
|
-
let!(:sf_store) { StockLocation.create(name: "SF Store") }
|
32
|
-
|
33
|
-
before do
|
34
|
-
ability.cannot :manage, Spree::StockLocation
|
35
|
-
ability.can :display, Spree::StockLocation, id: [warehouse.id]
|
36
|
-
ability.can :display, Spree::StockLocation, id: [ny_store.id, la_store.id]
|
37
|
-
|
38
|
-
allow_any_instance_of(Spree::Admin::BaseController).to receive(:spree_current_user).and_return(user)
|
39
|
-
allow_any_instance_of(Spree::Admin::BaseController).to receive(:current_ability).and_return(ability)
|
40
|
-
end
|
41
|
-
|
42
|
-
it "doesn't display stock locations the user doesn't have access to" do
|
43
|
-
get :index
|
44
|
-
expect(assigns(:stock_locations)).to match_array [warehouse, ny_store, la_store]
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
it "searches by stock location" do
|
49
|
-
get :index, params: { q: { source_location_id_or_destination_location_id_eq: ny_store.id } }
|
50
|
-
expect(assigns(:stock_transfers).count).to eq 1
|
51
|
-
expect(assigns(:stock_transfers)).to include(stock_transfer1)
|
52
|
-
end
|
53
|
-
|
54
|
-
it "filters the closed stock transfers" do
|
55
|
-
get :index, params: { q: { closed_at_null: '1' } }
|
56
|
-
expect(assigns(:stock_transfers)).to match_array [stock_transfer1]
|
57
|
-
end
|
58
|
-
|
59
|
-
it "doesn't filter any stock transfers" do
|
60
|
-
get :index, params: { q: { closed_at_null: '0' } }
|
61
|
-
expect(assigns(:stock_transfers)).to match_array [stock_transfer1, stock_transfer2]
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
context "#create" do
|
66
|
-
let(:warehouse) { StockLocation.create(name: "Warehouse", active: false) }
|
67
|
-
|
68
|
-
subject do
|
69
|
-
post :create, params: { stock_transfer: { source_location_id: warehouse.id, description: nil } }
|
70
|
-
end
|
71
|
-
|
72
|
-
context "user doesn't have read access to the selected stock location" do
|
73
|
-
before do
|
74
|
-
expect(controller).to receive(:authorize!) { raise CanCan::AccessDenied }
|
75
|
-
end
|
76
|
-
|
77
|
-
it "redirects to authorization_failure" do
|
78
|
-
subject
|
79
|
-
expect(response).to redirect_to('/unauthorized')
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
context "valid parameters" do
|
84
|
-
let!(:user) { create(:user) }
|
85
|
-
|
86
|
-
before do
|
87
|
-
allow(controller).to receive(:try_spree_current_user) { user }
|
88
|
-
end
|
89
|
-
|
90
|
-
it "redirects to the edit page" do
|
91
|
-
subject
|
92
|
-
expect(response).to redirect_to(spree.edit_admin_stock_transfer_path(assigns(:stock_transfer)))
|
93
|
-
end
|
94
|
-
|
95
|
-
it "sets the created_by to the current user" do
|
96
|
-
subject
|
97
|
-
expect(assigns(:stock_transfer).created_by).to eq(user)
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
# Regression spec for Solidus issue #1087
|
102
|
-
context "missing source_stock_location parameter" do
|
103
|
-
subject do
|
104
|
-
post :create, params: { stock_transfer: { source_location_id: nil, description: nil } }
|
105
|
-
end
|
106
|
-
|
107
|
-
it "sets a flash error" do
|
108
|
-
subject
|
109
|
-
expect(flash[:error]).to eq assigns(:stock_transfer).errors.full_messages.join(', ')
|
110
|
-
end
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
|
-
context "#receive" do
|
115
|
-
let!(:transfer_with_items) { create(:receivable_stock_transfer_with_items) }
|
116
|
-
let(:variant_1) { transfer_with_items.transfer_items[0].variant }
|
117
|
-
let(:variant_2) { transfer_with_items.transfer_items[1].variant }
|
118
|
-
let(:parameters) { { id: transfer_with_items.to_param } }
|
119
|
-
|
120
|
-
subject do
|
121
|
-
get :receive, params: parameters
|
122
|
-
end
|
123
|
-
|
124
|
-
context 'stock transfer is not receivable' do
|
125
|
-
before do
|
126
|
-
transfer_with_items.update_attributes(finalized_at: nil, shipped_at: nil)
|
127
|
-
end
|
128
|
-
|
129
|
-
it 'redirects back to index' do
|
130
|
-
subject
|
131
|
-
expect(flash[:error]).to eq Spree.t(:stock_transfer_must_be_receivable)
|
132
|
-
expect(response).to redirect_to(spree.admin_stock_transfers_path)
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
context "no items have been received" do
|
137
|
-
let(:parameters) do
|
138
|
-
{ id: transfer_with_items.to_param }
|
139
|
-
end
|
140
|
-
|
141
|
-
before { subject }
|
142
|
-
|
143
|
-
it "doesn't assign received_items" do
|
144
|
-
expect(assigns(:received_items)).to be_empty
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
context "some items have been received" do
|
149
|
-
let(:transfer_item) { transfer_with_items.transfer_items.first }
|
150
|
-
let(:parameters) do
|
151
|
-
{ id: transfer_with_items.to_param, variant_search_term: variant_1.sku }
|
152
|
-
end
|
153
|
-
|
154
|
-
before do
|
155
|
-
transfer_item.update_attributes(received_quantity: 1)
|
156
|
-
subject
|
157
|
-
end
|
158
|
-
|
159
|
-
it "assigns received_items correctly" do
|
160
|
-
expect(assigns(:received_items)).to match_array [transfer_item]
|
161
|
-
end
|
162
|
-
end
|
163
|
-
end
|
164
|
-
|
165
|
-
context "#finalize" do
|
166
|
-
let!(:user) { create(:user) }
|
167
|
-
let!(:transfer_with_items) { create(:receivable_stock_transfer_with_items, finalized_at: nil, shipped_at: nil) }
|
168
|
-
|
169
|
-
before do
|
170
|
-
allow(controller).to receive(:try_spree_current_user) { user }
|
171
|
-
end
|
172
|
-
|
173
|
-
subject do
|
174
|
-
put :finalize, params: { id: transfer_with_items.to_param }
|
175
|
-
end
|
176
|
-
|
177
|
-
context 'stock transfer is not finalizable' do
|
178
|
-
before do
|
179
|
-
transfer_with_items.update_attributes(finalized_at: Time.current)
|
180
|
-
end
|
181
|
-
|
182
|
-
it 'redirects back to edit' do
|
183
|
-
subject
|
184
|
-
expect(flash[:error]).to eq Spree.t(:stock_transfer_cannot_be_finalized)
|
185
|
-
expect(response).to redirect_to(spree.edit_admin_stock_transfer_path(transfer_with_items))
|
186
|
-
end
|
187
|
-
end
|
188
|
-
|
189
|
-
context "successfully finalized" do
|
190
|
-
it "redirects to tracking_info" do
|
191
|
-
subject
|
192
|
-
expect(response).to redirect_to(spree.tracking_info_admin_stock_transfer_path(transfer_with_items))
|
193
|
-
end
|
194
|
-
|
195
|
-
it "sets the finalized_by to the current user" do
|
196
|
-
subject
|
197
|
-
expect(transfer_with_items.reload.finalized_by).to eq(user)
|
198
|
-
end
|
199
|
-
|
200
|
-
it "sets the finalized_at date" do
|
201
|
-
subject
|
202
|
-
expect(transfer_with_items.reload.finalized_at).to_not be_nil
|
203
|
-
end
|
204
|
-
end
|
205
|
-
|
206
|
-
context "error finalizing the stock transfer" do
|
207
|
-
before do
|
208
|
-
transfer_with_items.update_attributes(destination_location_id: nil)
|
209
|
-
end
|
210
|
-
|
211
|
-
it "redirects back to edit" do
|
212
|
-
subject
|
213
|
-
expect(response).to redirect_to(spree.edit_admin_stock_transfer_path(transfer_with_items))
|
214
|
-
end
|
215
|
-
|
216
|
-
it "displays a flash error message" do
|
217
|
-
subject
|
218
|
-
expect(flash[:error]).to eq "Destination location can't be blank"
|
219
|
-
end
|
220
|
-
end
|
221
|
-
end
|
222
|
-
|
223
|
-
context "#close" do
|
224
|
-
let!(:user) { create(:user) }
|
225
|
-
let!(:transfer_with_items) { create(:receivable_stock_transfer_with_items) }
|
226
|
-
|
227
|
-
before do
|
228
|
-
allow(controller).to receive(:try_spree_current_user) { user }
|
229
|
-
end
|
230
|
-
|
231
|
-
subject do
|
232
|
-
put :close, params: { id: transfer_with_items.to_param }
|
233
|
-
end
|
234
|
-
|
235
|
-
context 'stock transfer is not receivable' do
|
236
|
-
before do
|
237
|
-
transfer_with_items.update_attributes(finalized_at: nil, shipped_at: nil)
|
238
|
-
end
|
239
|
-
|
240
|
-
it 'redirects back to receive' do
|
241
|
-
subject
|
242
|
-
expect(flash[:error]).to eq Spree.t(:stock_transfer_must_be_receivable)
|
243
|
-
expect(response).to redirect_to(spree.receive_admin_stock_transfer_path(transfer_with_items))
|
244
|
-
end
|
245
|
-
end
|
246
|
-
|
247
|
-
context "successfully closed" do
|
248
|
-
it "redirects back to index" do
|
249
|
-
subject
|
250
|
-
expect(response).to redirect_to(spree.admin_stock_transfers_path)
|
251
|
-
end
|
252
|
-
|
253
|
-
it "sets the closed_by to the current user" do
|
254
|
-
subject
|
255
|
-
expect(transfer_with_items.reload.closed_by).to eq(user)
|
256
|
-
end
|
257
|
-
|
258
|
-
it "sets the closed_at date" do
|
259
|
-
subject
|
260
|
-
expect(transfer_with_items.reload.closed_at).to_not be_nil
|
261
|
-
end
|
262
|
-
|
263
|
-
context "stock movements" do
|
264
|
-
let(:source) { transfer_with_items.source_location }
|
265
|
-
let(:destination) { transfer_with_items.destination_location }
|
266
|
-
let(:transfer_item_1) { transfer_with_items.transfer_items[0] }
|
267
|
-
let(:transfer_item_2) { transfer_with_items.transfer_items[1] }
|
268
|
-
|
269
|
-
before do
|
270
|
-
transfer_item_1.update_columns(received_quantity: 2)
|
271
|
-
transfer_item_2.update_columns(received_quantity: 5)
|
272
|
-
subject
|
273
|
-
end
|
274
|
-
|
275
|
-
it 'creates 2 stock movements' do
|
276
|
-
expect(assigns(:stock_movements).length).to eq 2
|
277
|
-
end
|
278
|
-
|
279
|
-
it 'sets the stock transfer as the originator of the stock movements' do
|
280
|
-
subject
|
281
|
-
originators = assigns(:stock_movements).map(&:originator)
|
282
|
-
expect(originators).to match_array [transfer_with_items, transfer_with_items]
|
283
|
-
end
|
284
|
-
|
285
|
-
it 'only creates stock movements for the destination stock location' do
|
286
|
-
subject
|
287
|
-
locations = assigns(:stock_movements).map(&:stock_item).flat_map(&:stock_location)
|
288
|
-
expect(locations).to match_array [destination, destination]
|
289
|
-
end
|
290
|
-
|
291
|
-
it 'creates the stock movements for the received quantities' do
|
292
|
-
subject
|
293
|
-
movement_for_transfer_item_1 = assigns(:stock_movements).find { |sm| sm.stock_item.variant == transfer_item_1.variant }
|
294
|
-
expect(movement_for_transfer_item_1.quantity).to eq 2
|
295
|
-
movement_for_transfer_item_2 = assigns(:stock_movements).find { |sm| sm.stock_item.variant == transfer_item_2.variant }
|
296
|
-
expect(movement_for_transfer_item_2.quantity).to eq 5
|
297
|
-
end
|
298
|
-
end
|
299
|
-
end
|
300
|
-
|
301
|
-
context "error closing the stock transfer" do
|
302
|
-
before do
|
303
|
-
transfer_with_items.update_columns(destination_location_id: nil)
|
304
|
-
end
|
305
|
-
|
306
|
-
it "redirects back to receive" do
|
307
|
-
subject
|
308
|
-
expect(response).to redirect_to(spree.receive_admin_stock_transfer_path(transfer_with_items))
|
309
|
-
end
|
310
|
-
|
311
|
-
it "displays a flash error message" do
|
312
|
-
subject
|
313
|
-
expect(flash[:error]).to eq "Destination location can't be blank"
|
314
|
-
end
|
315
|
-
end
|
316
|
-
end
|
317
|
-
|
318
|
-
context "#ship" do
|
319
|
-
let(:stock_transfer) { Spree::StockTransfer.create(source_location: warehouse, destination_location: ny_store, created_by: create(:admin_user)) }
|
320
|
-
let(:transfer_variant) { create(:variant) }
|
321
|
-
let(:warehouse_stock_item) { warehouse.stock_items.find_by(variant: transfer_variant) }
|
322
|
-
let(:ny_stock_item) { ny_store.stock_items.find_by(variant: transfer_variant) }
|
323
|
-
|
324
|
-
subject { put :ship, params: { id: stock_transfer.number } }
|
325
|
-
|
326
|
-
before do
|
327
|
-
warehouse_stock_item.set_count_on_hand(1)
|
328
|
-
stock_transfer.transfer_items.create!(variant: transfer_variant, expected_quantity: 1)
|
329
|
-
end
|
330
|
-
|
331
|
-
context "with transferable items" do
|
332
|
-
it "marks the transfer shipped" do
|
333
|
-
subject
|
334
|
-
|
335
|
-
expect(stock_transfer.reload.shipped_at).to_not be_nil
|
336
|
-
expect(flash[:success]).to be_present
|
337
|
-
end
|
338
|
-
|
339
|
-
it "makes stock movements for the transferred items" do
|
340
|
-
subject
|
341
|
-
|
342
|
-
expect(Spree::StockMovement.count).to eq 1
|
343
|
-
expect(warehouse_stock_item.reload.count_on_hand).to eq 0
|
344
|
-
end
|
345
|
-
end
|
346
|
-
|
347
|
-
context "with non-transferable items" do
|
348
|
-
before { warehouse_stock_item.set_count_on_hand(0) }
|
349
|
-
|
350
|
-
it "does not mark the transfer shipped" do
|
351
|
-
subject
|
352
|
-
|
353
|
-
expect(stock_transfer.reload.shipped_at).to be_nil
|
354
|
-
end
|
355
|
-
|
356
|
-
it "errors and redirects to tracking_info page" do
|
357
|
-
subject
|
358
|
-
|
359
|
-
expect(flash[:error]).to match /not enough inventory/
|
360
|
-
expect(response).to redirect_to(spree.tracking_info_admin_stock_transfer_path(stock_transfer))
|
361
|
-
end
|
362
|
-
end
|
363
|
-
end
|
364
|
-
end
|
365
|
-
end
|