Fix ruby syntax error
Merge pull request #5140 from camelmasa/fix-syntax-error

Fix ruby syntax error
Return item cancellation

Creating a new return item should cancel any other return items with the same inventory unit.
This ensures an inventory unit can only be active in a single RMA at a time.
This allows history to be preserved but still allow new RMAs to be created to replace old ones.

Fixes #5048
add validation to verify that count_on_hand of backorderable should not go negative if it is not backorderable

Fixes #3808
add a before_transition to verify if order is resumed only if there are no insufficient stock lines
Fixes #3819
Revert "Set missing credit card attributes when possible. Fixes #4972"

This reverts commit 4ff85703edafd4c607e9b21d439f1d193ccee519.
Create Spree::Promotion::Taxon rule.

Fixes #4477
Fix typo.
Fix API::Orders#create  for admins.
Fix duplicated promotion rule
Fixes #5144
Refund preferences & Reimbursement Items

- Allow admins and customers to specify refund types
  - Provide a field for customers to specify a refund method preference at RMA time
  - Allow admins to specify an override refund method at reimbursement time
- Break out reimbursement_items from return_items into a separate DB table
  - Paves the way for non-return reimbursements. It also makes ReturnItem a bit simpler.

Minor:

- Fix the x icon on select2 selectboxes.
- Convert CustomerReturnsController into a ResourceController

Generated by @jordan-brough and @richardnuno

Fixes #5146
Default credit card per user

When an order is completed, we save the credit card used as the user's
default credit card. When creating a new order, we use an existing
credit card (if it exists) and attach it to the order before reaching
the payment state.

Fixes #5148
Add changelog entries for default address and credit card

See #5108 and #5148 for the actual changes.
Added payment source import from Order hash.

Fixes #5145
Fixes #5147
Fix source import specs.
Payments pass source not source_attributes.
Add default ReturnAuthorizationReasons

As per chat w/ @JDutil on IRC

Also fix similar ReimbursementType migration

Fixes #5154
RMA form fix and cancel fix

- Remove form field when the return item cannot be added.  Looks weird and it also causes nested attributes to raise.
- Cancel associated return items when canceling an RMA.  Return Item validations will ensure they can be canceled.

Fixes #5156
Stop spree_sample:load creating a duplicate record

Spree::ShippingCategory.create!(:name => "Default") is run in the following migration https://github.com/spree/spree/blob/master/core/db/migrate/20130830001033_add_shipping_category_to_shipping_methods_and_products.rb therefore a create command here would create a duplicate if a db:migrate had been run prior. shipping_categories.rb could be removed from samples completely but users of db:reset (that uses db:schema:load and loads the db from schema not migrations) would need it to be created here.

Fixes #5161
Revert ReimbursementItem model

This removes ReimbursementItem model and squishes it back into the ReturnItem model.
We split this model out of ReturnItem and we still think that's a good idea.  But we've run into some issues with it so we'll have to look at adding it back in later when we can work through all the details.

Fixes #5160