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.5.2 db/samples/reimbursements.rb
solidus_sample-2.5.1 db/samples/reimbursements.rb
solidus_sample-2.5.0 db/samples/reimbursements.rb
solidus_sample-2.5.0.rc1 db/samples/reimbursements.rb
solidus_sample-2.5.0.beta2 db/samples/reimbursements.rb
solidus_sample-2.5.0.beta1 db/samples/reimbursements.rb
solidus_sample-2.4.2 db/samples/reimbursements.rb
solidus_sample-2.2.2 db/samples/reimbursements.rb
solidus_sample-2.4.1 db/samples/reimbursements.rb
solidus_sample-2.3.1 db/samples/reimbursements.rb
solidus_sample-2.1.1 db/samples/reimbursements.rb
solidus_sample-2.0.3 db/samples/reimbursements.rb
solidus_sample-1.4.2 db/samples/reimbursements.rb
solidus_sample-2.4.0 db/samples/reimbursements.rb
solidus_sample-2.4.0.rc1 db/samples/reimbursements.rb
solidus_sample-2.4.0.beta1 db/samples/reimbursements.rb
solidus_sample-2.3.0 db/samples/reimbursements.rb
solidus_sample-2.3.0.rc3 db/samples/reimbursements.rb
solidus_sample-2.3.0.rc2 db/samples/reimbursements.rb
solidus_sample-2.3.0.rc1 db/samples/reimbursements.rb