Pau Perez
0cbd967007
Remove in_stock dead scope
...
This makes the upgrade to Spree 2.0 a bit easier.
`spree_variants.count_on_hand` is removed in that version and this
column was used in the `in_stock` scope that we no longer use.
2018-03-28 12:13:34 +02:00
Rob Harrington
946046e53b
Moving action for estimating standing_line_item prices into StandingLineItemController#build
2018-02-09 14:43:31 +11:00
Pau Perez
6cb038c362
Autocorrect rubocop Layout/BlockEndNewline cop
2018-02-01 09:52:53 +01:00
Pierre de Lacroix
f67a8c1f2d
Add tests
2017-12-01 13:37:24 +11:00
Rob Harrington
59578a73af
Changing all references to 'be_true' and 'be_false' to 'be true' and 'be false'
...
See next commit for changes where this substitution was broken
2017-11-10 08:47:12 +11:00
Rohan Mitchell
422061f137
Merge branch 'master' into products-caching
...
Conflicts:
app/controllers/shop_controller.rb
app/models/enterprise_fee.rb
app/models/order_cycle.rb
app/models/variant_override.rb
db/schema.rb
lib/open_food_network/products_renderer.rb
spec/lib/open_food_network/products_renderer_spec.rb
2016-03-03 09:42:52 +11:00
Rob Harrington
1d83809866
Bugfix: Spree::Variant#not_hidden_for scope was broken
...
Was getting confused by presence of inventory items for other enterprises when none existed for a given variant/enterprise combo
2016-03-02 12:10:22 +11:00
Rob Harrington
77e74c5642
OC Coordinators can opt to restrict products in an order cycle to those in their inventory only
2016-03-02 12:10:22 +11:00
Rob Harrington
f05f88c1cb
Adding global config to allow shop users to only select from inventory variants in OC interface
2016-03-02 12:10:22 +11:00
Rohan Mitchell
d8d803546b
Refresh products cache when master variants or images are changed or destroyed
2016-02-24 15:05:02 +11:00
Rohan Mitchell
eba636c929
When variant is changed/destroyed, trigger product cache refresh
2016-02-24 15:05:01 +11:00
Rob Harrington
befc558224
Pulling product_and_variant_name down into VariantAndLineItemNaming, renaming to product_and_full_name
...
Also allowing this method to be used in reports (Xero), to reflect appropriate name for weight/volume adjusted line items
2015-12-16 11:55:24 +11:00
Maikel Linke
cd7721a127
Using date and time of current timezone
...
Using Time.zone.now and Date.current instead of Time.now and Date.today.
This should make all specs timezone independent.
2015-12-10 11:38:41 +11:00
Rohan Mitchell
10edb2b056
Fix delayed job startup - prevent error caused by double load
2015-12-02 10:48:50 +11:00
Rob Harrington
ab7bfd10c5
Revert "Renaming options_text to unit_text so that we can use method from included VariantAndLineItemNaming module"
...
This reverts commit e86e08b72e939fee61eddd41d56081395666a877.
Conflicts:
lib/open_food_network/order_and_distributor_report.rb
spec/features/admin/variants_spec.rb
spec/lib/open_food_network/order_and_distributor_report_spec.rb
2015-10-28 13:08:50 +11:00
Rob Harrington
eba13a0dd7
Line items inherit units from variants upon creation
2015-10-28 13:07:31 +11:00
Rob Harrington
795830d94d
Renaming options_text to unit_text so that we can use method from included VariantAndLineItemNaming module
2015-10-28 13:07:31 +11:00
Rob Harrington
039fcb80eb
Extracting variant and option_value naming out into a lib class that is now shared between line items and variants, line_items have option_values
2015-10-28 13:06:10 +11:00
Rohan Mitchell
7552776349
Add product_and_variant_name display for Variant
2015-09-21 16:49:31 +10:00
Rohan Mitchell
27bc28ffa4
Index variants by id
2015-06-04 12:09:34 +10:00
Rohan Mitchell
7486daa2a3
Merge branch 'master' into require_standard_variant
...
Conflicts:
spec/controllers/spree/admin/variants_controller_spec.rb
spec/lib/open_food_network/permissions_spec.rb
spec/lib/open_food_network/products_and_inventory_report_spec.rb
spec/models/enterprise_spec.rb
2015-05-28 15:08:13 +10:00
Rohan Mitchell
97e49c2bdb
Replace 'array.sort.should == expected.sort' pattern with match_array
2015-05-28 10:46:08 +10:00
Rob Harrington
ff2e6d9ca4
Test deletion rather than destruction on variant model spec
2015-04-17 17:25:13 +10:00
Rob Harrington
2b47c9145a
Cannot delete last variant of product
2015-04-17 11:25:17 +10:00
Rob Harrington
fcb3bc894b
Cleanup
2015-04-17 11:25:17 +10:00
Rob Harrington
89afbc80a6
Set initial on_hand to 0
2015-04-17 11:25:17 +10:00
Rob Harrington
0a7b01ff07
Product requires variant_unit and master requires unit_value and/or unit_desc
2015-04-17 11:25:16 +10:00
Rohan Mitchell
34d1841d22
Make Variant#full_name resilient to regex chars
2015-04-16 10:59:15 +10:00
Rohan Mitchell
6c300431d2
Move Product#variants_for to Variant.for_distribution scope
2014-12-17 13:42:30 +11:00
Rohan Mitchell
8c41a6c909
Calculate fee breakdown
2014-07-31 11:36:53 +10:00
Rohan Mitchell
b40b6f9faf
WIP: Call fees_for on EnterpriseFeeCalculator
2014-07-31 11:36:53 +10:00
Rohan Mitchell
b7a08bcb9b
Add Spree::Variant.in_order_cycle
2014-07-16 09:33:59 +10:00
Rohan Mitchell
0ecfee79d4
Add Spree::Variant.in_distributor
2014-07-16 09:33:59 +10:00
Rob H
fa337fcd6e
Prevent display_as and display_name from being used when blank
2014-07-10 17:04:35 +10:00
Will Marshall
7a062b0310
Reworking the variant display of units and names
2014-06-12 16:13:51 +10:00
Rob H
9f681bd1ef
Use display_as as option value for variant when it is present
2014-06-12 12:57:56 +10:00
Rob H
1a91b5a728
Move option value naming logic into separate lib class
2014-06-12 12:55:53 +10:00
Rob H
2c78d537fa
Use display_as as option value for variant when it is present
2014-06-12 11:49:52 +10:00
Rob H
e9f2a8f2cd
Move option value naming logic into separate lib class
2014-06-12 11:49:52 +10:00
Rohan Mitchell
4cbe434573
Remove trailing relations on destruction for EnterpriseFee and Variant
2014-04-24 13:20:15 +10:00
Rohan Mitchell
47ac097eb7
Do not show deleted variants on shopfront
2014-04-11 19:08:55 +10:00
Rohan Mitchell
da6ba04780
Update variant weight from unit value when unit is weight
2014-03-28 15:34:26 +11:00
Rohan Mitchell
0d97397084
Fix fragile specs (ordering)
2014-03-12 15:00:20 +11:00
Rohan Mitchell
17debd9fad
On product list view, do not show variants that are out of stock
2014-03-05 13:54:02 +11:00
Rohan Mitchell
aa9b5c84d9
Fix expected variant option type name/presentation
2014-02-06 16:14:29 +11:00
Rohan Mitchell
f187041606
Do not display a space separating units and scaled values. eg. 1kg, 4 boxes
2014-02-06 14:05:26 +11:00
Rohan Mitchell
d0fd48456e
Variant calculates fees and its price inclusive of fees
2014-02-05 14:01:10 +11:00
Rohan Mitchell
5e0515e6c5
Variant value expression returns a value of 1 when unit value equals the scale
2014-01-17 16:12:07 +11:00
Rohan Mitchell
28c641a932
Remove redundant test stubs
2014-01-10 15:44:16 +11:00
Rohan Mitchell
a60c9a9cea
When variant already has a value set, remove old option value and assign a new one
2014-01-09 14:11:54 +11:00