Sha256: f3c6ecfaab968f346d5f27c27723606217209fbfe1be91332cf98064c860bf55

Contents?: true

Size: 603 Bytes

Versions: 37

Compression:

Stored size: 603 Bytes

Contents

Spree::Sample.load_sample("orders")

order          = Spree::Order.last
inventory_unit = order.inventory_units.first
stock_location = inventory_unit.find_stock_item.stock_location

return_item = Spree::ReturnItem.create(inventory_unit: inventory_unit)

return_item.exchange_variant = return_item.eligible_exchange_variants.last
return_item.build_exchange_inventory_unit
return_item.accept!

customer_return = Spree::CustomerReturn.create(
  stock_location: stock_location,
  return_items: [return_item]
)

order.reimbursements.create(
  customer_return: customer_return,
  return_items: [return_item]
)

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
solidus_sample-2.3.0.beta1 db/samples/reimbursements.rb
solidus_sample-2.0.2 db/samples/reimbursements.rb
solidus_sample-1.4.1 db/samples/reimbursements.rb
solidus_sample-2.2.1 db/samples/reimbursements.rb
solidus_sample-2.2.0 db/samples/reimbursements.rb
solidus_sample-2.2.0.rc1 db/samples/reimbursements.rb
solidus_sample-2.2.0.beta1 db/samples/reimbursements.rb
solidus_sample-2.1.0 db/samples/reimbursements.rb
solidus_sample-2.1.0.rc1 db/samples/reimbursements.rb
solidus_sample-2.0.1 db/samples/reimbursements.rb
solidus_sample-2.1.0.beta1 db/samples/reimbursements.rb
solidus_sample-2.0.0 db/samples/reimbursements.rb
solidus_sample-1.4.0 db/samples/reimbursements.rb
solidus_sample-2.0.0.rc1 db/samples/reimbursements.rb
solidus_sample-1.4.0.rc1 db/samples/reimbursements.rb
solidus_sample-2.0.0.beta1 db/samples/reimbursements.rb
solidus_sample-1.4.0.beta1 db/samples/reimbursements.rb