solidus_core 2.3.1 → 2.4.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_core might be problematic. Click here for more details.

Files changed (799) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/spree/base_controller.rb +0 -1
  3. data/app/models/concerns/spree/calculated_adjustments.rb +2 -0
  4. data/app/models/concerns/spree/user_methods.rb +19 -3
  5. data/app/models/spree/address.rb +5 -11
  6. data/app/models/spree/adjustment.rb +10 -1
  7. data/app/models/spree/base.rb +4 -0
  8. data/app/models/spree/calculator/default_tax.rb +7 -18
  9. data/app/models/spree/calculator/returns/default_refund_amount.rb +3 -3
  10. data/app/models/spree/calculator.rb +2 -3
  11. data/app/models/spree/customer_return.rb +6 -3
  12. data/app/models/spree/exchange.rb +1 -1
  13. data/app/models/spree/fulfilment_changer.rb +125 -0
  14. data/app/models/spree/legacy_user.rb +0 -8
  15. data/app/models/spree/line_item.rb +24 -7
  16. data/app/models/spree/order/checkout.rb +2 -2
  17. data/app/models/spree/order.rb +42 -47
  18. data/app/models/spree/order_cancellations.rb +1 -1
  19. data/app/models/spree/order_capturing.rb +2 -0
  20. data/app/models/spree/order_shipping.rb +1 -1
  21. data/app/models/spree/order_update_attributes.rb +0 -2
  22. data/app/models/spree/order_updater.rb +4 -4
  23. data/app/models/spree/payment/cancellation.rb +60 -0
  24. data/app/models/spree/payment/processing.rb +1 -2
  25. data/app/models/spree/payment.rb +4 -7
  26. data/app/models/spree/payment_method/bogus_credit_card.rb +2 -1
  27. data/app/models/spree/payment_method/check.rb +1 -2
  28. data/app/models/spree/payment_method/store_credit.rb +4 -3
  29. data/app/models/spree/payment_method.rb +19 -2
  30. data/app/models/spree/promotion.rb +1 -1
  31. data/app/models/spree/promotion_action.rb +2 -1
  32. data/app/models/spree/promotion_handler/coupon.rb +1 -1
  33. data/app/models/spree/promotion_handler/free_shipping.rb +6 -58
  34. data/app/models/spree/promotion_handler/shipping.rb +55 -0
  35. data/app/models/spree/refund.rb +4 -2
  36. data/app/models/spree/reimbursement/credit.rb +17 -15
  37. data/app/models/spree/return_authorization.rb +8 -5
  38. data/app/models/spree/return_item/eligibility_validator/base_validator.rb +19 -15
  39. data/app/models/spree/return_item/eligibility_validator/default.rb +25 -21
  40. data/app/models/spree/return_item/eligibility_validator/inventory_shipped.rb +15 -11
  41. data/app/models/spree/return_item/eligibility_validator/no_reimbursements.rb +16 -11
  42. data/app/models/spree/return_item/eligibility_validator/order_completed.rb +15 -11
  43. data/app/models/spree/return_item/eligibility_validator/rma_required.rb +15 -11
  44. data/app/models/spree/return_item/eligibility_validator/time_since_purchase.rb +15 -11
  45. data/app/models/spree/return_item/exchange_variant_eligibility/same_option_value.rb +37 -35
  46. data/app/models/spree/return_item/exchange_variant_eligibility/same_product.rb +6 -4
  47. data/app/models/spree/return_item.rb +6 -3
  48. data/app/models/spree/shipment.rb +63 -45
  49. data/app/models/spree/shipping_method.rb +1 -1
  50. data/app/models/spree/shipping_rate.rb +2 -0
  51. data/app/models/spree/shipping_rate_tax.rb +1 -5
  52. data/app/models/spree/stock/availability.rb +70 -0
  53. data/app/models/spree/stock/estimator.rb +1 -1
  54. data/app/models/spree/stock/simple_coordinator.rb +105 -0
  55. data/app/models/spree/stock/splitter/base.rb +8 -4
  56. data/app/models/spree/stock/splitter/weight.rb +0 -2
  57. data/app/models/spree/stock/splitter_chain.rb +32 -0
  58. data/app/models/spree/stock_quantities.rb +81 -0
  59. data/app/models/spree/store_credit.rb +7 -15
  60. data/app/models/spree/store_credit_category.rb +1 -1
  61. data/app/models/spree/store_credit_type.rb +3 -1
  62. data/app/models/spree/tax/tax_helpers.rb +3 -35
  63. data/app/models/spree/tax_rate.rb +2 -5
  64. data/app/models/spree/taxon.rb +2 -0
  65. data/app/models/spree/zone.rb +1 -50
  66. data/app/views/spree/order_mailer/confirm_email.html.erb +1 -1
  67. data/app/views/spree/order_mailer/confirm_email.text.erb +1 -1
  68. data/config/locales/en.yml +77 -45
  69. data/db/default/spree/countries.rb +40 -10
  70. data/db/default/spree/store_credit.rb +2 -2
  71. data/db/migrate/20160101010000_solidus_one_four.rb +1153 -0
  72. data/db/migrate/20170831201542_remove_default_tax_from_spree_zones.rb +5 -0
  73. data/db/seeds.rb +15 -2
  74. data/lib/generators/spree/dummy/templates/rails/database.yml +4 -0
  75. data/lib/generators/spree/install/install_generator.rb +0 -1
  76. data/lib/generators/spree/install/templates/config/initializers/spree.rb +0 -12
  77. data/{app/models → lib}/spree/app_configuration.rb +26 -59
  78. data/lib/spree/config.rb +3 -0
  79. data/lib/spree/core/controller_helpers/order.rb +0 -2
  80. data/lib/spree/core/engine.rb +6 -1
  81. data/lib/spree/core/environment.rb +3 -1
  82. data/lib/spree/core/search/base.rb +13 -5
  83. data/lib/spree/core/search/variant.rb +2 -0
  84. data/lib/spree/core/stock_configuration.rb +1 -1
  85. data/lib/spree/core/version.rb +1 -1
  86. data/lib/spree/core.rb +8 -7
  87. data/lib/spree/deprecation.rb +2 -0
  88. data/lib/spree/i18n.rb +1 -0
  89. data/lib/spree/money.rb +2 -0
  90. data/lib/spree/permission_sets/product_management.rb +6 -5
  91. data/{app/models → lib}/spree/preferences/configuration.rb +29 -2
  92. data/lib/spree/preferences/preferable.rb +142 -0
  93. data/{app/models → lib}/spree/preferences/preferable_class_methods.rb +0 -0
  94. data/{app/models → lib}/spree/preferences/scoped_store.rb +0 -0
  95. data/{app/models → lib}/spree/preferences/static_model_preferences.rb +0 -0
  96. data/{app/models → lib}/spree/preferences/statically_configurable.rb +0 -0
  97. data/{app/models → lib}/spree/preferences/store.rb +0 -0
  98. data/lib/spree/promo/environment.rb +1 -0
  99. data/lib/spree/testing_support/ability_helpers.rb +9 -9
  100. data/lib/spree/testing_support/factories/address_factory.rb +2 -3
  101. data/lib/spree/testing_support/factories/adjustment_factory.rb +2 -2
  102. data/lib/spree/testing_support/factories/adjustment_reason_factory.rb +1 -1
  103. data/lib/spree/testing_support/factories/calculator_factory.rb +6 -6
  104. data/lib/spree/testing_support/factories/carton_factory.rb +1 -1
  105. data/lib/spree/testing_support/factories/country_factory.rb +1 -1
  106. data/lib/spree/testing_support/factories/credit_card_factory.rb +1 -1
  107. data/lib/spree/testing_support/factories/customer_return_factory.rb +1 -1
  108. data/lib/spree/testing_support/factories/image_factory.rb +1 -1
  109. data/lib/spree/testing_support/factories/inventory_unit_factory.rb +1 -1
  110. data/lib/spree/testing_support/factories/line_item_factory.rb +1 -1
  111. data/lib/spree/testing_support/factories/option_type_factory.rb +1 -1
  112. data/lib/spree/testing_support/factories/option_value_factory.rb +1 -1
  113. data/lib/spree/testing_support/factories/order_factory.rb +2 -2
  114. data/lib/spree/testing_support/factories/order_promotion_factory.rb +1 -1
  115. data/lib/spree/testing_support/factories/payment_factory.rb +3 -3
  116. data/lib/spree/testing_support/factories/payment_method_factory.rb +4 -4
  117. data/lib/spree/testing_support/factories/price_factory.rb +1 -1
  118. data/lib/spree/testing_support/factories/product_factory.rb +1 -1
  119. data/lib/spree/testing_support/factories/product_option_type_factory.rb +1 -1
  120. data/lib/spree/testing_support/factories/product_property_factory.rb +1 -1
  121. data/lib/spree/testing_support/factories/promotion_category_factory.rb +1 -1
  122. data/lib/spree/testing_support/factories/promotion_factory.rb +1 -1
  123. data/lib/spree/testing_support/factories/property_factory.rb +1 -1
  124. data/lib/spree/testing_support/factories/refund_factory.rb +1 -1
  125. data/lib/spree/testing_support/factories/refund_reason_factory.rb +1 -1
  126. data/lib/spree/testing_support/factories/reimbursement_factory.rb +1 -1
  127. data/lib/spree/testing_support/factories/reimbursement_type_factory.rb +1 -1
  128. data/lib/spree/testing_support/factories/return_authorization_factory.rb +2 -2
  129. data/lib/spree/testing_support/factories/return_item_factory.rb +1 -1
  130. data/lib/spree/testing_support/factories/return_reason_factory.rb +1 -1
  131. data/lib/spree/testing_support/factories/role_factory.rb +1 -1
  132. data/lib/spree/testing_support/factories/shipment_factory.rb +1 -1
  133. data/lib/spree/testing_support/factories/shipping_category_factory.rb +1 -1
  134. data/lib/spree/testing_support/factories/shipping_method_factory.rb +3 -3
  135. data/lib/spree/testing_support/factories/shipping_rate_factory.rb +1 -1
  136. data/lib/spree/testing_support/factories/state_factory.rb +1 -1
  137. data/lib/spree/testing_support/factories/stock_item_factory.rb +1 -1
  138. data/lib/spree/testing_support/factories/stock_location_factory.rb +1 -1
  139. data/lib/spree/testing_support/factories/stock_movement_factory.rb +1 -1
  140. data/lib/spree/testing_support/factories/stock_package_factory.rb +1 -1
  141. data/lib/spree/testing_support/factories/stock_transfer_factory.rb +1 -1
  142. data/lib/spree/testing_support/factories/store_credit_category_factory.rb +1 -1
  143. data/lib/spree/testing_support/factories/store_credit_event_factory.rb +2 -2
  144. data/lib/spree/testing_support/factories/store_credit_factory.rb +1 -1
  145. data/lib/spree/testing_support/factories/store_credit_type_factory.rb +3 -3
  146. data/lib/spree/testing_support/factories/store_credit_update_reason_factory.rb +1 -1
  147. data/lib/spree/testing_support/factories/store_factory.rb +1 -1
  148. data/lib/spree/testing_support/factories/tax_category_factory.rb +1 -1
  149. data/lib/spree/testing_support/factories/tax_rate_factory.rb +1 -1
  150. data/lib/spree/testing_support/factories/taxon_factory.rb +1 -1
  151. data/lib/spree/testing_support/factories/taxonomy_factory.rb +1 -1
  152. data/lib/spree/testing_support/factories/variant_factory.rb +1 -1
  153. data/lib/spree/testing_support/factories/variant_property_rule_condition_factory.rb +1 -1
  154. data/lib/spree/testing_support/factories/variant_property_rule_factory.rb +1 -1
  155. data/lib/spree/testing_support/factories/variant_property_rule_value_factory.rb +1 -1
  156. data/lib/spree/testing_support/factories/zone_factory.rb +2 -2
  157. data/lib/spree/testing_support/preferences.rb +1 -2
  158. data/lib/spree/testing_support/sequences.rb +6 -1
  159. data/lib/tasks/core.rake +17 -10
  160. data/solidus_core.gemspec +0 -6
  161. data/spec/helpers/base_helper_spec.rb +2 -2
  162. data/spec/helpers/products_helper_spec.rb +2 -2
  163. data/spec/helpers/taxons_helper_spec.rb +2 -2
  164. data/spec/jobs/promotion_code_batch_job_spec.rb +2 -2
  165. data/spec/lib/calculated_adjustments_spec.rb +2 -2
  166. data/spec/lib/i18n_spec.rb +2 -2
  167. data/spec/lib/search/base_spec.rb +10 -8
  168. data/spec/lib/search/variant_spec.rb +2 -2
  169. data/spec/lib/spree/core/class_constantizer_spec.rb +2 -1
  170. data/spec/lib/spree/core/controller_helpers/auth_spec.rb +2 -2
  171. data/spec/lib/spree/core/controller_helpers/order_spec.rb +2 -2
  172. data/spec/lib/spree/core/controller_helpers/payment_parameters_spec.rb +2 -2
  173. data/spec/lib/spree/core/controller_helpers/pricing_spec.rb +2 -2
  174. data/spec/lib/spree/core/controller_helpers/search_spec.rb +2 -2
  175. data/spec/lib/spree/core/controller_helpers/store_spec.rb +2 -2
  176. data/spec/lib/spree/core/controller_helpers/strong_parameters_spec.rb +2 -2
  177. data/spec/lib/spree/core/current_store_spec.rb +2 -2
  178. data/spec/lib/spree/core/environment_extension_spec.rb +2 -1
  179. data/spec/lib/spree/core/importer/order_spec.rb +2 -2
  180. data/spec/lib/spree/core/role_configuration_spec.rb +2 -2
  181. data/spec/lib/spree/core/stock_configuration_spec.rb +2 -2
  182. data/spec/lib/spree/core/testing_support/factories/address_factory_spec.rb +1 -1
  183. data/spec/lib/spree/core/testing_support/factories/adjustment_factory_spec.rb +1 -1
  184. data/spec/lib/spree/core/testing_support/factories/adjustment_reason_factory_spec.rb +1 -1
  185. data/spec/lib/spree/core/testing_support/factories/calculator_factory_spec.rb +1 -1
  186. data/spec/lib/spree/core/testing_support/factories/carton_factory_spec.rb +1 -1
  187. data/spec/lib/spree/core/testing_support/factories/country_factory_spec.rb +1 -1
  188. data/spec/lib/spree/core/testing_support/factories/credit_card_factory_spec.rb +1 -1
  189. data/spec/lib/spree/core/testing_support/factories/customer_return_factory_spec.rb +1 -1
  190. data/spec/lib/spree/core/testing_support/factories/image_factory_spec.rb +1 -1
  191. data/spec/lib/spree/core/testing_support/factories/inventory_unit_factory_spec.rb +1 -1
  192. data/spec/lib/spree/core/testing_support/factories/line_item_factory_spec.rb +1 -1
  193. data/spec/lib/spree/core/testing_support/factories/option_type_factory_spec.rb +1 -1
  194. data/spec/lib/spree/core/testing_support/factories/option_value_factory_spec.rb +1 -1
  195. data/spec/lib/spree/core/testing_support/factories/order_factory_spec.rb +2 -2
  196. data/spec/lib/spree/core/testing_support/factories/order_promotion_factory_spec.rb +1 -1
  197. data/spec/lib/spree/core/testing_support/factories/payment_factory_spec.rb +1 -1
  198. data/spec/lib/spree/core/testing_support/factories/payment_method_factory_spec.rb +1 -1
  199. data/spec/lib/spree/core/testing_support/factories/price_factory_spec.rb +1 -1
  200. data/spec/lib/spree/core/testing_support/factories/product_factory_spec.rb +1 -1
  201. data/spec/lib/spree/core/testing_support/factories/product_option_type_factory_spec.rb +1 -1
  202. data/spec/lib/spree/core/testing_support/factories/product_property_factory_spec.rb +1 -1
  203. data/spec/lib/spree/core/testing_support/factories/promotion_category_factory_spec.rb +1 -1
  204. data/spec/lib/spree/core/testing_support/factories/promotion_code_factory_spec.rb +1 -1
  205. data/spec/lib/spree/core/testing_support/factories/promotion_factory_spec.rb +1 -1
  206. data/spec/lib/spree/core/testing_support/factories/property_factory_spec.rb +1 -1
  207. data/spec/lib/spree/core/testing_support/factories/refund_factory_spec.rb +1 -1
  208. data/spec/lib/spree/core/testing_support/factories/refund_reason_factory_spec.rb +1 -1
  209. data/spec/lib/spree/core/testing_support/factories/reimbursement_factory_spec.rb +1 -1
  210. data/spec/lib/spree/core/testing_support/factories/reimbursement_type_factory_spec.rb +1 -1
  211. data/spec/lib/spree/core/testing_support/factories/return_authorization_factory_spec.rb +1 -1
  212. data/spec/lib/spree/core/testing_support/factories/return_item_factory_spec.rb +1 -1
  213. data/spec/lib/spree/core/testing_support/factories/return_reason_factory_spec.rb +1 -1
  214. data/spec/lib/spree/core/testing_support/factories/role_factory_spec.rb +1 -1
  215. data/spec/lib/spree/core/testing_support/factories/shipment_factory_spec.rb +1 -1
  216. data/spec/lib/spree/core/testing_support/factories/shipping_category_factory_spec.rb +1 -1
  217. data/spec/lib/spree/core/testing_support/factories/shipping_method_factory_spec.rb +10 -1
  218. data/spec/lib/spree/core/testing_support/factories/shipping_rate_factory_spec.rb +1 -1
  219. data/spec/lib/spree/core/testing_support/factories/state_factory_spec.rb +1 -1
  220. data/spec/lib/spree/core/testing_support/factories/stock_item_factory_spec.rb +1 -1
  221. data/spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb +1 -1
  222. data/spec/lib/spree/core/testing_support/factories/stock_movement_factory_spec.rb +1 -1
  223. data/spec/lib/spree/core/testing_support/factories/stock_package_factory_spec.rb +1 -1
  224. data/spec/lib/spree/core/testing_support/factories/stock_transfer_factory_spec.rb +1 -1
  225. data/spec/lib/spree/core/testing_support/factories/store_credit_category_factory_spec.rb +1 -1
  226. data/spec/lib/spree/core/testing_support/factories/store_credit_event_factory_spec.rb +1 -1
  227. data/spec/lib/spree/core/testing_support/factories/store_credit_factory_spec.rb +1 -1
  228. data/spec/lib/spree/core/testing_support/factories/store_credit_type_factory_spec.rb +1 -1
  229. data/spec/lib/spree/core/testing_support/factories/store_credit_update_reason_factory_spec.rb +1 -1
  230. data/spec/lib/spree/core/testing_support/factories/store_factory_spec.rb +1 -1
  231. data/spec/lib/spree/core/testing_support/factories/tax_category_factory_spec.rb +1 -1
  232. data/spec/lib/spree/core/testing_support/factories/tax_rate_factory_spec.rb +1 -1
  233. data/spec/lib/spree/core/testing_support/factories/taxon_factory_spec.rb +1 -1
  234. data/spec/lib/spree/core/testing_support/factories/taxonomy_factory_spec.rb +1 -1
  235. data/spec/lib/spree/core/testing_support/factories/user_factory_spec.rb +1 -1
  236. data/spec/lib/spree/core/testing_support/factories/variant_factory_spec.rb +1 -1
  237. data/spec/lib/spree/core/testing_support/factories/variant_property_rule_condition_factory_spec.rb +1 -1
  238. data/spec/lib/spree/core/testing_support/factories/variant_property_rule_factory_spec.rb +1 -1
  239. data/spec/lib/spree/core/testing_support/factories/variant_property_rule_value_factory_spec.rb +1 -1
  240. data/spec/lib/spree/core/testing_support/factories/zone_factory_spec.rb +1 -1
  241. data/spec/lib/spree/core/testing_support/preferences_spec.rb +1 -1
  242. data/spec/lib/spree/core/validators/email_spec.rb +3 -2
  243. data/spec/lib/spree/core/version_spec.rb +1 -1
  244. data/spec/lib/spree/localized_number_spec.rb +2 -1
  245. data/spec/lib/spree/migrations_spec.rb +2 -2
  246. data/spec/lib/spree/money_spec.rb +3 -1
  247. data/spec/lib/spree/permission_sets/default_customer_spec.rb +2 -2
  248. data/spec/lib/tasks/dummy_task_spec.rb +2 -2
  249. data/spec/lib/tasks/migrations/migrate_shipping_rate_taxes_spec.rb +2 -2
  250. data/spec/mailers/carton_mailer_spec.rb +2 -2
  251. data/spec/mailers/order_mailer_spec.rb +2 -2
  252. data/spec/mailers/promotion_code_batch_mailer_spec.rb +2 -2
  253. data/spec/mailers/reimbursement_mailer_spec.rb +2 -2
  254. data/spec/mailers/test_mailer_spec.rb +2 -2
  255. data/spec/models/spree/ability_spec.rb +2 -2
  256. data/spec/models/spree/address_spec.rb +2 -37
  257. data/spec/models/spree/adjustment_reason_spec.rb +2 -2
  258. data/spec/models/spree/adjustment_spec.rb +4 -4
  259. data/spec/models/spree/app_configuration_spec.rb +2 -2
  260. data/spec/models/spree/asset_spec.rb +2 -2
  261. data/spec/models/spree/calculator/default_tax_spec.rb +21 -56
  262. data/spec/models/spree/calculator/distributed_amount_spec.rb +2 -2
  263. data/spec/models/spree/calculator/flat_percent_item_total_spec.rb +2 -2
  264. data/spec/models/spree/calculator/flat_rate_spec.rb +2 -2
  265. data/spec/models/spree/calculator/flexi_rate_spec.rb +2 -2
  266. data/spec/models/spree/calculator/free_shipping_spec.rb +2 -2
  267. data/spec/models/spree/calculator/percent_on_line_item_spec.rb +2 -2
  268. data/spec/models/spree/calculator/percent_per_item_spec.rb +2 -2
  269. data/spec/models/spree/calculator/price_sack_spec.rb +2 -2
  270. data/spec/models/spree/calculator/refunds/default_refund_amount_spec.rb +2 -2
  271. data/spec/models/spree/calculator/shipping/flat_percent_item_total_spec.rb +2 -2
  272. data/spec/models/spree/calculator/shipping/flat_rate_spec.rb +2 -2
  273. data/spec/models/spree/calculator/shipping/flexi_rate_spec.rb +2 -2
  274. data/spec/models/spree/calculator/shipping/per_item_spec.rb +2 -2
  275. data/spec/models/spree/calculator/shipping/price_sack_spec.rb +2 -2
  276. data/spec/models/spree/calculator/tiered_flat_rate_spec.rb +2 -2
  277. data/spec/models/spree/calculator/tiered_percent_spec.rb +2 -2
  278. data/spec/models/spree/calculator_spec.rb +12 -2
  279. data/spec/models/spree/carton_spec.rb +2 -2
  280. data/spec/models/spree/classification_spec.rb +2 -2
  281. data/spec/models/spree/concerns/display_money_spec.rb +2 -2
  282. data/spec/models/spree/concerns/ordered_property_value_list_spec.rb +2 -2
  283. data/spec/models/spree/concerns/user_address_book_spec.rb +26 -26
  284. data/spec/models/spree/concerns/user_methods_spec.rb +80 -2
  285. data/spec/models/spree/country_spec.rb +2 -2
  286. data/spec/models/spree/credit_card_spec.rb +2 -2
  287. data/spec/models/spree/customer_return_spec.rb +2 -2
  288. data/spec/models/spree/distributed_amounts_handler_spec.rb +1 -1
  289. data/spec/models/spree/exchange_spec.rb +2 -2
  290. data/spec/models/spree/fulfilment_changer_spec.rb +273 -0
  291. data/spec/models/spree/gateway/bogus_simple.rb +2 -2
  292. data/spec/models/spree/gateway/bogus_spec.rb +2 -2
  293. data/spec/models/spree/gateway_spec.rb +2 -2
  294. data/spec/models/spree/image_spec.rb +2 -2
  295. data/spec/models/spree/inventory_unit_spec.rb +3 -3
  296. data/spec/models/spree/line_item_spec.rb +23 -6
  297. data/spec/models/spree/option_type_spec.rb +2 -2
  298. data/spec/models/spree/option_value_spec.rb +2 -2
  299. data/spec/models/spree/order/address_spec.rb +2 -2
  300. data/spec/models/spree/order/adjustments_spec.rb +2 -2
  301. data/spec/models/spree/order/callbacks_spec.rb +2 -2
  302. data/spec/models/spree/order/checkout_spec.rb +6 -6
  303. data/spec/models/spree/order/finalizing_spec.rb +3 -3
  304. data/spec/models/spree/order/number_generator_spec.rb +1 -1
  305. data/spec/models/spree/order/outstanding_balance_integration_spec.rb +3 -3
  306. data/spec/models/spree/order/payment_spec.rb +61 -30
  307. data/spec/models/spree/order/risk_assessment_spec.rb +2 -2
  308. data/spec/models/spree/order/state_machine_spec.rb +2 -2
  309. data/spec/models/spree/order/totals_spec.rb +2 -2
  310. data/spec/models/spree/order/updating_spec.rb +3 -3
  311. data/spec/models/spree/order/validations_spec.rb +2 -2
  312. data/spec/models/spree/order_cancellations_spec.rb +3 -3
  313. data/spec/models/spree/order_capturing_spec.rb +7 -143
  314. data/spec/models/spree/order_contents_spec.rb +2 -2
  315. data/spec/models/spree/order_inventory_spec.rb +2 -2
  316. data/spec/models/spree/order_merger_spec.rb +2 -2
  317. data/spec/models/spree/order_mutex_spec.rb +2 -2
  318. data/spec/models/spree/order_promotion_spec.rb +2 -2
  319. data/spec/models/spree/order_shipping_spec.rb +2 -2
  320. data/spec/models/spree/order_spec.rb +60 -108
  321. data/spec/models/spree/order_stock_location_spec.rb +2 -2
  322. data/spec/models/spree/order_taxation_spec.rb +1 -1
  323. data/spec/models/spree/order_update_attributes_spec.rb +2 -6
  324. data/spec/models/spree/order_updater_spec.rb +16 -16
  325. data/spec/models/spree/payment/cancellation_spec.rb +81 -0
  326. data/spec/models/spree/payment_create_spec.rb +1 -1
  327. data/spec/models/spree/payment_method/bogus_credit_card_spec.rb +2 -2
  328. data/spec/models/spree/payment_method/check_spec.rb +8 -8
  329. data/spec/models/spree/payment_method/credit_card_spec.rb +2 -2
  330. data/spec/models/spree/payment_method/simple_bogus_credit_card_spec.rb +2 -2
  331. data/spec/models/spree/payment_method/store_credit_spec.rb +39 -27
  332. data/spec/models/spree/payment_method_spec.rb +2 -2
  333. data/spec/models/spree/payment_spec.rb +71 -17
  334. data/spec/models/spree/permission_sets/base_spec.rb +2 -2
  335. data/spec/models/spree/permission_sets/configuration_display.rb +2 -2
  336. data/spec/models/spree/permission_sets/configuration_management_spec.rb +2 -2
  337. data/spec/models/spree/permission_sets/dashboard_display_spec.rb +2 -2
  338. data/spec/models/spree/permission_sets/order_display_spec.rb +2 -2
  339. data/spec/models/spree/permission_sets/order_management_spec.rb +2 -2
  340. data/spec/models/spree/permission_sets/product_display_spec.rb +2 -2
  341. data/spec/models/spree/permission_sets/product_management_spec.rb +2 -2
  342. data/spec/models/spree/permission_sets/promotion_display_spec.rb +2 -2
  343. data/spec/models/spree/permission_sets/promotion_management_spec.rb +2 -2
  344. data/spec/models/spree/permission_sets/report_display_spec.rb +2 -2
  345. data/spec/models/spree/permission_sets/restricted_stock_display_spec.rb +2 -2
  346. data/spec/models/spree/permission_sets/restricted_stock_management_spec.rb +2 -2
  347. data/spec/models/spree/permission_sets/restricted_stock_transfer_display_spec.rb +2 -2
  348. data/spec/models/spree/permission_sets/restricted_stock_transfer_management_spec.rb +2 -2
  349. data/spec/models/spree/permission_sets/stock_display_spec.rb +2 -2
  350. data/spec/models/spree/permission_sets/stock_management_spec.rb +2 -2
  351. data/spec/models/spree/permission_sets/stock_transfer_display_spec.rb +2 -2
  352. data/spec/models/spree/permission_sets/stock_transfer_management_spec.rb +2 -2
  353. data/spec/models/spree/permission_sets/user_display_spec.rb +2 -2
  354. data/spec/models/spree/permission_sets/user_management_spec.rb +2 -2
  355. data/spec/models/spree/preference_spec.rb +2 -2
  356. data/spec/models/spree/preferences/configuration_spec.rb +2 -2
  357. data/spec/models/spree/preferences/preferable_spec.rb +2 -2
  358. data/spec/models/spree/preferences/scoped_store_spec.rb +2 -2
  359. data/spec/models/spree/preferences/static_model_preferences_spec.rb +1 -1
  360. data/spec/models/spree/preferences/statically_configurable_spec.rb +1 -1
  361. data/spec/models/spree/preferences/store_spec.rb +2 -2
  362. data/spec/models/spree/price_spec.rb +2 -2
  363. data/spec/models/spree/product/scopes_spec.rb +2 -2
  364. data/spec/models/spree/product_duplicator_spec.rb +2 -2
  365. data/spec/models/spree/product_filter_spec.rb +2 -2
  366. data/spec/models/spree/product_property_spec.rb +2 -2
  367. data/spec/models/spree/product_spec.rb +2 -2
  368. data/spec/models/spree/promotion/actions/create_adjustment_spec.rb +2 -2
  369. data/spec/models/spree/promotion/actions/create_item_adjustments_spec.rb +2 -2
  370. data/spec/models/spree/promotion/actions/create_quantity_adjustments_spec.rb +4 -4
  371. data/spec/models/spree/promotion/actions/free_shipping_spec.rb +2 -2
  372. data/spec/models/spree/promotion/rules/first_order_spec.rb +2 -2
  373. data/spec/models/spree/promotion/rules/first_repeat_purchase_since_spec.rb +2 -2
  374. data/spec/models/spree/promotion/rules/item_total_spec.rb +2 -2
  375. data/spec/models/spree/promotion/rules/nth_order_spec.rb +2 -2
  376. data/spec/models/spree/promotion/rules/one_use_per_user_spec.rb +2 -2
  377. data/spec/models/spree/promotion/rules/option_value_spec.rb +2 -2
  378. data/spec/models/spree/promotion/rules/product_spec.rb +2 -2
  379. data/spec/models/spree/promotion/rules/taxon_spec.rb +2 -2
  380. data/spec/models/spree/promotion/rules/user_logged_in_spec.rb +2 -2
  381. data/spec/models/spree/promotion/rules/user_role_spec.rb +2 -2
  382. data/spec/models/spree/promotion/rules/user_spec.rb +2 -2
  383. data/spec/models/spree/promotion_action_spec.rb +2 -2
  384. data/spec/models/spree/promotion_category_spec.rb +2 -2
  385. data/spec/models/spree/promotion_code/batch_builder_spec.rb +2 -2
  386. data/spec/models/spree/promotion_code_batch_spec.rb +2 -2
  387. data/spec/models/spree/promotion_code_spec.rb +1 -1
  388. data/spec/models/spree/promotion_handler/cart_spec.rb +3 -3
  389. data/spec/models/spree/promotion_handler/coupon_spec.rb +2 -2
  390. data/spec/models/spree/promotion_handler/page_spec.rb +2 -2
  391. data/spec/models/spree/promotion_handler/{free_shipping_spec.rb → shipping_spec.rb} +28 -3
  392. data/spec/models/spree/promotion_rule_spec.rb +2 -2
  393. data/spec/models/spree/promotion_spec.rb +4 -4
  394. data/spec/models/spree/refund_spec.rb +10 -2
  395. data/spec/models/spree/reimbursement/credit_spec.rb +2 -2
  396. data/spec/models/spree/reimbursement/reimbursement_type_engine_spec.rb +2 -2
  397. data/spec/models/spree/reimbursement/reimbursement_type_validator_spec.rb +2 -2
  398. data/spec/models/spree/reimbursement_performer_spec.rb +2 -2
  399. data/spec/models/spree/reimbursement_spec.rb +5 -5
  400. data/spec/models/spree/reimbursement_tax_calculator_spec.rb +2 -2
  401. data/spec/models/spree/reimbursement_type/credit_spec.rb +2 -2
  402. data/spec/models/spree/reimbursement_type/exchange_spec.rb +2 -2
  403. data/spec/models/spree/reimbursement_type/original_payment_spec.rb +2 -2
  404. data/spec/models/spree/reimbursement_type/store_credit_spec.rb +2 -2
  405. data/spec/models/spree/return_authorization_spec.rb +19 -7
  406. data/spec/models/spree/return_item/eligibility_validator/default_spec.rb +2 -2
  407. data/spec/models/spree/return_item/eligibility_validator/inventory_shipped_spec.rb +2 -2
  408. data/spec/models/spree/return_item/eligibility_validator/no_reimbursements_spec.rb +2 -2
  409. data/spec/models/spree/return_item/eligibility_validator/order_completed_spec.rb +2 -2
  410. data/spec/models/spree/return_item/eligibility_validator/rma_required_spec.rb +2 -2
  411. data/spec/models/spree/return_item/eligibility_validator/time_since_purchase_spec.rb +2 -2
  412. data/spec/models/spree/return_item/exchange_variant_eligibility/same_option_value_spec.rb +2 -2
  413. data/spec/models/spree/return_item/exchange_variant_eligibility/same_product_spec.rb +2 -2
  414. data/spec/models/spree/return_item_spec.rb +6 -6
  415. data/spec/models/spree/returns_calculator_spec.rb +2 -2
  416. data/spec/models/spree/shipment_spec.rb +35 -18
  417. data/spec/models/spree/shipping_calculator_spec.rb +2 -2
  418. data/spec/models/spree/shipping_manifest_spec.rb +2 -2
  419. data/spec/models/spree/shipping_method_spec.rb +2 -2
  420. data/spec/models/spree/shipping_rate_spec.rb +3 -37
  421. data/spec/models/spree/shipping_rate_tax_spec.rb +1 -7
  422. data/spec/models/spree/state_spec.rb +2 -2
  423. data/spec/models/spree/stock/availability_spec.rb +127 -0
  424. data/spec/models/spree/stock/availability_validator_spec.rb +2 -2
  425. data/spec/models/spree/stock/differentiator_spec.rb +2 -2
  426. data/spec/models/spree/stock/estimator_spec.rb +2 -2
  427. data/spec/models/spree/stock/inventory_unit_builder_spec.rb +2 -2
  428. data/spec/models/spree/stock/package_spec.rb +2 -2
  429. data/spec/models/spree/stock/quantifier_spec.rb +3 -3
  430. data/spec/models/spree/stock/shipping_rate_selector_spec.rb +2 -2
  431. data/spec/models/spree/stock/shipping_rate_sorter_spec.rb +2 -2
  432. data/spec/models/spree/stock/{coordinator_spec.rb → simple_coordinator_spec.rb} +47 -28
  433. data/spec/models/spree/stock/splitter/backordered_spec.rb +5 -5
  434. data/spec/models/spree/stock/splitter/base_spec.rb +5 -5
  435. data/spec/models/spree/stock/splitter/shipping_category_spec.rb +6 -6
  436. data/spec/models/spree/stock/splitter/weight_spec.rb +6 -6
  437. data/spec/models/spree/stock/splitter_chain_spec.rb +64 -0
  438. data/spec/models/spree/stock_item_spec.rb +2 -2
  439. data/spec/models/spree/stock_location_spec.rb +2 -2
  440. data/spec/models/spree/stock_movement_spec.rb +2 -2
  441. data/spec/models/spree/stock_quantities_spec.rb +247 -0
  442. data/spec/models/spree/stock_transfer_spec.rb +2 -2
  443. data/spec/models/spree/store_credit_category_spec.rb +2 -2
  444. data/spec/models/spree/store_credit_event_spec.rb +2 -2
  445. data/spec/models/spree/store_credit_spec.rb +2 -2
  446. data/spec/models/spree/store_selector/by_server_name_spec.rb +2 -2
  447. data/spec/models/spree/store_selector/legacy_spec.rb +2 -2
  448. data/spec/models/spree/store_spec.rb +2 -2
  449. data/spec/models/spree/tax/order_adjuster_spec.rb +1 -1
  450. data/spec/models/spree/tax/shipping_rate_taxer_spec.rb +2 -2
  451. data/spec/models/spree/tax/tax_location_spec.rb +1 -1
  452. data/spec/models/spree/tax/taxation_integration_spec.rb +9 -10
  453. data/spec/models/spree/tax_calculator/default_spec.rb +1 -1
  454. data/spec/models/spree/tax_category_spec.rb +2 -2
  455. data/spec/models/spree/tax_rate_spec.rb +21 -65
  456. data/spec/models/spree/taxon_spec.rb +2 -2
  457. data/spec/models/spree/taxonomy_spec.rb +2 -2
  458. data/spec/models/spree/transfer_item_spec.rb +2 -2
  459. data/spec/models/spree/unit_cancel_spec.rb +2 -2
  460. data/spec/models/spree/user_spec.rb +12 -3
  461. data/spec/models/spree/validations/db_maximum_length_validator_spec.rb +2 -2
  462. data/spec/models/spree/variant/price_selector_spec.rb +2 -2
  463. data/spec/models/spree/variant/pricing_options_spec.rb +2 -2
  464. data/spec/models/spree/variant/scopes_spec.rb +2 -2
  465. data/spec/models/spree/variant/vat_price_generator_spec.rb +2 -2
  466. data/spec/models/spree/variant_property_rule_condition_spec.rb +2 -2
  467. data/spec/models/spree/variant_property_rule_spec.rb +2 -2
  468. data/spec/models/spree/variant_property_rule_value_spec.rb +2 -2
  469. data/spec/models/spree/variant_spec.rb +2 -2
  470. data/spec/models/spree/wallet_payment_source_spec.rb +2 -2
  471. data/spec/models/spree/wallet_spec.rb +2 -2
  472. data/spec/models/spree/zone_spec.rb +2 -260
  473. data/spec/rails_helper.rb +49 -0
  474. data/spec/shared_examples/calculator_shared_examples.rb +1 -1
  475. data/spec/spec_helper.rb +3 -40
  476. data/spec/support/concerns/default_price.rb +1 -1
  477. data/spec/support/shared_contexts/rake.rb +1 -1
  478. metadata +28 -414
  479. data/app/helpers/spree/orders_helper.rb +0 -16
  480. data/app/models/spree/preferences/preferable.rb +0 -133
  481. data/app/models/spree/stock/adjuster.rb +0 -28
  482. data/app/models/spree/stock/coordinator.rb +0 -150
  483. data/app/models/spree/stock/packer.rb +0 -63
  484. data/app/models/spree/stock/prioritizer.rb +0 -48
  485. data/db/migrate/20120831092320_spree_one_two.rb +0 -473
  486. data/db/migrate/20120831092359_spree_promo_one_two.rb +0 -45
  487. data/db/migrate/20120905145253_add_tax_rate_label.rb +0 -5
  488. data/db/migrate/20120905151823_add_toggle_tax_rate_display.rb +0 -5
  489. data/db/migrate/20120929093553_remove_unused_preference_columns.rb +0 -8
  490. data/db/migrate/20121009142519_add_lock_version_to_variant.rb +0 -5
  491. data/db/migrate/20121010142909_add_states_required_to_countries.rb +0 -5
  492. data/db/migrate/20121012071449_add_on_demand_to_product_and_variant.rb +0 -6
  493. data/db/migrate/20121017010007_remove_not_null_constraint_from_products_on_hand.rb +0 -11
  494. data/db/migrate/20121031162139_split_prices_from_variants.rb +0 -31
  495. data/db/migrate/20121107003422_remove_not_null_from_spree_prices_amount.rb +0 -9
  496. data/db/migrate/20121107184631_add_currency_to_line_items.rb +0 -5
  497. data/db/migrate/20121107194006_add_currency_to_orders.rb +0 -5
  498. data/db/migrate/20121109173623_add_cost_currency_to_variants.rb +0 -5
  499. data/db/migrate/20121111231553_remove_display_on_from_payment_methods.rb +0 -5
  500. data/db/migrate/20121124203911_add_position_to_taxonomies.rb +0 -5
  501. data/db/migrate/20121126040517_add_last_ip_to_spree_orders.rb +0 -5
  502. data/db/migrate/20121213162028_add_state_to_spree_adjustments.rb +0 -6
  503. data/db/migrate/20130114053446_add_display_on_to_spree_payment_methods.rb +0 -9
  504. data/db/migrate/20130120201805_add_position_to_product_properties.spree.rb +0 -5
  505. data/db/migrate/20130203232234_add_identifier_to_spree_payments.rb +0 -5
  506. data/db/migrate/20130207155350_add_order_id_index_to_payments.rb +0 -9
  507. data/db/migrate/20130208032954_add_primary_to_spree_products_taxons.rb +0 -5
  508. data/db/migrate/20130211190146_create_spree_stock_items.rb +0 -14
  509. data/db/migrate/20130211191120_create_spree_stock_locations.rb +0 -11
  510. data/db/migrate/20130213191427_create_default_stock.rb +0 -25
  511. data/db/migrate/20130222032153_add_order_id_index_to_shipments.rb +0 -5
  512. data/db/migrate/20130226032817_change_meta_description_on_spree_products_to_text.rb +0 -5
  513. data/db/migrate/20130226191231_add_stock_location_id_to_spree_shipments.rb +0 -5
  514. data/db/migrate/20130227143905_add_pending_to_inventory_unit.rb +0 -6
  515. data/db/migrate/20130228164411_remove_on_demand_from_product_and_variant.rb +0 -6
  516. data/db/migrate/20130228210442_create_shipping_method_zone.rb +0 -21
  517. data/db/migrate/20130301162745_remove_shipping_category_id_from_shipping_method.rb +0 -5
  518. data/db/migrate/20130301162924_create_shipping_method_categories.rb +0 -13
  519. data/db/migrate/20130301205200_add_tracking_url_to_spree_shipping_methods.rb +0 -5
  520. data/db/migrate/20130304162240_create_spree_shipping_rates.rb +0 -24
  521. data/db/migrate/20130304192936_remove_category_match_attributes_from_shipping_method.rb +0 -7
  522. data/db/migrate/20130305143310_create_stock_movements.rb +0 -12
  523. data/db/migrate/20130306181701_add_address_fields_to_stock_location.rb +0 -21
  524. data/db/migrate/20130306191917_add_active_field_to_stock_locations.rb +0 -5
  525. data/db/migrate/20130306195650_add_backorderable_to_stock_item.rb +0 -5
  526. data/db/migrate/20130307161754_add_default_quantity_to_stock_movement.rb +0 -5
  527. data/db/migrate/20130318151756_add_source_and_destination_to_stock_movements.rb +0 -8
  528. data/db/migrate/20130319062004_change_orders_total_precision.rb +0 -8
  529. data/db/migrate/20130319063911_change_spree_payments_amount_precision.rb +0 -5
  530. data/db/migrate/20130319064308_change_spree_return_authorization_amount_precision.rb +0 -5
  531. data/db/migrate/20130319082943_change_adjustments_amount_precision.rb +0 -5
  532. data/db/migrate/20130319183250_add_originator_to_stock_movement.rb +0 -7
  533. data/db/migrate/20130319190507_drop_source_and_destination_from_stock_movement.rb +0 -15
  534. data/db/migrate/20130325163316_migrate_inventory_unit_sold_to_on_hand.rb +0 -9
  535. data/db/migrate/20130326175857_add_stock_location_to_rma.rb +0 -5
  536. data/db/migrate/20130328130308_update_shipment_state_for_canceled_orders.rb +0 -15
  537. data/db/migrate/20130328195253_add_seo_metas_to_taxons.rb +0 -9
  538. data/db/migrate/20130329134939_remove_stock_item_and_variant_lock.rb +0 -14
  539. data/db/migrate/20130413230529_add_name_to_spree_credit_cards.rb +0 -5
  540. data/db/migrate/20130414000512_update_name_fields_on_spree_credit_cards.rb +0 -13
  541. data/db/migrate/20130417120034_add_index_to_source_columns_on_adjustments.rb +0 -5
  542. data/db/migrate/20130417120035_update_adjustment_states.rb +0 -16
  543. data/db/migrate/20130417123427_add_shipping_rates_to_shipments.rb +0 -15
  544. data/db/migrate/20130418125341_create_spree_stock_transfers.rb +0 -14
  545. data/db/migrate/20130423110707_drop_products_count_on_hand.rb +0 -5
  546. data/db/migrate/20130423223847_set_default_shipping_rate_cost.rb +0 -5
  547. data/db/migrate/20130509115210_add_number_to_stock_transfer.rb +0 -23
  548. data/db/migrate/20130514151929_add_sku_index_to_spree_variants.rb +0 -5
  549. data/db/migrate/20130515180736_add_backorderable_default_to_spree_stock_location.rb +0 -5
  550. data/db/migrate/20130516151222_add_propage_all_variants_to_spree_stock_location.rb +0 -5
  551. data/db/migrate/20130611054351_rename_shipping_methods_zones_to_spree_shipping_methods_zones.rb +0 -5
  552. data/db/migrate/20130611185927_add_user_id_index_to_spree_orders.rb +0 -5
  553. data/db/migrate/20130618041418_add_updated_at_to_spree_countries.rb +0 -9
  554. data/db/migrate/20130619012236_add_updated_at_to_spree_states.rb +0 -9
  555. data/db/migrate/20130626232741_add_cvv_result_code_and_cvv_result_message_to_spree_payments.rb +0 -6
  556. data/db/migrate/20130628021056_add_unique_index_to_permalink_on_spree_products.rb +0 -5
  557. data/db/migrate/20130628022817_add_unique_index_to_orders_shipments_and_stock_transfers.rb +0 -7
  558. data/db/migrate/20130708052307_add_deleted_at_to_spree_tax_rates.rb +0 -5
  559. data/db/migrate/20130711200933_remove_lock_version_from_inventory_units.rb +0 -6
  560. data/db/migrate/20130718042445_add_cost_price_to_line_item.rb +0 -5
  561. data/db/migrate/20130718233855_set_backorderable_to_default_to_false.rb +0 -6
  562. data/db/migrate/20130725031716_add_created_by_id_to_spree_orders.rb +0 -5
  563. data/db/migrate/20130729214043_index_completed_at_on_spree_orders.rb +0 -5
  564. data/db/migrate/20130802014537_add_tax_category_id_to_spree_line_items.rb +0 -5
  565. data/db/migrate/20130802022321_migrate_tax_categories_to_line_items.rb +0 -10
  566. data/db/migrate/20130806022521_drop_spree_mail_methods.rb +0 -12
  567. data/db/migrate/20130806145853_set_default_stock_location_on_shipments.rb +0 -8
  568. data/db/migrate/20130807024301_upgrade_adjustments.rb +0 -40
  569. data/db/migrate/20130807024302_rename_adjustment_fields.rb +0 -14
  570. data/db/migrate/20130809164245_add_admin_name_column_to_spree_shipping_methods.rb +0 -5
  571. data/db/migrate/20130809164330_add_admin_name_column_to_spree_stock_locations.rb +0 -5
  572. data/db/migrate/20130813004002_add_shipment_total_to_spree_orders.rb +0 -5
  573. data/db/migrate/20130813140619_expand_order_number_size.rb +0 -9
  574. data/db/migrate/20130813232134_rename_activators_to_promotions.rb +0 -5
  575. data/db/migrate/20130815000406_add_adjustment_total_to_line_items.rb +0 -5
  576. data/db/migrate/20130815024413_add_adjustment_total_to_shipments.rb +0 -5
  577. data/db/migrate/20130826062534_add_depth_to_spree_taxons.rb +0 -14
  578. data/db/migrate/20130828234942_add_tax_total_to_line_items_shipments_and_orders.rb +0 -8
  579. data/db/migrate/20130830001033_add_shipping_category_to_shipping_methods_and_products.rb +0 -15
  580. data/db/migrate/20130830001159_migrate_old_shipping_calculators.rb +0 -19
  581. data/db/migrate/20130903183026_add_code_to_spree_promotion_rules.rb +0 -5
  582. data/db/migrate/20130909115621_change_states_required_for_countries.rb +0 -9
  583. data/db/migrate/20130915032339_add_deleted_at_to_spree_stock_items.rb +0 -5
  584. data/db/migrate/20130917024658_remove_promotions_event_name_field.rb +0 -5
  585. data/db/migrate/20130924040529_add_promo_total_to_line_items_and_shipments_and_orders.rb +0 -7
  586. data/db/migrate/20131001013410_remove_unused_credit_card_fields.rb +0 -17
  587. data/db/migrate/20131026154747_add_track_inventory_to_variant.rb +0 -5
  588. data/db/migrate/20131107132123_add_tax_category_to_variants.rb +0 -6
  589. data/db/migrate/20131113035136_add_channel_to_spree_orders.rb +0 -5
  590. data/db/migrate/20131118043959_add_included_to_adjustments.rb +0 -5
  591. data/db/migrate/20131118050234_rename_tax_total_fields.rb +0 -11
  592. data/db/migrate/20131118183431_add_line_item_id_to_spree_inventory_units.rb +0 -20
  593. data/db/migrate/20131120234456_add_updated_at_to_variants.rb +0 -5
  594. data/db/migrate/20131127001002_add_position_to_classifications.rb +0 -5
  595. data/db/migrate/20131211112807_create_spree_orders_promotions.rb +0 -8
  596. data/db/migrate/20131211192741_unique_shipping_method_categories.rb +0 -24
  597. data/db/migrate/20131218054603_add_item_count_to_spree_orders.rb +0 -5
  598. data/db/migrate/20140106065820_remove_value_type_from_spree_preferences.rb +0 -9
  599. data/db/migrate/20140106224208_rename_permalink_to_slug_for_products.rb +0 -5
  600. data/db/migrate/20140120160805_add_index_to_variant_id_and_currency_on_prices.rb +0 -5
  601. data/db/migrate/20140124023232_rename_activator_id_in_rules_and_actions_to_promotion_id.rb +0 -6
  602. data/db/migrate/20140129024326_add_deleted_at_to_spree_prices.rb +0 -5
  603. data/db/migrate/20140203161722_add_approver_id_and_approved_at_to_orders.rb +0 -6
  604. data/db/migrate/20140204115338_add_confirmation_delivered_to_spree_orders.rb +0 -5
  605. data/db/migrate/20140204192230_add_auto_capture_to_payment_methods.rb +0 -5
  606. data/db/migrate/20140205120320_create_spree_payment_capture_events.rb +0 -12
  607. data/db/migrate/20140205144710_add_uncaptured_amount_to_payments.rb +0 -5
  608. data/db/migrate/20140205181631_default_variant_weight_to_zero.rb +0 -11
  609. data/db/migrate/20140207085910_add_tax_category_id_to_shipping_methods.rb +0 -5
  610. data/db/migrate/20140207093021_add_tax_rate_id_to_shipping_rates.rb +0 -5
  611. data/db/migrate/20140211040159_add_pre_tax_amount_to_line_items_and_shipments.rb +0 -6
  612. data/db/migrate/20140213184916_add_more_indexes.rb +0 -13
  613. data/db/migrate/20140219060952_add_considered_risky_to_orders.rb +0 -5
  614. data/db/migrate/20140227112348_add_preference_store_to_everything.rb +0 -8
  615. data/db/migrate/20140307235515_add_user_id_to_spree_credit_cards.rb +0 -13
  616. data/db/migrate/20140309023735_migrate_old_preferences.rb +0 -52
  617. data/db/migrate/20140309024355_create_spree_stores.rb +0 -25
  618. data/db/migrate/20140309033438_create_store_from_preferences.rb +0 -34
  619. data/db/migrate/20140315053743_add_timestamps_to_spree_assets.rb +0 -6
  620. data/db/migrate/20140318191500_create_spree_taxons_promotion_rules.rb +0 -8
  621. data/db/migrate/20140331100557_add_additional_store_fields.rb +0 -8
  622. data/db/migrate/20140410141842_add_many_missing_indexes.rb +0 -19
  623. data/db/migrate/20140410150358_correct_some_polymorphic_index_and_add_more_missing.rb +0 -65
  624. data/db/migrate/20140415041315_add_user_id_created_by_id_index_to_order.rb +0 -5
  625. data/db/migrate/20140508151342_change_spree_price_amount_precision.rb +0 -8
  626. data/db/migrate/20140518174634_add_token_to_spree_orders.rb +0 -5
  627. data/db/migrate/20140530024945_move_order_token_from_tokenized_permission.rb +0 -29
  628. data/db/migrate/20140601011216_set_shipment_total_for_users_upgrading.rb +0 -22
  629. data/db/migrate/20140604135309_drop_credit_card_first_name_and_last_name.rb +0 -6
  630. data/db/migrate/20140609201656_add_deleted_at_to_spree_promotion_actions.rb +0 -6
  631. data/db/migrate/20140616202624_remove_uncaptured_amount_from_spree_payments.rb +0 -5
  632. data/db/migrate/20140625214618_create_spree_refunds.rb +0 -12
  633. data/db/migrate/20140702140656_create_spree_return_authorization_inventory_unit.rb +0 -12
  634. data/db/migrate/20140707125621_rename_return_authorization_inventory_unit_to_return_items.rb +0 -5
  635. data/db/migrate/20140708132019_create_order_mutex.rb +0 -11
  636. data/db/migrate/20140709160534_backfill_line_item_pre_tax_amount.rb +0 -10
  637. data/db/migrate/20140710041921_recreate_spree_return_authorizations.rb +0 -54
  638. data/db/migrate/20140710181204_add_amount_fields_to_return_items.rb +0 -7
  639. data/db/migrate/20140710190048_drop_return_authorization_amount.rb +0 -5
  640. data/db/migrate/20140713140455_create_spree_return_authorization_reasons.rb +0 -32
  641. data/db/migrate/20140713140527_create_spree_refund_reasons.rb +0 -14
  642. data/db/migrate/20140713142214_rename_return_authorization_reason.rb +0 -5
  643. data/db/migrate/20140715182625_create_spree_promotion_categories.rb +0 -11
  644. data/db/migrate/20140716204111_drop_received_at_on_return_items.rb +0 -9
  645. data/db/migrate/20140716212330_add_reception_and_acceptance_status_to_return_items.rb +0 -6
  646. data/db/migrate/20140717155155_create_default_refund_reason.rb +0 -9
  647. data/db/migrate/20140717185932_add_default_to_spree_stock_locations.rb +0 -7
  648. data/db/migrate/20140718133010_create_spree_customer_returns.rb +0 -9
  649. data/db/migrate/20140718133349_add_customer_return_id_to_return_item.rb +0 -6
  650. data/db/migrate/20140718195325_create_friendly_id_slugs.rb +0 -15
  651. data/db/migrate/20140723004419_rename_spree_refund_return_authorization_id.rb +0 -5
  652. data/db/migrate/20140723152808_increase_return_item_pre_tax_amount_precision.rb +0 -13
  653. data/db/migrate/20140723214541_copy_product_slugs_to_slug_history.rb +0 -13
  654. data/db/migrate/20140725131539_create_spree_reimbursements.rb +0 -21
  655. data/db/migrate/20140728225422_add_promotionable_to_spree_products.rb +0 -5
  656. data/db/migrate/20140729133613_add_exchange_inventory_unit_foreign_keys.rb +0 -7
  657. data/db/migrate/20140730155938_add_acceptance_status_errors_to_return_item.rb +0 -5
  658. data/db/migrate/20140731150017_create_spree_reimbursement_types.rb +0 -20
  659. data/db/migrate/20140804185157_add_default_to_shipment_cost.rb +0 -10
  660. data/db/migrate/20140805171035_add_default_to_spree_credit_cards.rb +0 -5
  661. data/db/migrate/20140805171219_make_existing_credit_cards_default.rb +0 -11
  662. data/db/migrate/20140806144901_add_type_to_reimbursement_type.rb +0 -9
  663. data/db/migrate/20140808184039_create_spree_reimbursement_credits.rb +0 -10
  664. data/db/migrate/20140827170513_add_meta_title_to_spree_products.rb +0 -7
  665. data/db/migrate/20140924164824_add_code_to_spree_tax_categories.rb +0 -5
  666. data/db/migrate/20140927193717_default_pre_tax_amount_should_be_zero.rb +0 -6
  667. data/db/migrate/20141002191113_add_code_to_spree_shipping_methods.rb +0 -5
  668. data/db/migrate/20141007230328_add_cancel_audit_fields_to_spree_orders.rb +0 -6
  669. data/db/migrate/20141009204607_add_store_id_to_orders.rb +0 -12
  670. data/db/migrate/20141012083513_create_spree_taxons_prototypes.rb +0 -8
  671. data/db/migrate/20141023005240_add_counter_cache_from_spree_variants_to_spree_stock_items.rb +0 -8
  672. data/db/migrate/20141101231208_fix_adjustment_order_presence.rb +0 -13
  673. data/db/migrate/20141105213646_update_classifications_positions.rb +0 -9
  674. data/db/migrate/20141120135441_add_guest_token_index_to_spree_orders.rb +0 -5
  675. data/db/migrate/20141215235502_remove_extra_products_slug_index.rb +0 -5
  676. data/db/migrate/20141217215630_update_product_slug_index.rb +0 -8
  677. data/db/migrate/20141231151320_add_default_column_to_price.rb +0 -5
  678. data/db/migrate/20150112194216_add_position_to_stock_location.rb +0 -5
  679. data/db/migrate/20150113002122_create_spree_promotion_codes.rb +0 -13
  680. data/db/migrate/20150113002123_create_adjustment_promotion_code_association.rb +0 -6
  681. data/db/migrate/20150121022521_remove_environment_from_payment_method.rb +0 -6
  682. data/db/migrate/20150121202544_add_restock_inventory_to_stock_location.rb +0 -5
  683. data/db/migrate/20150122202432_add_code_to_spree_promotion_categories.rb +0 -5
  684. data/db/migrate/20150127161843_create_order_stock_locations.rb +0 -12
  685. data/db/migrate/20150203151219_add_fulfillable_to_stock_location.rb +0 -5
  686. data/db/migrate/20150205210527_add_code_to_refund_reason.rb +0 -5
  687. data/db/migrate/20150213160148_add_promotion_code_id_to_orders_promotions.rb +0 -7
  688. data/db/migrate/20150213163612_add_approver_name_to_spree_orders.rb +0 -5
  689. data/db/migrate/20150225205344_move_promotion_code_to_promotion_code_value.rb +0 -64
  690. data/db/migrate/20150226195213_downcase_promotion_codes_values.rb +0 -11
  691. data/db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb +0 -9
  692. data/db/migrate/20150303212749_add_per_code_usage_limit_to_promotions.rb +0 -5
  693. data/db/migrate/20150303212826_remove_usage_limit_from_promotion_codes.rb +0 -5
  694. data/db/migrate/20150304211616_add_timestamps_to_order_promotions.rb +0 -6
  695. data/db/migrate/20150305043021_create_spree_cartons.rb +0 -24
  696. data/db/migrate/20150305210403_add_timestamps_to_spree_roles_users.rb +0 -7
  697. data/db/migrate/20150313140507_remove_considered_risky_from_spree_orders.rb +0 -5
  698. data/db/migrate/20150313192827_add_index_to_inventory_units_carton_id.rb +0 -5
  699. data/db/migrate/20150313201235_add_imported_from_shipment_id_to_cartons.rb +0 -8
  700. data/db/migrate/20150313201503_copy_shipped_shipments_to_cartons.rb +0 -12
  701. data/db/migrate/20150330144639_create_spree_user_stock_locations.rb +0 -10
  702. data/db/migrate/20150331134544_add_stock_location_code.rb +0 -5
  703. data/db/migrate/20150402210430_create_unit_cancels.rb +0 -10
  704. data/db/migrate/20150407173305_add_fields_to_stock_transfer.rb +0 -12
  705. data/db/migrate/20150407173531_create_transfer_items.rb +0 -14
  706. data/db/migrate/20150424143547_drop_stock_transfer_type.rb +0 -10
  707. data/db/migrate/20150424161102_add_stock_transfer_finalized_at.rb +0 -8
  708. data/db/migrate/20150429125822_rename_stock_transfer_reference.rb +0 -5
  709. data/db/migrate/20150430233803_create_line_item_actions.rb +0 -10
  710. data/db/migrate/20150506181159_create_spree_store_credit_categories.rb +0 -10
  711. data/db/migrate/20150506181244_create_spree_store_credits.rb +0 -19
  712. data/db/migrate/20150506181539_create_spree_store_credit_events.rb +0 -17
  713. data/db/migrate/20150506181611_create_spree_store_credit_payment_method.rb +0 -21
  714. data/db/migrate/20150506181715_create_store_credit_types.rb +0 -17
  715. data/db/migrate/20150506182045_create_store_credit_reimbursement_type.rb +0 -5
  716. data/db/migrate/20150508044622_add_resellable_to_return_items.rb +0 -5
  717. data/db/migrate/20150514185559_add_invalidated_at_to_spree_store_credits.rb +0 -5
  718. data/db/migrate/20150514201836_migrate_deleted_store_credits_to_invalidated.rb +0 -13
  719. data/db/migrate/20150515170322_add_check_stock_on_transfer.rb +0 -5
  720. data/db/migrate/20150515211137_fix_adjustment_order_id.rb +0 -79
  721. data/db/migrate/20150528125647_delete_inventory_units_without_shipment.rb +0 -25
  722. data/db/migrate/20150601191251_add_deleted_at_to_stock_transfers.rb +0 -5
  723. data/db/migrate/20150601204148_add_deleted_at_to_transfer_items.rb +0 -5
  724. data/db/migrate/20150609093816_increase_scale_on_pre_tax_amounts.rb +0 -26
  725. data/db/migrate/20150609193231_add_preferences_to_promotion_actions.rb +0 -5
  726. data/db/migrate/20150610182638_add_id_to_spree_option_values_variants.rb +0 -5
  727. data/db/migrate/20150611200247_add_frontend_viewable_to_spree_orders.rb +0 -5
  728. data/db/migrate/20150612205731_remove_spree_configurations.rb +0 -15
  729. data/db/migrate/20150616204659_add_preference_source_to_spree_payment_methods.rb +0 -5
  730. data/db/migrate/20150618191713_remove_credit_card_address_id.rb +0 -7
  731. data/db/migrate/20150618212517_create_spree_store_credit_update_reasons.rb +0 -8
  732. data/db/migrate/20150619160613_create_adjustment_reason.rb +0 -18
  733. data/db/migrate/20150622144655_add_update_reason_to_store_credit_events.rb +0 -5
  734. data/db/migrate/20150623194316_add_return_authorization_reason_id_to_return_items.rb +0 -7
  735. data/db/migrate/20150623214058_seed_store_credit_update_reasons.rb +0 -9
  736. data/db/migrate/20150626200816_remove_shipping_method_id_from_spree_orders.rb +0 -9
  737. data/db/migrate/20150626214817_remove_counter_cache_from_spree_variants_to_spree_stock_items.rb +0 -10
  738. data/db/migrate/20150629175931_add_address_id_to_credit_card.rb +0 -5
  739. data/db/migrate/20150630175644_copy_order_bill_address_to_credit_card.rb +0 -12
  740. data/db/migrate/20150723224133_remove_unnecessary_indexes.rb +0 -62
  741. data/db/migrate/20150724163716_remove_state_lock_version_from_order.rb +0 -11
  742. data/db/migrate/20150731201146_add_spree_user_addresses.rb +0 -15
  743. data/db/migrate/20150806190833_add_id_and_timestamp_to_promotion_rule_user.rb +0 -13
  744. data/db/migrate/20150811210350_remove_mandatory_from_adjustments.rb +0 -5
  745. data/db/migrate/20150811211025_add_finalized_to_spree_adjustments.rb +0 -11
  746. data/db/migrate/20150820160821_add_store_payment_methods.rb +0 -10
  747. data/db/migrate/20150824213633_convert_habtm_to_hmt_for_shipping_methods_zones.rb +0 -17
  748. data/db/migrate/20150824214129_convert_habtm_to_hmt_for_products_promotion_rules.rb +0 -17
  749. data/db/migrate/20150825204216_drop_spree_gateways.rb +0 -20
  750. data/db/migrate/20150826002555_convert_habtm_to_hmt_for_taxon_prototypes.rb +0 -15
  751. data/db/migrate/20150909123605_create_variant_properties_and_rules.rb +0 -28
  752. data/db/migrate/20151001121454_create_spree_shipping_method_stock_locations.rb +0 -13
  753. data/db/migrate/20151002023248_add_foreign_key_to_shipping_method_stock_location.rb +0 -6
  754. data/db/migrate/20151010003252_add_foreign_keys_for_taxons_prototypes.rb +0 -6
  755. data/db/migrate/20151013222921_remove_token_permissions_table.rb +0 -16
  756. data/db/migrate/20151014213349_rename_identifier_to_number_for_payment.rb +0 -7
  757. data/db/migrate/20151015203732_add_foreign_keys_for_product_promotion_rules.rb +0 -9
  758. data/db/migrate/20151021113730_add_sale_to_spree_promotions.rb +0 -6
  759. data/db/migrate/20151021163309_convert_sale_promotions.rb +0 -28
  760. data/db/migrate/20151026093607_change_return_item_pre_tax_amount_to_amount.rb +0 -29
  761. data/db/migrate/20151117063249_convert_habtm_to_hmt_for_properties_prototypes.rb +0 -17
  762. data/db/migrate/20151124062500_convert_habtm_to_hmt_for_option_type_prototypes.rb +0 -17
  763. data/db/migrate/20151126063028_convert_habtm_to_hmt_for_taxons_promotion_rules.rb +0 -15
  764. data/db/migrate/20151219020209_add_stock_item_unique_index.rb +0 -9
  765. data/db/migrate/20160111091912_add_column_available_to_all_on_spree_shipping_method.rb +0 -5
  766. data/db/migrate/20160116133604_add_position_to_spree_payment_methods.rb +0 -5
  767. data/db/migrate/20160122182105_add_carrier_and_service_level_to_spree_shipping_methods.rb +0 -6
  768. data/db/migrate/20160224201413_create_spree_shipping_rate_taxes.rb +0 -11
  769. data/db/migrate/20160229133259_add_cart_tax_country_iso_to_spree_store.rb +0 -5
  770. data/db/migrate/20160301103333_remove_pre_tax_amount_on_line_item_and_shipment.rb +0 -6
  771. data/db/migrate/20160308000300_disallow_adjustment_finalized_nulls.rb +0 -19
  772. data/db/migrate/20160318145302_add_timestamps_to_prices.rb +0 -5
  773. data/db/migrate/20160330204846_add_missing_timestamp_columns.rb +0 -20
  774. data/db/migrate/20160420044191_create_spree_wallet_payment_sources.rb +0 -23
  775. data/db/migrate/20160420181916_migrate_credit_cards_to_wallet_payment_sources.rb +0 -27
  776. data/db/migrate/20160509181311_add_country_iso_to_prices.rb +0 -8
  777. data/db/migrate/20160527070401_rename_shipment_address_field.rb +0 -7
  778. data/db/migrate/20160608162651_ensure_default_store.rb +0 -13
  779. data/db/migrate/20160608180751_ensure_store_on_orders.rb +0 -12
  780. data/db/migrate/20160616232103_remove_user_id_from_promotion_rules.rb +0 -11
  781. data/db/migrate/20160718205341_add_payment_id_index_to_spree_refunds.rb +0 -5
  782. data/db/migrate/20160718205859_add_reimbursement_id_index_to_spree_refunds.rb +0 -5
  783. data/lib/spree/core/controller_helpers/respond_with.rb +0 -65
  784. data/lib/spree/core/price_migrator.rb +0 -30
  785. data/lib/spree/responder.rb +0 -44
  786. data/lib/spree/testing_support/factories/stock_packer_factory.rb +0 -13
  787. data/lib/tasks/migrations/copy_shipped_shipments_to_cartons.rake +0 -172
  788. data/lib/tasks/migrations/create_vat_prices.rake +0 -15
  789. data/lib/tasks/upgrade.rake +0 -11
  790. data/spec/helpers/order_helper_spec.rb +0 -12
  791. data/spec/lib/spree/core/price_migrator_spec.rb +0 -358
  792. data/spec/lib/spree/core/testing_support/factories/stock_packer_factory_spec.rb +0 -16
  793. data/spec/lib/tasks/migrations/copy_shipped_shipments_to_cartons_spec.rb +0 -111
  794. data/spec/lib/tasks/migrations/create_vat_prices_spec.rb +0 -31
  795. data/spec/lib/tasks/order_capturing_spec.rb +0 -53
  796. data/spec/lib/tasks/upgrade_spec.rb +0 -20
  797. data/spec/models/spree/order/tax_spec.rb +0 -98
  798. data/spec/models/spree/stock/packer_spec.rb +0 -90
  799. data/spec/models/spree/stock/prioritizer_spec.rb +0 -125
@@ -45,7 +45,7 @@
45
45
  <tr>
46
46
  <td></td>
47
47
  <td><%= Spree.t(:shipping) %> <%= name %>:</td>
48
- <td><%= Spree::Money.new(shipments.sum(&:discounted_cost), currency: @order.currency) %></td>
48
+ <td><%= Spree::Money.new(shipments.sum(&:total_before_tax), currency: @order.currency) %></td>
49
49
  </tr>
50
50
  <% end %>
51
51
  <% if @order.all_adjustments.eligible.tax.exists? %>
@@ -19,7 +19,7 @@
19
19
  <% end %>
20
20
 
21
21
  <% @order.shipments.group_by { |s| s.selected_shipping_rate.try(:name) }.each do |name, shipments| %>
22
- <%= Spree.t(:shipping) %>: <%= name %> <%= Spree::Money.new(shipments.sum(&:discounted_cost), currency: @order.currency) %>
22
+ <%= Spree.t(:shipping) %>: <%= name %> <%= Spree::Money.new(shipments.sum(&:total_before_tax), currency: @order.currency) %>
23
23
  <% end %>
24
24
 
25
25
  <% if @order.all_adjustments.eligible.tax.exists? %>
@@ -6,6 +6,16 @@ en:
6
6
  state: State
7
7
  shipment: Shipment
8
8
  cancel: Cancel
9
+ errors:
10
+ models:
11
+ spree/fulfilment_changer:
12
+ attributes:
13
+ desired_shipment:
14
+ can_not_transfer_within_same_shipment: can not be same as current shipment
15
+ not_enough_stock_at_desired_location: not enough stock in desired stock location
16
+ current_shipment:
17
+ has_already_been_shipped: has already been shipped
18
+ can_not_have_backordered_inventory_units: has backordered inventory units
9
19
  activerecord:
10
20
  attributes:
11
21
  spree/address:
@@ -62,6 +72,7 @@ en:
62
72
  number: Return Number
63
73
  pre_tax_total: Pre-Tax Total
64
74
  total: Total
75
+ total_excluding_vat: Pre-Tax Total
65
76
  created_at: "Date/Time"
66
77
  reimbursement_status: Reimbursement status
67
78
  name: Name
@@ -74,6 +85,7 @@ en:
74
85
  email: Email
75
86
  password: Password
76
87
  password_confirmation: Password Confirmation
88
+ spree_roles: Roles
77
89
  spree/line_item:
78
90
  description: Item Description
79
91
  name: Name
@@ -170,13 +182,14 @@ en:
170
182
  code: Code
171
183
  description: Description
172
184
  event_name: Event Name
173
- expires_at: Expiration date
185
+ expires_at: End
174
186
  name: Name
175
187
  path: Path
176
188
  per_code_usage_limit: Per Code Usage Limit
177
189
  promotion_uses: Promotion Uses
178
- starts_at: Start date
179
- usage_limit: Overall Usage Limit
190
+ starts_at: Start
191
+ status: Status
192
+ usage_limit: Usage Limit
180
193
  spree/promotion/actions/create_adjustment:
181
194
  description: Creates a promotion credit adjustment on the order
182
195
  spree/promotion/actions/create_item_adjustments:
@@ -238,6 +251,7 @@ en:
238
251
  spree/return_authorization:
239
252
  amount: Amount
240
253
  pre_tax_total: Pre-Tax Total
254
+ total_excluding_vat: Pre-Tax Total
241
255
  spree/return_item:
242
256
  acceptance_status: Acceptance status
243
257
  acceptance_status_errors: Acceptance errors
@@ -369,6 +383,8 @@ en:
369
383
  email: Email
370
384
  password: Password
371
385
  password_confirmation: Password Confirmation
386
+ spree_roles: Roles
387
+ lifetime_value: Total spent
372
388
  spree/variant:
373
389
  cost_currency: Cost Currency
374
390
  cost_price: Cost Price
@@ -382,7 +398,6 @@ en:
382
398
  spree/zone:
383
399
  description: Description
384
400
  name: Name
385
- default_tax: Default Tax Zone
386
401
  models:
387
402
  # LegacyUser maps to this model_name so we want to provide translations for it
388
403
  user:
@@ -809,10 +824,6 @@ en:
809
824
  vat: '%{name} (Included in Price)'
810
825
  sales_tax_with_rate: '%{name} %{amount}'
811
826
  vat_with_rate: '%{name} %{amount} (Included in Price)'
812
- sales_tax_refund: 'Refund: %{name}'
813
- vat_refund: 'Refund: %{name} (Included in Price)'
814
- sales_tax_refund_with_rate: 'Refund: %{name} %{amount}'
815
- vat_refund_with_rate: 'Refund: %{name} %{amount} (Included in Price)'
816
827
  adjustment_reasons: Adjustment Reasons
817
828
  adjustment_successfully_closed: Adjustment has been successfully closed!
818
829
  adjustment_successfully_opened: Adjustment has been successfully opened!
@@ -899,7 +910,6 @@ en:
899
910
  amount_used_not_zero: "is greater than zero. Can not delete store credit"
900
911
  update_reason_required: "A reason for the change must be selected"
901
912
  tab:
902
- areas: Locations
903
913
  checkout: Refunds and Returns
904
914
  configuration: Configuration
905
915
  display_order: Display Order
@@ -923,6 +933,7 @@ en:
923
933
  taxonomies: Taxonomies
924
934
  taxons: Taxons
925
935
  users: Users
936
+ zones: Zones
926
937
  taxons:
927
938
  display_order: Display Order
928
939
  user:
@@ -971,7 +982,7 @@ en:
971
982
  analytics_trackers: Analytics Trackers
972
983
  and: and
973
984
  apply_code: Apply Code
974
- approve: approve
985
+ approve: Approve
975
986
  approver: Approver
976
987
  approved_at: Approved at
977
988
  are_you_sure: Are you sure?
@@ -1035,7 +1046,7 @@ en:
1035
1046
  calculated_reimbursements: Calculated Reimbursements
1036
1047
  calculator: Calculator
1037
1048
  calculator_settings_warning: If you are changing the calculator type or preference source, you must save first before you can edit the calculator settings
1038
- cancel: cancel
1049
+ cancel: Cancel
1039
1050
  cancel_inventory: 'Cancel Items'
1040
1051
  canceled: canceled
1041
1052
  canceled_at: Canceled at
@@ -1078,6 +1089,7 @@ en:
1078
1089
  clear_cache_warning: Clearing cache will temporarily reduce the performance of your store.
1079
1090
  clone: Clone
1080
1091
  close: Close
1092
+ closed: Closed
1081
1093
  close_stock_transfer:
1082
1094
  confirm: "Are you sure you want to close this stock transfer?\n\nStock levels will be changed for the received items and you will no longer be able to edit the stock transfer."
1083
1095
  code: Code
@@ -1162,8 +1174,6 @@ en:
1162
1174
  date_range: Date Range
1163
1175
  default: Default
1164
1176
  default_refund_amount: Default Refund Amount
1165
- default_tax: Default Tax
1166
- default_tax_zone: Default Tax Zone
1167
1177
  delete: Delete
1168
1178
  deleted_variants_present: Some line items in this order have products that are no longer available.
1169
1179
  deleted_successfully: Deleted successfully
@@ -1372,11 +1382,11 @@ en:
1372
1382
  inventory_not_available: Inventory not available for %{item}.
1373
1383
  inventory_state: Inventory State
1374
1384
  inventory_states:
1375
- backordered: backordered
1376
- canceled: canceled
1377
- on_hand: on hand
1378
- returned: returned
1379
- shipped: shipped
1385
+ backordered: Backordered
1386
+ canceled: Canceled
1387
+ on_hand: On hand
1388
+ returned: Returned
1389
+ shipped: Shipped
1380
1390
  is_not_available_to_shipment_address: is not available to shipment address
1381
1391
  iso_name: Iso Name
1382
1392
  item: Item
@@ -1581,16 +1591,16 @@ en:
1581
1591
  order_refresh_totals: Refresh Totals
1582
1592
  order_resumed: Order resumed
1583
1593
  order_state:
1584
- address: address
1585
- awaiting_return: awaiting return
1586
- canceled: canceled
1587
- cart: cart
1588
- complete: complete
1589
- confirm: confirm
1590
- delivery: delivery
1591
- payment: payment
1592
- resumed: resumed
1593
- returned: returned
1594
+ address: Address
1595
+ awaiting_return: Awaiting return
1596
+ canceled: Canceled
1597
+ cart: Cart
1598
+ complete: Complete
1599
+ confirm: Confirm
1600
+ delivery: Delivery
1601
+ payment: Payment
1602
+ resumed: Resumed
1603
+ returned: Returned
1594
1604
  order_summary: Order Summary
1595
1605
  order_sure_want_to: Are you sure you want to %{event} this order?
1596
1606
  order_total: Order Total
@@ -1624,15 +1634,16 @@ en:
1624
1634
  payment_processor_choose_link: our payments page
1625
1635
  payment_state: Payment State
1626
1636
  payment_states:
1627
- balance_due: balance due
1628
- checkout: checkout
1629
- completed: completed
1630
- credit_owed: credit owed
1631
- failed: failed
1632
- paid: paid
1633
- pending: pending
1634
- processing: processing
1635
- void: void
1637
+ balance_due: Balance due
1638
+ checkout: Checkout
1639
+ completed: Completed
1640
+ credit_owed: Credit owed
1641
+ failed: Failed
1642
+ paid: Paid
1643
+ pending: Pending
1644
+ processing: Processing
1645
+ void: Void
1646
+ invalid: Invalid
1636
1647
  payment_updated: Payment Updated
1637
1648
  payments: Payments
1638
1649
  percent: Percent
@@ -1715,6 +1726,17 @@ en:
1715
1726
  received_successfully: Received Successfully
1716
1727
  receiving: Receiving
1717
1728
  receiving_match: Receiving match
1729
+ reception_states:
1730
+ awaiting: Awaiting
1731
+ canceled: Canceled
1732
+ expired: Expired
1733
+ given_to_customer: Given to customer
1734
+ in_transit: In transit
1735
+ lost_in_transit: Lost in transit
1736
+ received: Received
1737
+ shipped_wrong_item: Wrong item
1738
+ short_shipped: Short shipped
1739
+ unexchanged: Unexchanged
1718
1740
  reception_status: Reception Status
1719
1741
  reference: Reference
1720
1742
  refund: Refund
@@ -1729,6 +1751,10 @@ en:
1729
1751
  reimbursed: Reimbursed
1730
1752
  reimbursement: Reimbursement
1731
1753
  reimbursement_perform_failed: "Reimbursement could not be performed. Error: %{error}"
1754
+ reimbursement_states:
1755
+ errored: Errored
1756
+ pending: Pending
1757
+ reimbursed: Reimbursed
1732
1758
  reimbursement_status: Reimbursement status
1733
1759
  reimbursement_type: Reimbursement type
1734
1760
  reimbursement_type_override: Reimbursement Type Override
@@ -1744,10 +1770,13 @@ en:
1744
1770
  reset_password: Reset my password
1745
1771
  response_code: Response Code
1746
1772
  restock_inventory: Restock Inventory
1747
- resume: resume
1773
+ resume: Resume
1748
1774
  resumed: Resumed
1749
1775
  return: return
1750
1776
  return_authorization: Return Merchandise Authorization
1777
+ return_authorization_states:
1778
+ authorized: Authorized
1779
+ canceled: Canceled
1751
1780
  return_authorizations: Return Merchandise Authorizations
1752
1781
  return_authorization_updated: Return merchandise authorization updated
1753
1782
  return_item_inventory_unit_ineligible: Return item's inventory unit must be shipped
@@ -1829,12 +1858,12 @@ en:
1829
1858
  shipment_numbers: Shipment numbers
1830
1859
  shipment_state: Shipment State
1831
1860
  shipment_states:
1832
- backorder: backorder
1833
- canceled: canceled
1834
- partial: partial
1835
- pending: pending
1836
- ready: ready
1837
- shipped: shipped
1861
+ backorder: Backorder
1862
+ canceled: Canceled
1863
+ partial: Partial
1864
+ pending: Pending
1865
+ ready: Ready
1866
+ shipped: Shipped
1838
1867
  shipment_transfer_success: 'Variants successfully transferred'
1839
1868
  shipment_transfer_error: 'There was an error transferring variants'
1840
1869
  shipments: Shipments
@@ -1858,7 +1887,6 @@ en:
1858
1887
  label:
1859
1888
  sales_tax: "+ %{amount} %{tax_rate_name}"
1860
1889
  vat: "incl. %{amount} %{tax_rate_name}"
1861
- vat_refund: "excl. %{amount} %{tax_rate_name}"
1862
1890
  shipping_total: Shipping total
1863
1891
  shop_by_taxonomy: Shop by %{taxonomy}
1864
1892
  shopping_cart: Shopping Cart
@@ -1884,6 +1912,9 @@ en:
1884
1912
  state: State
1885
1913
  state_based: State Based
1886
1914
  states: States
1915
+ states_count:
1916
+ one: "%{count} State"
1917
+ other: "%{count} States"
1887
1918
  states_required: States Required
1888
1919
  status: Status
1889
1920
  stock_location: Stock Location
@@ -1988,6 +2019,7 @@ en:
1988
2019
  to: to
1989
2020
  to_add_variants_you_must_first_define: To add variants, you must first define
1990
2021
  total: Total
2022
+ total_excluding_vat: Pre-Tax Total
1991
2023
  total_per_item: Total per item
1992
2024
  total_pre_tax_refund: Total Pre-Tax Refund
1993
2025
  total_price: Total price
@@ -1,13 +1,43 @@
1
1
  require 'carmen'
2
2
 
3
- ActiveRecord::Base.transaction do
4
- Carmen::Country.all.each do |country|
5
- Spree::Country.where(iso: country.alpha_2_code).first_or_create!(
6
- name: country.name,
7
- iso3: country.alpha_3_code,
8
- iso_name: country.name.upcase,
9
- numcode: country.numeric_code,
10
- states_required: country.subregions?
11
- )
12
- end
3
+ # Insert Countries into the spree_countries table, checking to ensure that no
4
+ # duplicates are created, using as few SQL statements as possible (2)
5
+
6
+ connection = ApplicationRecord.connection
7
+
8
+ country_mapper = ->(country) do
9
+ name = connection.quote country.name
10
+ iso3 = connection.quote country.alpha_3_code
11
+ iso = connection.quote country.alpha_2_code
12
+ iso_name = connection.quote country.name.upcase
13
+ numcode = connection.quote country.numeric_code
14
+ states_required = connection.quote country.subregions?
15
+
16
+ [name, iso3, iso, iso_name, numcode, states_required].join(", ")
17
+ end
18
+
19
+ country_values = -> do
20
+ carmen_countries = Carmen::Country.all
21
+
22
+ # find entires already in the database (so that we may ignore them)
23
+ existing_country_isos =
24
+ Spree::Country.where(iso: carmen_countries.map(&:alpha_2_code)).pluck(:iso)
25
+
26
+ # create VALUES statements for each country _not_ already in the database
27
+ carmen_countries
28
+ .reject { |c| existing_country_isos.include?(c.alpha_2_code) }
29
+ .map(&country_mapper)
30
+ .join("), (")
31
+ end
32
+
33
+ country_columns = %w(name iso3 iso iso_name numcode states_required).join(', ')
34
+ country_vals = country_values.call
35
+
36
+ if country_vals.present?
37
+ # execute raw SQL (insted of ActiveRecord.create) to use a single
38
+ # INSERT statement, and to avoid any validations or callbacks
39
+ connection.execute <<-SQL
40
+ INSERT INTO spree_countries (#{country_columns})
41
+ VALUES (#{country_vals});
42
+ SQL
13
43
  end
@@ -10,8 +10,8 @@ Spree::PaymentMethod.create_with(
10
10
  type: "Spree::PaymentMethod::StoreCredit"
11
11
  )
12
12
 
13
- Spree::StoreCreditType.create_with(priority: 1).find_or_create_by!(name: 'Expiring')
14
- Spree::StoreCreditType.create_with(priority: 2).find_or_create_by!(name: 'Non-expiring')
13
+ Spree::StoreCreditType.create_with(priority: 1).find_or_create_by!(name: Spree::StoreCreditType::EXPIRING)
14
+ Spree::StoreCreditType.create_with(priority: 2).find_or_create_by!(name: Spree::StoreCreditType::NON_EXPIRING)
15
15
 
16
16
  Spree::ReimbursementType.create_with(name: "Store Credit").find_or_create_by!(type: 'Spree::ReimbursementType::StoreCredit')
17
17
 
@@ -0,0 +1,1153 @@
1
+ class SolidusOneFour < ActiveRecord::Migration[5.0]
2
+ def up
3
+ # This migration is just a compressed version of all the previous
4
+ # migrations for spree_core. Do not run it if one of the core tables
5
+ # already exists. Assume the best.
6
+ return if table_exists?(:spree_addresses)
7
+
8
+ # this table should not technically exist in the database (as its provided by auth_devise),
9
+ # but spree_api depends on it existing. This defininition comes from solidus_auth_devise's first migration,
10
+ # and creates a table equivolent to it
11
+ create_table "spree_users", force: true do |t|
12
+ t.string "crypted_password", limit: 128
13
+ t.string "salt", limit: 128
14
+ t.string "email"
15
+ t.string "remember_token"
16
+ t.string "remember_token_expires_at"
17
+ t.string "persistence_token"
18
+ t.string "single_access_token"
19
+ t.string "perishable_token"
20
+ t.integer "login_count", default: 0, null: false
21
+ t.integer "failed_login_count", default: 0, null: false
22
+ t.datetime "last_request_at"
23
+ t.datetime "current_login_at"
24
+ t.datetime "last_login_at"
25
+ t.string "current_login_ip"
26
+ t.string "last_login_ip"
27
+ t.string "login"
28
+ t.integer "ship_address_id"
29
+ t.integer "bill_address_id"
30
+ t.datetime "created_at", null: false
31
+ t.datetime "updated_at", null: false
32
+ t.string "openid_identifier"
33
+ end
34
+
35
+ create_table "friendly_id_slugs", force: :cascade do |t|
36
+ t.string "slug", null: false
37
+ t.integer "sluggable_id", null: false
38
+ t.string "sluggable_type", limit: 50
39
+ t.string "scope"
40
+ t.datetime "created_at"
41
+ t.datetime "updated_at"
42
+ t.index ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true
43
+ t.index ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type"
44
+ t.index ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id"
45
+ t.index ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type"
46
+ end
47
+
48
+ create_table "spree_addresses", force: :cascade do |t|
49
+ t.string "firstname"
50
+ t.string "lastname"
51
+ t.string "address1"
52
+ t.string "address2"
53
+ t.string "city"
54
+ t.string "zipcode"
55
+ t.string "phone"
56
+ t.string "state_name"
57
+ t.string "alternative_phone"
58
+ t.string "company"
59
+ t.integer "state_id"
60
+ t.integer "country_id"
61
+ t.datetime "created_at"
62
+ t.datetime "updated_at"
63
+ t.index ["country_id"], name: "index_spree_addresses_on_country_id"
64
+ t.index ["firstname"], name: "index_addresses_on_firstname"
65
+ t.index ["lastname"], name: "index_addresses_on_lastname"
66
+ t.index ["state_id"], name: "index_spree_addresses_on_state_id"
67
+ end
68
+
69
+ create_table "spree_adjustment_reasons", force: :cascade do |t|
70
+ t.string "name"
71
+ t.string "code"
72
+ t.boolean "active", default: true
73
+ t.datetime "created_at"
74
+ t.datetime "updated_at"
75
+ t.index ["active"], name: "index_spree_adjustment_reasons_on_active"
76
+ t.index ["code"], name: "index_spree_adjustment_reasons_on_code"
77
+ end
78
+
79
+ create_table "spree_adjustments", force: :cascade do |t|
80
+ t.string "source_type"
81
+ t.integer "source_id"
82
+ t.string "adjustable_type"
83
+ t.integer "adjustable_id", null: false
84
+ t.decimal "amount", precision: 10, scale: 2
85
+ t.string "label"
86
+ t.boolean "eligible", default: true
87
+ t.datetime "created_at"
88
+ t.datetime "updated_at"
89
+ t.integer "order_id", null: false
90
+ t.boolean "included", default: false
91
+ t.integer "promotion_code_id"
92
+ t.integer "adjustment_reason_id"
93
+ t.boolean "finalized", default: false, null: false
94
+ t.index ["adjustable_id", "adjustable_type"], name: "index_spree_adjustments_on_adjustable_id_and_adjustable_type"
95
+ t.index ["adjustable_id"], name: "index_adjustments_on_order_id"
96
+ t.index ["eligible"], name: "index_spree_adjustments_on_eligible"
97
+ t.index ["order_id"], name: "index_spree_adjustments_on_order_id"
98
+ t.index ["promotion_code_id"], name: "index_spree_adjustments_on_promotion_code_id"
99
+ t.index ["source_id", "source_type"], name: "index_spree_adjustments_on_source_id_and_source_type"
100
+ end
101
+
102
+ create_table "spree_assets", force: :cascade do |t|
103
+ t.string "viewable_type"
104
+ t.integer "viewable_id"
105
+ t.integer "attachment_width"
106
+ t.integer "attachment_height"
107
+ t.integer "attachment_file_size"
108
+ t.integer "position"
109
+ t.string "attachment_content_type"
110
+ t.string "attachment_file_name"
111
+ t.string "type", limit: 75
112
+ t.datetime "attachment_updated_at"
113
+ t.text "alt"
114
+ t.datetime "created_at"
115
+ t.datetime "updated_at"
116
+ t.index ["viewable_id"], name: "index_assets_on_viewable_id"
117
+ t.index ["viewable_type", "type"], name: "index_assets_on_viewable_type_and_type"
118
+ end
119
+
120
+ create_table "spree_calculators", force: :cascade do |t|
121
+ t.string "type"
122
+ t.string "calculable_type"
123
+ t.integer "calculable_id"
124
+ t.datetime "created_at"
125
+ t.datetime "updated_at"
126
+ t.text "preferences"
127
+ t.index ["calculable_id", "calculable_type"], name: "index_spree_calculators_on_calculable_id_and_calculable_type"
128
+ t.index ["id", "type"], name: "index_spree_calculators_on_id_and_type"
129
+ end
130
+
131
+ create_table "spree_cartons", force: :cascade do |t|
132
+ t.string "number"
133
+ t.string "external_number"
134
+ t.integer "stock_location_id"
135
+ t.integer "address_id"
136
+ t.integer "shipping_method_id"
137
+ t.string "tracking"
138
+ t.datetime "shipped_at"
139
+ t.datetime "created_at"
140
+ t.datetime "updated_at"
141
+ t.integer "imported_from_shipment_id"
142
+ t.index ["external_number"], name: "index_spree_cartons_on_external_number"
143
+ t.index ["imported_from_shipment_id"], name: "index_spree_cartons_on_imported_from_shipment_id", unique: true
144
+ t.index ["number"], name: "index_spree_cartons_on_number", unique: true
145
+ t.index ["stock_location_id"], name: "index_spree_cartons_on_stock_location_id"
146
+ end
147
+
148
+ create_table "spree_countries", force: :cascade do |t|
149
+ t.string "iso_name"
150
+ t.string "iso"
151
+ t.string "iso3"
152
+ t.string "name"
153
+ t.integer "numcode"
154
+ t.boolean "states_required", default: false
155
+ t.datetime "updated_at"
156
+ t.datetime "created_at"
157
+ t.index ["iso"], name: "index_spree_countries_on_iso"
158
+ end
159
+
160
+ create_table "spree_credit_cards", force: :cascade do |t|
161
+ t.string "month"
162
+ t.string "year"
163
+ t.string "cc_type"
164
+ t.string "last_digits"
165
+ t.string "gateway_customer_profile_id"
166
+ t.string "gateway_payment_profile_id"
167
+ t.datetime "created_at"
168
+ t.datetime "updated_at"
169
+ t.string "name"
170
+ t.integer "user_id"
171
+ t.integer "payment_method_id"
172
+ t.boolean "default", default: false, null: false
173
+ t.integer "address_id"
174
+ t.index ["payment_method_id"], name: "index_spree_credit_cards_on_payment_method_id"
175
+ t.index ["user_id"], name: "index_spree_credit_cards_on_user_id"
176
+ end
177
+
178
+ create_table "spree_customer_returns", force: :cascade do |t|
179
+ t.string "number"
180
+ t.integer "stock_location_id"
181
+ t.datetime "created_at"
182
+ t.datetime "updated_at"
183
+ end
184
+
185
+ create_table "spree_inventory_units", force: :cascade do |t|
186
+ t.string "state"
187
+ t.integer "variant_id"
188
+ t.integer "order_id"
189
+ t.integer "shipment_id"
190
+ t.datetime "created_at"
191
+ t.datetime "updated_at"
192
+ t.boolean "pending", default: true
193
+ t.integer "line_item_id"
194
+ t.integer "carton_id"
195
+ t.index ["carton_id"], name: "index_spree_inventory_units_on_carton_id"
196
+ t.index ["line_item_id"], name: "index_spree_inventory_units_on_line_item_id"
197
+ t.index ["order_id"], name: "index_inventory_units_on_order_id"
198
+ t.index ["shipment_id"], name: "index_inventory_units_on_shipment_id"
199
+ t.index ["variant_id"], name: "index_inventory_units_on_variant_id"
200
+ end
201
+
202
+ create_table "spree_line_item_actions", force: :cascade do |t|
203
+ t.integer "line_item_id", null: false
204
+ t.integer "action_id", null: false
205
+ t.integer "quantity", default: 0
206
+ t.datetime "created_at"
207
+ t.datetime "updated_at"
208
+ t.index ["action_id"], name: "index_spree_line_item_actions_on_action_id"
209
+ t.index ["line_item_id"], name: "index_spree_line_item_actions_on_line_item_id"
210
+ end
211
+
212
+ create_table "spree_line_items", force: :cascade do |t|
213
+ t.integer "variant_id"
214
+ t.integer "order_id"
215
+ t.integer "quantity", null: false
216
+ t.decimal "price", precision: 10, scale: 2, null: false
217
+ t.datetime "created_at"
218
+ t.datetime "updated_at"
219
+ t.string "currency"
220
+ t.decimal "cost_price", precision: 10, scale: 2
221
+ t.integer "tax_category_id"
222
+ t.decimal "adjustment_total", precision: 10, scale: 2, default: "0.0"
223
+ t.decimal "additional_tax_total", precision: 10, scale: 2, default: "0.0"
224
+ t.decimal "promo_total", precision: 10, scale: 2, default: "0.0"
225
+ t.decimal "included_tax_total", precision: 10, scale: 2, default: "0.0", null: false
226
+ t.index ["order_id"], name: "index_spree_line_items_on_order_id"
227
+ t.index ["variant_id"], name: "index_spree_line_items_on_variant_id"
228
+ end
229
+
230
+ create_table "spree_log_entries", force: :cascade do |t|
231
+ t.string "source_type"
232
+ t.integer "source_id"
233
+ t.text "details"
234
+ t.datetime "created_at"
235
+ t.datetime "updated_at"
236
+ t.index ["source_id", "source_type"], name: "index_spree_log_entries_on_source_id_and_source_type"
237
+ end
238
+
239
+ create_table "spree_option_type_prototypes", force: :cascade do |t|
240
+ t.integer "prototype_id"
241
+ t.integer "option_type_id"
242
+ t.datetime "created_at"
243
+ t.datetime "updated_at"
244
+ end
245
+
246
+ create_table "spree_option_types", force: :cascade do |t|
247
+ t.string "name", limit: 100
248
+ t.string "presentation", limit: 100
249
+ t.integer "position", default: 0, null: false
250
+ t.datetime "created_at"
251
+ t.datetime "updated_at"
252
+ t.index ["position"], name: "index_spree_option_types_on_position"
253
+ end
254
+
255
+ create_table "spree_option_values", force: :cascade do |t|
256
+ t.integer "position"
257
+ t.string "name"
258
+ t.string "presentation"
259
+ t.integer "option_type_id"
260
+ t.datetime "created_at"
261
+ t.datetime "updated_at"
262
+ t.index ["option_type_id"], name: "index_spree_option_values_on_option_type_id"
263
+ t.index ["position"], name: "index_spree_option_values_on_position"
264
+ end
265
+
266
+ create_table "spree_option_values_variants", force: :cascade do |t|
267
+ t.integer "variant_id"
268
+ t.integer "option_value_id"
269
+ t.datetime "created_at"
270
+ t.datetime "updated_at"
271
+ t.index ["variant_id", "option_value_id"], name: "index_option_values_variants_on_variant_id_and_option_value_id"
272
+ t.index ["variant_id"], name: "index_spree_option_values_variants_on_variant_id"
273
+ end
274
+
275
+ create_table "spree_order_mutexes", force: :cascade do |t|
276
+ t.integer "order_id", null: false
277
+ t.datetime "created_at"
278
+ t.index ["order_id"], name: "index_spree_order_mutexes_on_order_id", unique: true
279
+ end
280
+
281
+ create_table "spree_order_stock_locations", force: :cascade do |t|
282
+ t.integer "order_id"
283
+ t.integer "variant_id"
284
+ t.integer "quantity"
285
+ t.integer "stock_location_id"
286
+ t.boolean "shipment_fulfilled", default: false, null: false
287
+ t.datetime "created_at"
288
+ t.datetime "updated_at"
289
+ end
290
+
291
+ create_table "spree_orders", force: :cascade do |t|
292
+ t.string "number", limit: 32
293
+ t.decimal "item_total", precision: 10, scale: 2, default: "0.0", null: false
294
+ t.decimal "total", precision: 10, scale: 2, default: "0.0", null: false
295
+ t.string "state"
296
+ t.decimal "adjustment_total", precision: 10, scale: 2, default: "0.0", null: false
297
+ t.integer "user_id"
298
+ t.datetime "completed_at"
299
+ t.integer "bill_address_id"
300
+ t.integer "ship_address_id"
301
+ t.decimal "payment_total", precision: 10, scale: 2, default: "0.0"
302
+ t.string "shipment_state"
303
+ t.string "payment_state"
304
+ t.string "email"
305
+ t.text "special_instructions"
306
+ t.datetime "created_at"
307
+ t.datetime "updated_at"
308
+ t.string "currency"
309
+ t.string "last_ip_address"
310
+ t.integer "created_by_id"
311
+ t.decimal "shipment_total", precision: 10, scale: 2, default: "0.0", null: false
312
+ t.decimal "additional_tax_total", precision: 10, scale: 2, default: "0.0"
313
+ t.decimal "promo_total", precision: 10, scale: 2, default: "0.0"
314
+ t.string "channel", default: "spree"
315
+ t.decimal "included_tax_total", precision: 10, scale: 2, default: "0.0", null: false
316
+ t.integer "item_count", default: 0
317
+ t.integer "approver_id"
318
+ t.datetime "approved_at"
319
+ t.boolean "confirmation_delivered", default: false
320
+ t.string "guest_token"
321
+ t.datetime "canceled_at"
322
+ t.integer "canceler_id"
323
+ t.integer "store_id"
324
+ t.string "approver_name"
325
+ t.boolean "frontend_viewable", default: true, null: false
326
+ t.index ["approver_id"], name: "index_spree_orders_on_approver_id"
327
+ t.index ["bill_address_id"], name: "index_spree_orders_on_bill_address_id"
328
+ t.index ["completed_at"], name: "index_spree_orders_on_completed_at"
329
+ t.index ["created_by_id"], name: "index_spree_orders_on_created_by_id"
330
+ t.index ["guest_token"], name: "index_spree_orders_on_guest_token"
331
+ t.index ["number"], name: "index_spree_orders_on_number"
332
+ t.index ["ship_address_id"], name: "index_spree_orders_on_ship_address_id"
333
+ t.index ["user_id", "created_by_id"], name: "index_spree_orders_on_user_id_and_created_by_id"
334
+ t.index ["user_id"], name: "index_spree_orders_on_user_id"
335
+ end
336
+
337
+ create_table "spree_orders_promotions", force: :cascade do |t|
338
+ t.integer "order_id"
339
+ t.integer "promotion_id"
340
+ t.integer "promotion_code_id"
341
+ t.datetime "created_at"
342
+ t.datetime "updated_at"
343
+ t.index ["order_id", "promotion_id"], name: "index_spree_orders_promotions_on_order_id_and_promotion_id"
344
+ t.index ["promotion_code_id"], name: "index_spree_orders_promotions_on_promotion_code_id"
345
+ end
346
+
347
+ create_table "spree_payment_capture_events", force: :cascade do |t|
348
+ t.decimal "amount", precision: 10, scale: 2, default: "0.0"
349
+ t.integer "payment_id"
350
+ t.datetime "created_at"
351
+ t.datetime "updated_at"
352
+ t.index ["payment_id"], name: "index_spree_payment_capture_events_on_payment_id"
353
+ end
354
+
355
+ create_table "spree_payment_methods", force: :cascade do |t|
356
+ t.string "type"
357
+ t.string "name"
358
+ t.text "description"
359
+ t.boolean "active", default: true
360
+ t.datetime "deleted_at"
361
+ t.datetime "created_at"
362
+ t.datetime "updated_at"
363
+ t.string "display_on"
364
+ t.boolean "auto_capture"
365
+ t.text "preferences"
366
+ t.string "preference_source"
367
+ t.integer "position", default: 0
368
+ t.index ["id", "type"], name: "index_spree_payment_methods_on_id_and_type"
369
+ end
370
+
371
+ create_table "spree_payments", force: :cascade do |t|
372
+ t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false
373
+ t.integer "order_id"
374
+ t.string "source_type"
375
+ t.integer "source_id"
376
+ t.integer "payment_method_id"
377
+ t.string "state"
378
+ t.string "response_code"
379
+ t.string "avs_response"
380
+ t.datetime "created_at"
381
+ t.datetime "updated_at"
382
+ t.string "number"
383
+ t.string "cvv_response_code"
384
+ t.string "cvv_response_message"
385
+ t.index ["order_id"], name: "index_spree_payments_on_order_id"
386
+ t.index ["payment_method_id"], name: "index_spree_payments_on_payment_method_id"
387
+ t.index ["source_id", "source_type"], name: "index_spree_payments_on_source_id_and_source_type"
388
+ end
389
+
390
+ create_table "spree_preferences", force: :cascade do |t|
391
+ t.text "value"
392
+ t.string "key"
393
+ t.datetime "created_at"
394
+ t.datetime "updated_at"
395
+ t.index ["key"], name: "index_spree_preferences_on_key", unique: true
396
+ end
397
+
398
+ create_table "spree_prices", force: :cascade do |t|
399
+ t.integer "variant_id", null: false
400
+ t.decimal "amount", precision: 10, scale: 2
401
+ t.string "currency"
402
+ t.datetime "deleted_at"
403
+ t.boolean "is_default", default: true, null: false
404
+ t.datetime "created_at"
405
+ t.datetime "updated_at"
406
+ t.string "country_iso", limit: 2
407
+ t.index ["country_iso"], name: "index_spree_prices_on_country_iso"
408
+ t.index ["variant_id", "currency"], name: "index_spree_prices_on_variant_id_and_currency"
409
+ end
410
+
411
+ create_table "spree_product_option_types", force: :cascade do |t|
412
+ t.integer "position"
413
+ t.integer "product_id"
414
+ t.integer "option_type_id"
415
+ t.datetime "created_at"
416
+ t.datetime "updated_at"
417
+ t.index ["option_type_id"], name: "index_spree_product_option_types_on_option_type_id"
418
+ t.index ["position"], name: "index_spree_product_option_types_on_position"
419
+ t.index ["product_id"], name: "index_spree_product_option_types_on_product_id"
420
+ end
421
+
422
+ create_table "spree_product_promotion_rules", force: :cascade do |t|
423
+ t.integer "product_id"
424
+ t.integer "promotion_rule_id"
425
+ t.datetime "created_at"
426
+ t.datetime "updated_at"
427
+ t.index ["product_id"], name: "index_products_promotion_rules_on_product_id"
428
+ t.index ["promotion_rule_id"], name: "index_products_promotion_rules_on_promotion_rule_id"
429
+ end
430
+
431
+ create_table "spree_product_properties", force: :cascade do |t|
432
+ t.string "value"
433
+ t.integer "product_id"
434
+ t.integer "property_id"
435
+ t.datetime "created_at"
436
+ t.datetime "updated_at"
437
+ t.integer "position", default: 0
438
+ t.index ["position"], name: "index_spree_product_properties_on_position"
439
+ t.index ["product_id"], name: "index_product_properties_on_product_id"
440
+ t.index ["property_id"], name: "index_spree_product_properties_on_property_id"
441
+ end
442
+
443
+ create_table "spree_products", force: :cascade do |t|
444
+ t.string "name", default: "", null: false
445
+ t.text "description"
446
+ t.datetime "available_on"
447
+ t.datetime "deleted_at"
448
+ t.string "slug"
449
+ t.text "meta_description"
450
+ t.string "meta_keywords"
451
+ t.integer "tax_category_id"
452
+ t.integer "shipping_category_id"
453
+ t.datetime "created_at"
454
+ t.datetime "updated_at"
455
+ t.boolean "promotionable", default: true
456
+ t.string "meta_title"
457
+ t.index ["available_on"], name: "index_spree_products_on_available_on"
458
+ t.index ["deleted_at"], name: "index_spree_products_on_deleted_at"
459
+ t.index ["name"], name: "index_spree_products_on_name"
460
+ t.index ["slug"], name: "index_spree_products_on_slug", unique: true
461
+ end
462
+
463
+ create_table "spree_products_taxons", force: :cascade do |t|
464
+ t.integer "product_id"
465
+ t.integer "taxon_id"
466
+ t.integer "position"
467
+ t.datetime "created_at"
468
+ t.datetime "updated_at"
469
+ t.index ["position"], name: "index_spree_products_taxons_on_position"
470
+ t.index ["product_id"], name: "index_spree_products_taxons_on_product_id"
471
+ t.index ["taxon_id"], name: "index_spree_products_taxons_on_taxon_id"
472
+ end
473
+
474
+ create_table "spree_promotion_action_line_items", force: :cascade do |t|
475
+ t.integer "promotion_action_id"
476
+ t.integer "variant_id"
477
+ t.integer "quantity", default: 1
478
+ t.datetime "created_at"
479
+ t.datetime "updated_at"
480
+ t.index ["promotion_action_id"], name: "index_spree_promotion_action_line_items_on_promotion_action_id"
481
+ t.index ["variant_id"], name: "index_spree_promotion_action_line_items_on_variant_id"
482
+ end
483
+
484
+ create_table "spree_promotion_actions", force: :cascade do |t|
485
+ t.integer "promotion_id"
486
+ t.integer "position"
487
+ t.string "type"
488
+ t.datetime "deleted_at"
489
+ t.text "preferences"
490
+ t.datetime "created_at"
491
+ t.datetime "updated_at"
492
+ t.index ["deleted_at"], name: "index_spree_promotion_actions_on_deleted_at"
493
+ t.index ["id", "type"], name: "index_spree_promotion_actions_on_id_and_type"
494
+ t.index ["promotion_id"], name: "index_spree_promotion_actions_on_promotion_id"
495
+ end
496
+
497
+ create_table "spree_promotion_categories", force: :cascade do |t|
498
+ t.string "name"
499
+ t.datetime "created_at"
500
+ t.datetime "updated_at"
501
+ t.string "code"
502
+ end
503
+
504
+ create_table "spree_promotion_codes", force: :cascade do |t|
505
+ t.integer "promotion_id", null: false
506
+ t.string "value", null: false
507
+ t.datetime "created_at"
508
+ t.datetime "updated_at"
509
+ t.index ["promotion_id"], name: "index_spree_promotion_codes_on_promotion_id"
510
+ t.index ["value"], name: "index_spree_promotion_codes_on_value", unique: true
511
+ end
512
+
513
+ create_table "spree_promotion_rule_taxons", force: :cascade do |t|
514
+ t.integer "taxon_id"
515
+ t.integer "promotion_rule_id"
516
+ t.datetime "created_at"
517
+ t.datetime "updated_at"
518
+ t.index ["promotion_rule_id"], name: "index_spree_promotion_rule_taxons_on_promotion_rule_id"
519
+ t.index ["taxon_id"], name: "index_spree_promotion_rule_taxons_on_taxon_id"
520
+ end
521
+
522
+ create_table "spree_promotion_rules", force: :cascade do |t|
523
+ t.integer "promotion_id"
524
+ t.integer "product_group_id"
525
+ t.string "type"
526
+ t.datetime "created_at"
527
+ t.datetime "updated_at"
528
+ t.string "code"
529
+ t.text "preferences"
530
+ t.index ["product_group_id"], name: "index_promotion_rules_on_product_group_id"
531
+ t.index ["promotion_id"], name: "index_spree_promotion_rules_on_promotion_id"
532
+ end
533
+
534
+ create_table "spree_promotion_rules_users", force: :cascade do |t|
535
+ t.integer "user_id"
536
+ t.integer "promotion_rule_id"
537
+ t.datetime "created_at"
538
+ t.datetime "updated_at"
539
+ t.index ["promotion_rule_id"], name: "index_promotion_rules_users_on_promotion_rule_id"
540
+ t.index ["user_id"], name: "index_promotion_rules_users_on_user_id"
541
+ end
542
+
543
+ create_table "spree_promotions", force: :cascade do |t|
544
+ t.string "description"
545
+ t.datetime "expires_at"
546
+ t.datetime "starts_at"
547
+ t.string "name"
548
+ t.string "type"
549
+ t.integer "usage_limit"
550
+ t.string "match_policy", default: "all"
551
+ t.string "code"
552
+ t.boolean "advertise", default: false
553
+ t.string "path"
554
+ t.datetime "created_at"
555
+ t.datetime "updated_at"
556
+ t.integer "promotion_category_id"
557
+ t.integer "per_code_usage_limit"
558
+ t.boolean "apply_automatically", default: false
559
+ t.index ["advertise"], name: "index_spree_promotions_on_advertise"
560
+ t.index ["apply_automatically"], name: "index_spree_promotions_on_apply_automatically"
561
+ t.index ["code"], name: "index_spree_promotions_on_code"
562
+ t.index ["expires_at"], name: "index_spree_promotions_on_expires_at"
563
+ t.index ["id", "type"], name: "index_spree_promotions_on_id_and_type"
564
+ t.index ["promotion_category_id"], name: "index_spree_promotions_on_promotion_category_id"
565
+ t.index ["starts_at"], name: "index_spree_promotions_on_starts_at"
566
+ end
567
+
568
+ create_table "spree_properties", force: :cascade do |t|
569
+ t.string "name"
570
+ t.string "presentation", null: false
571
+ t.datetime "created_at"
572
+ t.datetime "updated_at"
573
+ end
574
+
575
+ create_table "spree_property_prototypes", force: :cascade do |t|
576
+ t.integer "prototype_id"
577
+ t.integer "property_id"
578
+ t.datetime "created_at"
579
+ t.datetime "updated_at"
580
+ end
581
+
582
+ create_table "spree_prototype_taxons", force: :cascade do |t|
583
+ t.integer "taxon_id"
584
+ t.integer "prototype_id"
585
+ t.datetime "created_at"
586
+ t.datetime "updated_at"
587
+ t.index ["prototype_id"], name: "index_spree_prototype_taxons_on_prototype_id"
588
+ t.index ["taxon_id"], name: "index_spree_prototype_taxons_on_taxon_id"
589
+ end
590
+
591
+ create_table "spree_prototypes", force: :cascade do |t|
592
+ t.string "name"
593
+ t.datetime "created_at"
594
+ t.datetime "updated_at"
595
+ end
596
+
597
+ create_table "spree_refund_reasons", force: :cascade do |t|
598
+ t.string "name"
599
+ t.boolean "active", default: true
600
+ t.boolean "mutable", default: true
601
+ t.datetime "created_at"
602
+ t.datetime "updated_at"
603
+ t.string "code"
604
+ end
605
+
606
+ create_table "spree_refunds", force: :cascade do |t|
607
+ t.integer "payment_id"
608
+ t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false
609
+ t.string "transaction_id"
610
+ t.datetime "created_at"
611
+ t.datetime "updated_at"
612
+ t.integer "refund_reason_id"
613
+ t.integer "reimbursement_id"
614
+ t.index ["payment_id"], name: "index_spree_refunds_on_payment_id"
615
+ t.index ["refund_reason_id"], name: "index_refunds_on_refund_reason_id"
616
+ t.index ["reimbursement_id"], name: "index_spree_refunds_on_reimbursement_id"
617
+ end
618
+
619
+ create_table "spree_reimbursement_credits", force: :cascade do |t|
620
+ t.decimal "amount", precision: 10, scale: 2, default: "0.0", null: false
621
+ t.integer "reimbursement_id"
622
+ t.integer "creditable_id"
623
+ t.string "creditable_type"
624
+ t.datetime "created_at"
625
+ t.datetime "updated_at"
626
+ end
627
+
628
+ create_table "spree_reimbursement_types", force: :cascade do |t|
629
+ t.string "name"
630
+ t.boolean "active", default: true
631
+ t.boolean "mutable", default: true
632
+ t.datetime "created_at"
633
+ t.datetime "updated_at"
634
+ t.string "type"
635
+ t.index ["type"], name: "index_spree_reimbursement_types_on_type"
636
+ end
637
+
638
+ create_table "spree_reimbursements", force: :cascade do |t|
639
+ t.string "number"
640
+ t.string "reimbursement_status"
641
+ t.integer "customer_return_id"
642
+ t.integer "order_id"
643
+ t.decimal "total", precision: 10, scale: 2
644
+ t.datetime "created_at"
645
+ t.datetime "updated_at"
646
+ t.index ["customer_return_id"], name: "index_spree_reimbursements_on_customer_return_id"
647
+ t.index ["order_id"], name: "index_spree_reimbursements_on_order_id"
648
+ end
649
+
650
+ create_table "spree_return_authorizations", force: :cascade do |t|
651
+ t.string "number"
652
+ t.string "state"
653
+ t.integer "order_id"
654
+ t.text "memo"
655
+ t.datetime "created_at"
656
+ t.datetime "updated_at"
657
+ t.integer "stock_location_id"
658
+ t.integer "return_reason_id"
659
+ t.index ["return_reason_id"], name: "index_return_authorizations_on_return_authorization_reason_id"
660
+ end
661
+
662
+ create_table "spree_return_items", force: :cascade do |t|
663
+ t.integer "return_authorization_id"
664
+ t.integer "inventory_unit_id"
665
+ t.integer "exchange_variant_id"
666
+ t.datetime "created_at"
667
+ t.datetime "updated_at"
668
+ t.decimal "amount", precision: 12, scale: 4, default: "0.0", null: false
669
+ t.decimal "included_tax_total", precision: 12, scale: 4, default: "0.0", null: false
670
+ t.decimal "additional_tax_total", precision: 12, scale: 4, default: "0.0", null: false
671
+ t.string "reception_status"
672
+ t.string "acceptance_status"
673
+ t.integer "customer_return_id"
674
+ t.integer "reimbursement_id"
675
+ t.integer "exchange_inventory_unit_id"
676
+ t.text "acceptance_status_errors"
677
+ t.integer "preferred_reimbursement_type_id"
678
+ t.integer "override_reimbursement_type_id"
679
+ t.boolean "resellable", default: true, null: false
680
+ t.integer "return_reason_id"
681
+ t.index ["customer_return_id"], name: "index_return_items_on_customer_return_id"
682
+ t.index ["exchange_inventory_unit_id"], name: "index_spree_return_items_on_exchange_inventory_unit_id"
683
+ end
684
+
685
+ create_table "spree_return_reasons", force: :cascade do |t|
686
+ t.string "name"
687
+ t.boolean "active", default: true
688
+ t.boolean "mutable", default: true
689
+ t.datetime "created_at"
690
+ t.datetime "updated_at"
691
+ end
692
+
693
+ create_table "spree_roles", force: :cascade do |t|
694
+ t.string "name"
695
+ t.datetime "created_at"
696
+ t.datetime "updated_at"
697
+ end
698
+
699
+ create_table "spree_roles_users", force: :cascade do |t|
700
+ t.integer "role_id"
701
+ t.integer "user_id"
702
+ t.datetime "created_at"
703
+ t.datetime "updated_at"
704
+ t.index ["role_id"], name: "index_spree_roles_users_on_role_id"
705
+ t.index ["user_id"], name: "index_spree_roles_users_on_user_id"
706
+ end
707
+
708
+ create_table "spree_shipments", force: :cascade do |t|
709
+ t.string "tracking"
710
+ t.string "number"
711
+ t.decimal "cost", precision: 10, scale: 2, default: "0.0"
712
+ t.datetime "shipped_at"
713
+ t.integer "order_id"
714
+ t.integer "deprecated_address_id"
715
+ t.string "state"
716
+ t.datetime "created_at"
717
+ t.datetime "updated_at"
718
+ t.integer "stock_location_id"
719
+ t.decimal "adjustment_total", precision: 10, scale: 2, default: "0.0"
720
+ t.decimal "additional_tax_total", precision: 10, scale: 2, default: "0.0"
721
+ t.decimal "promo_total", precision: 10, scale: 2, default: "0.0"
722
+ t.decimal "included_tax_total", precision: 10, scale: 2, default: "0.0", null: false
723
+ t.index ["deprecated_address_id"], name: "index_spree_shipments_on_deprecated_address_id"
724
+ t.index ["number"], name: "index_shipments_on_number"
725
+ t.index ["order_id"], name: "index_spree_shipments_on_order_id"
726
+ t.index ["stock_location_id"], name: "index_spree_shipments_on_stock_location_id"
727
+ end
728
+
729
+ create_table "spree_shipping_categories", force: :cascade do |t|
730
+ t.string "name"
731
+ t.datetime "created_at"
732
+ t.datetime "updated_at"
733
+ end
734
+
735
+ create_table "spree_shipping_method_categories", force: :cascade do |t|
736
+ t.integer "shipping_method_id", null: false
737
+ t.integer "shipping_category_id", null: false
738
+ t.datetime "created_at"
739
+ t.datetime "updated_at"
740
+ t.index ["shipping_category_id", "shipping_method_id"], name: "unique_spree_shipping_method_categories", unique: true
741
+ t.index ["shipping_method_id"], name: "index_spree_shipping_method_categories_on_shipping_method_id"
742
+ end
743
+
744
+ create_table "spree_shipping_method_stock_locations", force: :cascade do |t|
745
+ t.integer "shipping_method_id"
746
+ t.integer "stock_location_id"
747
+ t.datetime "created_at"
748
+ t.datetime "updated_at"
749
+ t.index ["shipping_method_id"], name: "shipping_method_id_spree_sm_sl"
750
+ t.index ["stock_location_id"], name: "sstock_location_id_spree_sm_sl"
751
+ end
752
+
753
+ create_table "spree_shipping_method_zones", force: :cascade do |t|
754
+ t.integer "shipping_method_id"
755
+ t.integer "zone_id"
756
+ t.datetime "created_at"
757
+ t.datetime "updated_at"
758
+ end
759
+
760
+ create_table "spree_shipping_methods", force: :cascade do |t|
761
+ t.string "name"
762
+ t.string "display_on"
763
+ t.datetime "deleted_at"
764
+ t.datetime "created_at"
765
+ t.datetime "updated_at"
766
+ t.string "tracking_url"
767
+ t.string "admin_name"
768
+ t.integer "tax_category_id"
769
+ t.string "code"
770
+ t.boolean "available_to_all", default: true
771
+ t.string "carrier"
772
+ t.string "service_level"
773
+ t.index ["tax_category_id"], name: "index_spree_shipping_methods_on_tax_category_id"
774
+ end
775
+
776
+ create_table "spree_shipping_rate_taxes", force: :cascade do |t|
777
+ t.decimal "amount", precision: 8, scale: 2, default: "0.0", null: false
778
+ t.integer "tax_rate_id"
779
+ t.integer "shipping_rate_id"
780
+ t.datetime "created_at", null: false
781
+ t.datetime "updated_at", null: false
782
+ t.index ["shipping_rate_id"], name: "index_spree_shipping_rate_taxes_on_shipping_rate_id"
783
+ t.index ["tax_rate_id"], name: "index_spree_shipping_rate_taxes_on_tax_rate_id"
784
+ end
785
+
786
+ create_table "spree_shipping_rates", force: :cascade do |t|
787
+ t.integer "shipment_id"
788
+ t.integer "shipping_method_id"
789
+ t.boolean "selected", default: false
790
+ t.decimal "cost", precision: 8, scale: 2, default: "0.0"
791
+ t.datetime "created_at"
792
+ t.datetime "updated_at"
793
+ t.integer "tax_rate_id"
794
+ t.index ["shipment_id", "shipping_method_id"], name: "spree_shipping_rates_join_index", unique: true
795
+ end
796
+
797
+ create_table "spree_state_changes", force: :cascade do |t|
798
+ t.string "name"
799
+ t.string "previous_state"
800
+ t.integer "stateful_id"
801
+ t.integer "user_id"
802
+ t.string "stateful_type"
803
+ t.string "next_state"
804
+ t.datetime "created_at"
805
+ t.datetime "updated_at"
806
+ t.index ["stateful_id", "stateful_type"], name: "index_spree_state_changes_on_stateful_id_and_stateful_type"
807
+ t.index ["user_id"], name: "index_spree_state_changes_on_user_id"
808
+ end
809
+
810
+ create_table "spree_states", force: :cascade do |t|
811
+ t.string "name"
812
+ t.string "abbr"
813
+ t.integer "country_id"
814
+ t.datetime "updated_at"
815
+ t.datetime "created_at"
816
+ t.index ["country_id"], name: "index_spree_states_on_country_id"
817
+ end
818
+
819
+ create_table "spree_stock_items", force: :cascade do |t|
820
+ t.integer "stock_location_id"
821
+ t.integer "variant_id"
822
+ t.integer "count_on_hand", default: 0, null: false
823
+ t.datetime "created_at"
824
+ t.datetime "updated_at"
825
+ t.boolean "backorderable", default: false
826
+ t.datetime "deleted_at"
827
+ t.index ["deleted_at"], name: "index_spree_stock_items_on_deleted_at"
828
+ t.index ["stock_location_id", "variant_id"], name: "stock_item_by_loc_and_var_id"
829
+ t.index ["stock_location_id"], name: "index_spree_stock_items_on_stock_location_id"
830
+ t.index ["variant_id", "stock_location_id"], name: "index_spree_stock_items_on_variant_id_and_stock_location_id", unique: true, where: "deleted_at is null"
831
+ end
832
+
833
+ create_table "spree_stock_locations", force: :cascade do |t|
834
+ t.string "name"
835
+ t.datetime "created_at"
836
+ t.datetime "updated_at"
837
+ t.boolean "default", default: false, null: false
838
+ t.string "address1"
839
+ t.string "address2"
840
+ t.string "city"
841
+ t.integer "state_id"
842
+ t.string "state_name"
843
+ t.integer "country_id"
844
+ t.string "zipcode"
845
+ t.string "phone"
846
+ t.boolean "active", default: true
847
+ t.boolean "backorderable_default", default: false
848
+ t.boolean "propagate_all_variants", default: true
849
+ t.string "admin_name"
850
+ t.integer "position", default: 0
851
+ t.boolean "restock_inventory", default: true, null: false
852
+ t.boolean "fulfillable", default: true, null: false
853
+ t.string "code"
854
+ t.boolean "check_stock_on_transfer", default: true
855
+ t.index ["country_id"], name: "index_spree_stock_locations_on_country_id"
856
+ t.index ["state_id"], name: "index_spree_stock_locations_on_state_id"
857
+ end
858
+
859
+ create_table "spree_stock_movements", force: :cascade do |t|
860
+ t.integer "stock_item_id"
861
+ t.integer "quantity", default: 0
862
+ t.string "action"
863
+ t.datetime "created_at", null: false
864
+ t.datetime "updated_at", null: false
865
+ t.string "originator_type"
866
+ t.integer "originator_id"
867
+ t.index ["stock_item_id"], name: "index_spree_stock_movements_on_stock_item_id"
868
+ end
869
+
870
+ create_table "spree_stock_transfers", force: :cascade do |t|
871
+ t.string "description"
872
+ t.integer "source_location_id"
873
+ t.integer "destination_location_id"
874
+ t.datetime "created_at"
875
+ t.datetime "updated_at"
876
+ t.string "number"
877
+ t.datetime "shipped_at"
878
+ t.datetime "closed_at"
879
+ t.string "tracking_number"
880
+ t.integer "created_by_id"
881
+ t.integer "closed_by_id"
882
+ t.datetime "finalized_at"
883
+ t.integer "finalized_by_id"
884
+ t.datetime "deleted_at"
885
+ t.index ["closed_at"], name: "index_spree_stock_transfers_on_closed_at"
886
+ t.index ["destination_location_id"], name: "index_spree_stock_transfers_on_destination_location_id"
887
+ t.index ["finalized_at"], name: "index_spree_stock_transfers_on_finalized_at"
888
+ t.index ["number"], name: "index_spree_stock_transfers_on_number"
889
+ t.index ["shipped_at"], name: "index_spree_stock_transfers_on_shipped_at"
890
+ t.index ["source_location_id"], name: "index_spree_stock_transfers_on_source_location_id"
891
+ end
892
+
893
+ create_table "spree_store_credit_categories", force: :cascade do |t|
894
+ t.string "name"
895
+ t.datetime "created_at"
896
+ t.datetime "updated_at"
897
+ end
898
+
899
+ create_table "spree_store_credit_events", force: :cascade do |t|
900
+ t.integer "store_credit_id", null: false
901
+ t.string "action", null: false
902
+ t.decimal "amount", precision: 8, scale: 2
903
+ t.decimal "user_total_amount", precision: 8, scale: 2, default: "0.0", null: false
904
+ t.string "authorization_code", null: false
905
+ t.datetime "deleted_at"
906
+ t.string "originator_type"
907
+ t.integer "originator_id"
908
+ t.datetime "created_at"
909
+ t.datetime "updated_at"
910
+ t.integer "update_reason_id"
911
+ t.index ["deleted_at"], name: "index_spree_store_credit_events_on_deleted_at"
912
+ t.index ["store_credit_id"], name: "index_spree_store_credit_events_on_store_credit_id"
913
+ end
914
+
915
+ create_table "spree_store_credit_types", force: :cascade do |t|
916
+ t.string "name"
917
+ t.integer "priority"
918
+ t.datetime "created_at"
919
+ t.datetime "updated_at"
920
+ t.index ["priority"], name: "index_spree_store_credit_types_on_priority"
921
+ end
922
+
923
+ create_table "spree_store_credit_update_reasons", force: :cascade do |t|
924
+ t.string "name"
925
+ t.datetime "created_at"
926
+ t.datetime "updated_at"
927
+ end
928
+
929
+ create_table "spree_store_credits", force: :cascade do |t|
930
+ t.integer "user_id"
931
+ t.integer "category_id"
932
+ t.integer "created_by_id"
933
+ t.decimal "amount", precision: 8, scale: 2, default: "0.0", null: false
934
+ t.decimal "amount_used", precision: 8, scale: 2, default: "0.0", null: false
935
+ t.decimal "amount_authorized", precision: 8, scale: 2, default: "0.0", null: false
936
+ t.string "currency"
937
+ t.text "memo"
938
+ t.datetime "spree_store_credits"
939
+ t.datetime "deleted_at"
940
+ t.datetime "created_at"
941
+ t.datetime "updated_at"
942
+ t.integer "type_id"
943
+ t.datetime "invalidated_at"
944
+ t.index ["deleted_at"], name: "index_spree_store_credits_on_deleted_at"
945
+ t.index ["type_id"], name: "index_spree_store_credits_on_type_id"
946
+ t.index ["user_id"], name: "index_spree_store_credits_on_user_id"
947
+ end
948
+
949
+ create_table "spree_store_payment_methods", force: :cascade do |t|
950
+ t.integer "store_id", null: false
951
+ t.integer "payment_method_id", null: false
952
+ t.datetime "created_at", null: false
953
+ t.datetime "updated_at", null: false
954
+ t.index ["payment_method_id"], name: "index_spree_store_payment_methods_on_payment_method_id"
955
+ t.index ["store_id"], name: "index_spree_store_payment_methods_on_store_id"
956
+ end
957
+
958
+ create_table "spree_stores", force: :cascade do |t|
959
+ t.string "name"
960
+ t.string "url"
961
+ t.text "meta_description"
962
+ t.text "meta_keywords"
963
+ t.string "seo_title"
964
+ t.string "mail_from_address"
965
+ t.string "default_currency"
966
+ t.string "code"
967
+ t.boolean "default", default: false, null: false
968
+ t.datetime "created_at"
969
+ t.datetime "updated_at"
970
+ t.string "cart_tax_country_iso"
971
+ t.index ["code"], name: "index_spree_stores_on_code"
972
+ t.index ["default"], name: "index_spree_stores_on_default"
973
+ end
974
+
975
+ create_table "spree_tax_categories", force: :cascade do |t|
976
+ t.string "name"
977
+ t.string "description"
978
+ t.boolean "is_default", default: false
979
+ t.datetime "deleted_at"
980
+ t.datetime "created_at"
981
+ t.datetime "updated_at"
982
+ t.string "tax_code"
983
+ end
984
+
985
+ create_table "spree_tax_rates", force: :cascade do |t|
986
+ t.decimal "amount", precision: 8, scale: 5
987
+ t.integer "zone_id"
988
+ t.integer "tax_category_id"
989
+ t.boolean "included_in_price", default: false
990
+ t.datetime "created_at"
991
+ t.datetime "updated_at"
992
+ t.string "name"
993
+ t.boolean "show_rate_in_label", default: true
994
+ t.datetime "deleted_at"
995
+ t.index ["deleted_at"], name: "index_spree_tax_rates_on_deleted_at"
996
+ t.index ["tax_category_id"], name: "index_spree_tax_rates_on_tax_category_id"
997
+ t.index ["zone_id"], name: "index_spree_tax_rates_on_zone_id"
998
+ end
999
+
1000
+ create_table "spree_taxonomies", force: :cascade do |t|
1001
+ t.string "name", null: false
1002
+ t.datetime "created_at"
1003
+ t.datetime "updated_at"
1004
+ t.integer "position", default: 0
1005
+ t.index ["position"], name: "index_spree_taxonomies_on_position"
1006
+ end
1007
+
1008
+ create_table "spree_taxons", force: :cascade do |t|
1009
+ t.integer "parent_id"
1010
+ t.integer "position", default: 0
1011
+ t.string "name", null: false
1012
+ t.string "permalink"
1013
+ t.integer "taxonomy_id"
1014
+ t.integer "lft"
1015
+ t.integer "rgt"
1016
+ t.string "icon_file_name"
1017
+ t.string "icon_content_type"
1018
+ t.integer "icon_file_size"
1019
+ t.datetime "icon_updated_at"
1020
+ t.text "description"
1021
+ t.datetime "created_at"
1022
+ t.datetime "updated_at"
1023
+ t.string "meta_title"
1024
+ t.string "meta_description"
1025
+ t.string "meta_keywords"
1026
+ t.integer "depth"
1027
+ t.index ["parent_id"], name: "index_taxons_on_parent_id"
1028
+ t.index ["permalink"], name: "index_taxons_on_permalink"
1029
+ t.index ["position"], name: "index_spree_taxons_on_position"
1030
+ t.index ["taxonomy_id"], name: "index_taxons_on_taxonomy_id"
1031
+ end
1032
+
1033
+ create_table "spree_transfer_items", force: :cascade do |t|
1034
+ t.integer "variant_id", null: false
1035
+ t.integer "stock_transfer_id", null: false
1036
+ t.integer "expected_quantity", default: 0, null: false
1037
+ t.integer "received_quantity", default: 0, null: false
1038
+ t.datetime "created_at"
1039
+ t.datetime "updated_at"
1040
+ t.datetime "deleted_at"
1041
+ t.index ["stock_transfer_id"], name: "index_spree_transfer_items_on_stock_transfer_id"
1042
+ t.index ["variant_id"], name: "index_spree_transfer_items_on_variant_id"
1043
+ end
1044
+
1045
+ create_table "spree_unit_cancels", force: :cascade do |t|
1046
+ t.integer "inventory_unit_id", null: false
1047
+ t.string "reason"
1048
+ t.string "created_by"
1049
+ t.datetime "created_at"
1050
+ t.datetime "updated_at"
1051
+ t.index ["inventory_unit_id"], name: "index_spree_unit_cancels_on_inventory_unit_id"
1052
+ end
1053
+
1054
+ create_table "spree_user_addresses", force: :cascade do |t|
1055
+ t.integer "user_id", null: false
1056
+ t.integer "address_id", null: false
1057
+ t.boolean "default", default: false
1058
+ t.boolean "archived", default: false
1059
+ t.datetime "created_at", null: false
1060
+ t.datetime "updated_at", null: false
1061
+ t.index ["address_id"], name: "index_spree_user_addresses_on_address_id"
1062
+ t.index ["user_id", "address_id"], name: "index_spree_user_addresses_on_user_id_and_address_id", unique: true
1063
+ t.index ["user_id"], name: "index_spree_user_addresses_on_user_id"
1064
+ end
1065
+
1066
+ create_table "spree_user_stock_locations", force: :cascade do |t|
1067
+ t.integer "user_id"
1068
+ t.integer "stock_location_id"
1069
+ t.datetime "created_at"
1070
+ t.datetime "updated_at"
1071
+ t.index ["user_id"], name: "index_spree_user_stock_locations_on_user_id"
1072
+ end
1073
+
1074
+ create_table "spree_variant_property_rule_conditions", force: :cascade do |t|
1075
+ t.integer "option_value_id"
1076
+ t.integer "variant_property_rule_id"
1077
+ t.datetime "created_at", null: false
1078
+ t.datetime "updated_at", null: false
1079
+ t.index ["variant_property_rule_id", "option_value_id"], name: "index_spree_variant_prop_rule_conditions_on_rule_and_optval"
1080
+ end
1081
+
1082
+ create_table "spree_variant_property_rule_values", force: :cascade do |t|
1083
+ t.text "value"
1084
+ t.integer "position", default: 0
1085
+ t.integer "property_id"
1086
+ t.integer "variant_property_rule_id"
1087
+ t.datetime "created_at"
1088
+ t.datetime "updated_at"
1089
+ t.index ["property_id"], name: "index_spree_variant_property_rule_values_on_property_id"
1090
+ t.index ["variant_property_rule_id"], name: "index_spree_variant_property_rule_values_on_rule"
1091
+ end
1092
+
1093
+ create_table "spree_variant_property_rules", force: :cascade do |t|
1094
+ t.integer "product_id"
1095
+ t.datetime "created_at", null: false
1096
+ t.datetime "updated_at", null: false
1097
+ t.index ["product_id"], name: "index_spree_variant_property_rules_on_product_id"
1098
+ end
1099
+
1100
+ create_table "spree_variants", force: :cascade do |t|
1101
+ t.string "sku", default: "", null: false
1102
+ t.decimal "weight", precision: 8, scale: 2, default: "0.0"
1103
+ t.decimal "height", precision: 8, scale: 2
1104
+ t.decimal "width", precision: 8, scale: 2
1105
+ t.decimal "depth", precision: 8, scale: 2
1106
+ t.datetime "deleted_at"
1107
+ t.boolean "is_master", default: false
1108
+ t.integer "product_id"
1109
+ t.decimal "cost_price", precision: 10, scale: 2
1110
+ t.integer "position"
1111
+ t.string "cost_currency"
1112
+ t.boolean "track_inventory", default: true
1113
+ t.integer "tax_category_id"
1114
+ t.datetime "updated_at"
1115
+ t.datetime "created_at"
1116
+ t.index ["position"], name: "index_spree_variants_on_position"
1117
+ t.index ["product_id"], name: "index_spree_variants_on_product_id"
1118
+ t.index ["sku"], name: "index_spree_variants_on_sku"
1119
+ t.index ["tax_category_id"], name: "index_spree_variants_on_tax_category_id"
1120
+ t.index ["track_inventory"], name: "index_spree_variants_on_track_inventory"
1121
+ end
1122
+
1123
+ create_table "spree_wallet_payment_sources", force: :cascade do |t|
1124
+ t.integer "user_id", null: false
1125
+ t.string "payment_source_type", null: false
1126
+ t.integer "payment_source_id", null: false
1127
+ t.boolean "default", default: false, null: false
1128
+ t.datetime "created_at", null: false
1129
+ t.datetime "updated_at", null: false
1130
+ t.index ["user_id", "payment_source_id", "payment_source_type"], name: "index_spree_wallet_payment_sources_on_source_and_user", unique: true
1131
+ t.index ["user_id"], name: "index_spree_wallet_payment_sources_on_user_id"
1132
+ end
1133
+
1134
+ create_table "spree_zone_members", force: :cascade do |t|
1135
+ t.string "zoneable_type"
1136
+ t.integer "zoneable_id"
1137
+ t.integer "zone_id"
1138
+ t.datetime "created_at"
1139
+ t.datetime "updated_at"
1140
+ t.index ["zone_id"], name: "index_spree_zone_members_on_zone_id"
1141
+ t.index ["zoneable_id", "zoneable_type"], name: "index_spree_zone_members_on_zoneable_id_and_zoneable_type"
1142
+ end
1143
+
1144
+ create_table "spree_zones", force: :cascade do |t|
1145
+ t.string "name"
1146
+ t.string "description"
1147
+ t.boolean "default_tax", default: false
1148
+ t.integer "zone_members_count", default: 0
1149
+ t.datetime "created_at"
1150
+ t.datetime "updated_at"
1151
+ end
1152
+ end
1153
+ end