Compare commits

...

152 Commits

Author SHA1 Message Date
Pau Perez
1abdd0112e Update all locales with the latest Transifex translations 2020-10-31 10:46:12 +01:00
Pau Pérez Fabregat
bc6ffe3b0c Merge pull request #6242 from openfoodfoundation/transifex
Transifex
2020-10-31 10:36:12 +01:00
Luis Ramos
eea73aa989 Merge pull request #5919 from luisramos0/injector_refactor_for_rails41
[Rails 4.1, works in master] Convert relations with to_a so that they work in rails 4.1
2020-10-31 09:33:27 +00:00
Pau Pérez Fabregat
03b0ce430d Merge branch 'master' into transifex 2020-10-31 10:05:27 +01:00
Luis Ramos
ad14f7f9b0 Merge pull request #6203 from luisramos0/rubocop_fix
Fix ~80 rubocop issues in serializers/api/admin
2020-10-30 16:48:22 +00:00
Luis Ramos
7cc7c62232 Fix long lines 2020-10-30 16:14:39 +00:00
Luis Ramos
b6dc46a911 Fix rubocop issue by nesting module and class declarations
No file contents changed
2020-10-30 16:14:34 +00:00
Luis Ramos
0b70c67908 Merge pull request #5994 from openfoodfoundation/tcs_checkbox
Terms and Conditions checkbox on checkout
2020-10-30 15:10:06 +00:00
Luis Ramos
71a181341b Fix bug in terms_and_conditions_helper related to guest checkout where current_user is nil and T&Cs must be shown all the time 2020-10-30 15:09:13 +00:00
Luis Ramos
cf3f511f4d Add directive spec to validate the dialog template is loaded on element click 2020-10-30 15:09:13 +00:00
Luis Ramos
1d1067ebc1 Add coverage to T&Cs file opening on a new tab and also for the upload timestamp now displayed in the page 2020-10-30 15:09:13 +00:00
Luis Ramos
bd4d0ba5d3 Make the warning message work for first upload and for changes 2020-10-30 15:09:13 +00:00
Luis Ramos
3b682bc47f Add warning when uploading a file 2020-10-30 15:09:13 +00:00
Luis Ramos
be35f97622 Add tooltip icon to terms and conditions 2020-10-30 15:09:13 +00:00
Luis Ramos
ca79270ba3 Show T&Cs warning when uploading a new file 2020-10-30 15:09:13 +00:00
Luis Ramos
2cf7b1b36c Make label translatable 2020-10-30 15:09:13 +00:00
Luis Ramos
f7c07f492c Make TCs file input onoy accept pdf files 2020-10-30 15:09:13 +00:00
Luis Ramos
9f17e4fd8f Add upload timestamp to TCs upload form in enterprise business details 2020-10-30 15:09:13 +00:00
Luis Ramos
c980d22826 Make TCs link open in a new tab in the backoffice 2020-10-30 15:09:13 +00:00
Luis Ramos
ceee89fad0 Make Checkout form submit read terms_and_conditions_accepted from the checkout form checkbox 2020-10-30 15:09:13 +00:00
Luis Ramos
a942218708 Fix post checkout actions spec 2020-10-30 15:09:13 +00:00
Luis Ramos
26946ec102 Fix edge case and some specs in post checkout actions 2020-10-30 15:09:13 +00:00
Luis Ramos
dd31cbe014 Cover case where enterprise uploads new T&Cs file and customer has already accepted before 2020-10-30 15:09:13 +00:00
Luis Ramos
46733d0c0d Add feature spec to cover T&Cs ticked by default if customer has already accepted them 2020-10-30 15:09:13 +00:00
Luis Ramos
57a9d6e1e2 Make customer terms_and_conditions_accepted_at be set to current time
after a successful checkout
2020-10-30 15:09:13 +00:00
Luis Ramos
ad592785cf Rename methods to follwo ruby convention and improve readability 2020-10-30 15:09:13 +00:00
Luis Ramos
f3ba0ebdbb Move code to a new helper 2020-10-30 15:09:13 +00:00
Luis Ramos
4d64bf6ece Add column to customers table to register last time enterprise terms and
conditions were accepted so customer doesnt have to accept terms on all
checkouts but only when the enterprise updates the terms file
2020-10-30 15:09:13 +00:00
Luis Ramos
3c9c5862d1 Verify terms and conditions updated_at timestamp is touched every time the file name changes.
We will need this to check if user already accepted the terms and
conditions of this enterprise.
2020-10-30 15:08:26 +00:00
Luis Ramos
78a8f53d8d Change default translations to what's been requested on the issue 2020-10-30 15:08:26 +00:00
Luis Ramos
806c8b943d Move small class to label so that rule is actually applied 2020-10-30 15:08:26 +00:00
Luis Ramos
85096a997f Add a checkbox to checkout to tick for Terms and Conditions
Checkout button should be disabled if checkbox is not ticked
2020-10-30 15:08:26 +00:00
Transifex-Openfoodnetwork
19b6cb13f1 Updating translations for config/locales/pt_BR.yml 2020-10-31 01:36:45 +11:00
Transifex-Openfoodnetwork
dd228cc750 Updating translations for config/locales/ar.yml 2020-10-30 22:39:44 +11:00
Luis Ramos
586e8a9abe Fix some more rubocop issues 2020-10-30 10:13:16 +00:00
Luis Ramos
1847b62cf4 Fix some rubocop issues 2020-10-30 10:12:56 +00:00
Luis Ramos
0618c9e4dd Fix line_items_decorator spec 2020-10-30 10:12:56 +00:00
Luis Ramos
d15301021a Rename inject_json_list to inject_json_array 2020-10-30 10:12:56 +00:00
Luis Ramos
55e8dace44 Fix sort_by issue on relation by calling to_a 2020-10-30 10:12:56 +00:00
Luis Ramos
9a9b455e66 Fix problem in default_tax related to sum in active record 2020-10-30 10:12:56 +00:00
Luis Ramos
399fe2c01b Make code work for relations and arrays 2020-10-30 10:12:56 +00:00
Luis Ramos
3aeb87debc Make it work with both relations and arrays 2020-10-30 10:12:56 +00:00
Luis Ramos
7b06fdd943 Convert to array before using sort_by! 2020-10-30 10:12:56 +00:00
Luis Ramos
6755354196 Convert relation to_a to be able to use sum 2020-10-30 10:12:56 +00:00
Luis Ramos
440e69e156 Convert relation to array to be able to use sum 2020-10-30 10:12:47 +00:00
Luis Ramos
a53223aefc Convert relation to array before using array only method sort_by! 2020-10-30 10:10:54 +00:00
Luis Ramos
cc1b4123b7 Make model_set handle collections that are relations and not arrays 2020-10-30 10:10:54 +00:00
Luis Ramos
65ce183830 Make checkout_adjustments_for handle adjustments if a relation is given 2020-10-30 10:10:54 +00:00
Luis Ramos
7e606471e4 Make tag_rulee_applicator and available_payment_methods_filter handle case where a relation is given instead of an array 2020-10-30 10:10:54 +00:00
Luis Ramos
1dace1f0e3 Make quantifier use stock_items relation and not an array because sum will behave differently with an array in rails 4.1 2020-10-30 10:10:54 +00:00
Luis Ramos
08d26102d2 Separate injection methods so that we can have a separate behaviour for lists without having to check their types
This change is required for rails 4.1 where the relations api changed
2020-10-30 10:10:54 +00:00
Transifex-Openfoodnetwork
35790b3cca Updating translations for config/locales/en_FR.yml 2020-10-30 19:29:20 +11:00
Transifex-Openfoodnetwork
2ce05d48bf Updating translations for config/locales/fr.yml 2020-10-30 19:29:05 +11:00
Luis Ramos
6b826423c1 Merge pull request #6145 from andrewpbrett/instance-unit-picker
Allow instances to choose available units for products/variants
2020-10-29 22:22:33 +00:00
Luis Ramos
412457bb19 Merge pull request #6122 from luisramos0/customer_total
Add Customer balance to customer list
2020-10-29 22:06:05 +00:00
Andy Brett
2605b9cdf0 refactor unitScales function 2020-10-29 09:18:24 -07:00
Andy Brett
867947f6b2 refactor availableUnitScales into unitScales 2020-10-29 09:18:24 -07:00
Andy Brett
8d9b33abe8 update spec with new param structure 2020-10-29 09:18:24 -07:00
Andy Brett
57fe1db10e guard against nil params[:available_units] 2020-10-29 09:18:24 -07:00
Andy Brett
18d2599075 indicate block argument is unused 2020-10-29 09:18:24 -07:00
Andy Brett
292b33b4ea simplify available units params (and remove regex!) 2020-10-29 09:18:24 -07:00
Andy Brett
8591934c19 extract availableUnits to separate method 2020-10-29 09:18:24 -07:00
Andy Brett
9bf84bd5a8 provide default availableUnits to specs 2020-10-29 09:18:24 -07:00
Andy Brett
67a603f77f inject available_units for new variant creation 2020-10-29 09:18:24 -07:00
Andy Brett
331ac28b71 inject available units to edit variants page 2020-10-29 09:18:24 -07:00
Andy Brett
3ead050a56 provide availableUnits to VariantUnitManager spec 2020-10-29 09:18:24 -07:00
Andy Brett
23dd09eaad remove extra debugger statement 🤦 2020-10-29 09:18:23 -07:00
Andy Brett
8585e6c7f0 add available units injection to BOM page 2020-10-29 09:18:19 -07:00
Andy Brett
866452383d rubocop fix 2020-10-29 09:17:49 -07:00
Andy Brett
402fc902ff remove non-default units from expected options array 2020-10-29 09:17:49 -07:00
Andy Brett
8f21b66b96 add controller spec for updating available units 2020-10-29 09:17:49 -07:00
Andy Brett
c9b540677c refactor general settings controller to handle available_units params 2020-10-29 09:17:49 -07:00
Andy Brett
4f579facfe move all_units to admin helper 2020-10-29 09:17:49 -07:00
Andy Brett
fa62ec0bff only show available units for products 2020-10-29 09:17:49 -07:00
Andy Brett
cb3ea133e9 add available units to instance prefs page 2020-10-29 09:17:31 -07:00
Luis Ramos
10490536e2 Merge pull request #6244 from cillian/configurable-geocoder-service
Allow Geocoder to be configured to use different APIs
2020-10-29 16:12:52 +00:00
Luis Ramos
a43737af8b Merge pull request #6266 from jhsu802701/rubocop_web_helper
Exempted spec/support/request/web_helper.rb from Metrics/AbcSize
2020-10-29 13:52:15 +00:00
Luis Ramos
0138f04506 Add spec to cover new customer balances on customers list 2020-10-29 13:38:36 +00:00
Luis Ramos
4a2684e3d9 Fix rubocop issues 2020-10-29 13:38:36 +00:00
Luis Ramos
e860e2ca57 Add label to customer balance so it's clear to the manager what's the balance status: credit owed or balance due 2020-10-29 13:38:36 +00:00
Luis Ramos
da69dca471 Make customer balance serialize with the currency 2020-10-29 13:38:36 +00:00
Luis Ramos
e4f3aae7c0 Add customer balance to customer list 2020-10-29 13:38:36 +00:00
Luis Ramos
72ae7ea8a2 Merge pull request #6267 from jhsu802701/rubocop_shopworkflow_2
Removed variant argument from click_add_bulk_max_to_cart
2020-10-29 13:36:58 +00:00
Jason Hsu
8f95de10bc Removed variant argument from click_add_bulk_max_to_cart; updated spec/features/consumer/shopping/shopping_spec.rb to reflect this 2020-10-29 00:35:49 -05:00
Jason Hsu
cbe1b53189 Exempted spec/support/request/web_helper.rb from Metrics/AbcSize; reduces the number of offenses from 122 to 121 2020-10-29 00:23:30 -05:00
Transifex-Openfoodnetwork
9c30c3c0ed Updating translations for config/locales/ar.yml 2020-10-29 11:15:12 +11:00
Luis Ramos
9a03428412 Merge pull request #6197 from cillian/reset-on-demand-on-absent-products
When resetting stock to 0 on absent products in product import also reset the on demand setting
2020-10-29 00:09:49 +00:00
Luis Ramos
76afc0b407 Merge pull request #6202 from cillian/sort-admin-products-by-name-fix
Fix sorting of admin products by name
2020-10-29 00:09:31 +00:00
Luis Ramos
200e9c5078 Merge pull request #6246 from tsara27/fix-shipping-method-translation
Add new translation for shipping method
2020-10-29 00:09:14 +00:00
Luis Ramos
caea5b2aa8 Merge pull request #6264 from openfoodfoundation/dependabot/bundler/bugsnag-6.18.0
Bump bugsnag from 6.17.0 to 6.18.0
2020-10-28 21:11:15 +00:00
Luis Ramos
3730d76b44 Merge pull request #6155 from arku/perf/model-specs
Improve model specs' performance
2020-10-28 21:06:10 +00:00
Transifex-Openfoodnetwork
28c25cff2c Updating translations for config/locales/en_IE.yml 2020-10-29 07:08:18 +11:00
Pau Pérez Fabregat
20edcfab26 Merge pull request #6217 from santakadev/docker-open-db-port
Open PostgreSQL port in docker-compose
2020-10-28 17:56:49 +01:00
Pau Pérez Fabregat
642787b95a Merge branch 'master' into reset-on-demand-on-absent-products 2020-10-28 17:28:53 +01:00
Transifex-Openfoodnetwork
a1438d3b2e Updating translations for config/locales/ru.yml 2020-10-29 02:23:55 +11:00
dependabot-preview[bot]
fc8e3d1ece Bump bugsnag from 6.17.0 to 6.18.0
Bumps [bugsnag](https://github.com/bugsnag/bugsnag-ruby) from 6.17.0 to 6.18.0.
- [Release notes](https://github.com/bugsnag/bugsnag-ruby/releases)
- [Changelog](https://github.com/bugsnag/bugsnag-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bugsnag/bugsnag-ruby/compare/v6.17.0...v6.18.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-27 17:41:49 +00:00
Transifex-Openfoodnetwork
21991515df Updating translations for config/locales/ar.yml 2020-10-27 22:56:03 +11:00
Luis Ramos
3534559fbf Merge pull request #6235 from Matt-Yorkley/flaky-tag-rules
[Flaky Specs] Fix tag_rules and select2 issues
2020-10-27 11:40:04 +00:00
Matt-Yorkley
f1373b902c Merge pull request #6256 from luisramos0/rubocop_specs
Relax ModuleLength rubocop rule for specs
2020-10-26 22:41:30 +01:00
Luis Ramos
e5e67fbdf0 Merge pull request #6255 from jhsu802701/fix_docker_up
Added yarn install to docker-compose up
2020-10-26 21:16:09 +00:00
Transifex-Openfoodnetwork
f1e80e92de Updating translations for config/locales/it.yml 2020-10-27 07:18:57 +11:00
Luis Ramos
c5186c2412 Fix rubocop_specs file path 2020-10-26 17:27:38 +00:00
Luis Ramos
52f56baa8c Remove specs with more than 100 lines but less than 300 from rubocop exceptions list 2020-10-26 17:03:54 +00:00
Luis Ramos
0b51d8b297 Add rubocop config to allow specs to be 300 lines long 2020-10-26 17:03:50 +00:00
Luis Ramos
0f5aa11f05 Nest spec in module declaration 2020-10-26 16:50:29 +00:00
Jason Hsu
00624d1b96 Added yarn install to docker-compose up; allows the app to work properly in the Docker environment 2020-10-26 11:07:01 -05:00
Transifex-Openfoodnetwork
7e8aaaa5f9 Updating translations for config/locales/fr.yml 2020-10-27 01:27:40 +11:00
Transifex-Openfoodnetwork
49b8dcb880 Updating translations for config/locales/en_FR.yml 2020-10-27 01:24:49 +11:00
Transifex-Openfoodnetwork
479520bf97 Updating translations for config/locales/fr.yml 2020-10-27 01:24:35 +11:00
Luis Ramos
b66b50cd56 Merge pull request #6125 from tsara27/fix-translation
Fix translation for password reset instruction mailer subject
2020-10-26 12:01:47 +00:00
Transifex-Openfoodnetwork
50cbc971a1 Updating translations for config/locales/pt_BR.yml 2020-10-26 10:13:53 +11:00
Transifex-Openfoodnetwork
7178a69a54 Updating translations for config/locales/pt_BR.yml 2020-10-26 10:10:47 +11:00
Matt-Yorkley
e06e8fc460 Improve flaky form interaction process in #fill_in_tag 2020-10-25 10:17:16 +00:00
Matt-Yorkley
ee402db734 Refactor and DRY tag-rule-filling-in to #fill_in_tag method 2020-10-25 09:01:04 +00:00
Matt-Yorkley
3f1e496731 Fix select2 capybara issues 2020-10-24 23:53:02 +01:00
Transifex-Openfoodnetwork
494f0d8ff6 Updating translations for config/locales/ru.yml 2020-10-24 23:18:00 +11:00
Transifex-Openfoodnetwork
15715f9bb4 Updating translations for config/locales/it.yml 2020-10-24 22:28:59 +11:00
Tsara Sudrajat
4baf53a0a9 Add new translation for shipping method 2020-10-24 17:06:19 +07:00
Transifex-Openfoodnetwork
8041111886 Updating translations for config/locales/ar.yml 2020-10-24 07:34:19 +11:00
Transifex-Openfoodnetwork
adc2bcb442 Updating translations for config/locales/es.yml 2020-10-24 01:40:48 +11:00
Transifex-Openfoodnetwork
8a51c5cb5d Updating translations for config/locales/es.yml 2020-10-24 01:37:39 +11:00
Transifex-Openfoodnetwork
e114d58ff2 Updating translations for config/locales/ca.yml 2020-10-24 01:36:14 +11:00
Transifex-Openfoodnetwork
b7fc3df86a Updating translations for config/locales/fr_CA.yml 2020-10-23 23:18:11 +11:00
Transifex-Openfoodnetwork
01fe12e72b Updating translations for config/locales/fr_CA.yml 2020-10-23 23:15:02 +11:00
Cillian O'Ruanaidh
c5e125747f Allow Geocoder to be configured to use different APIs.
This gives instances the option to use other geocoding services, for example MapBox because instances may not have a Google Maps API key if they are using Open Street Map for their map instead of Google.
2020-10-23 13:09:59 +01:00
Transifex-Openfoodnetwork
3baaa5cc40 Updating translations for config/locales/en_CA.yml 2020-10-23 23:06:57 +11:00
Cillian O'Ruanaidh
e29d6048c2 Add a test for sorting admin products by name 2020-10-23 10:53:30 +01:00
Transifex-Openfoodnetwork
c4ba8db7ed Updating translations for config/locales/en_FR.yml 2020-10-23 19:12:20 +11:00
Transifex-Openfoodnetwork
764169c9ca Updating translations for config/locales/fr.yml 2020-10-23 19:12:17 +11:00
Transifex-Openfoodnetwork
30a1832302 Updating translations for config/locales/en_FR.yml 2020-10-23 19:09:10 +11:00
Transifex-Openfoodnetwork
a07f64f8a8 Updating translations for config/locales/fr.yml 2020-10-23 19:09:07 +11:00
Daniel Santamaría
ca2d66eacf Open PostgreSQL port in docker-compose 2020-10-18 08:45:08 +02:00
Arun Kumar Mohan
c65108731c Define supplier_ids in inventory_reset_strategy specs for clarity 2020-10-17 20:12:14 -05:00
Arun Kumar Mohan
5928eba767 Use build to validate objects from the shipping method factory 2020-10-17 19:59:21 -05:00
Arun Kumar Mohan
874d33caaa Convert multiline blocks to single-line ones 2020-10-17 19:44:57 -05:00
Tsara Sudrajat
66be86cca9 Fix translation on reset password mailer 2020-10-17 17:59:54 +07:00
Cillian O'Ruanaidh
35110eaf4a Make sure :sorting parameter is nested inside the :q parameter to fix sorting of admin products
Fixes #6105.
2020-10-16 15:21:15 +01:00
Cillian O'Ruanaidh
c62f1bd550 Exclude products_reset_strategy_spec.rb from Rubocop's Metrics/ModuleLength check 2020-10-16 12:13:55 +01:00
Cillian O'Ruanaidh
2cc751cb30 When resetting stock to 0 on absent products in product import also reset the on demand setting
Before when you imported products and clicked the 'Set stock to zero for all existing products not present in the file' option it would set the on hand stock to 0 but if the variant was also set to be on demand the product would still be available for sale. This change makes sure the on demand setting is turned off too.

Fixes #6064.
2020-10-16 11:38:49 +01:00
Arun Kumar Mohan
2ec35b6306 Remove unnecessary let declaration 2020-10-13 01:22:11 -05:00
Arun Kumar Mohan
e963ab4bd4 Replace FactoryBot.create with create 2020-10-13 01:21:47 -05:00
Arun Kumar Mohan
14eee1c9e4 Improve product specs' performance 2020-10-11 01:10:11 -05:00
Arun Kumar Mohan
ff049d33e7 Improve variant stock specs' performance 2020-10-10 00:43:27 -05:00
Arun Kumar Mohan
b02e25af0e Improve shipment specs' performance 2020-10-09 23:28:32 -05:00
Arun Kumar Mohan
76293c335b Improve payment specs' performance 2020-10-09 23:05:14 -05:00
Arun Kumar Mohan
01d2c3cb9e Improve variant specs' performance 2020-10-09 22:11:34 -05:00
Arun Kumar Mohan
80c76606df Improve line items specs' performance 2020-10-09 22:11:34 -05:00
Arun Kumar Mohan
b07fbec8c6 Improve credit card specs' performance 2020-10-09 22:11:34 -05:00
Arun Kumar Mohan
c4205fce34 Improve enterprise specs' performance 2020-10-09 22:11:34 -05:00
Arun Kumar Mohan
a959f8e745 Improve inventory reset strategy specs' performance 2020-10-09 22:11:34 -05:00
Arun Kumar Mohan
437c39f795 Improve taxon specs' performance 2020-10-09 22:11:34 -05:00
Arun Kumar Mohan
27f1aeb803 Improve shipping method specs' performance 2020-10-09 22:11:31 -05:00
167 changed files with 2353 additions and 1561 deletions

View File

@@ -42,7 +42,6 @@ Layout/LineLength:
- app/helpers/angular_form_helper.rb
- app/helpers/checkout_helper.rb
- app/helpers/enterprises_helper.rb
- app/helpers/injection_helper.rb
- app/helpers/markdown_helper.rb
- app/helpers/order_cycles_helper.rb
- app/helpers/spree/orders_helper.rb
@@ -88,6 +87,7 @@ Layout/LineLength:
- Gemfile
- lib/discourse/single_sign_on.rb
- lib/open_food_network/available_payment_method_filter.rb
- lib/open_food_network/bulk_coop_report.rb
- lib/open_food_network/customers_report.rb
- lib/open_food_network/enterprise_fee_applicator.rb
- lib/open_food_network/enterprise_fee_calculator.rb
@@ -452,6 +452,7 @@ Metrics/AbcSize:
- spec/services/order_checkout_restart_spec.rb
- spec/support/i18n_translations_checker.rb
- spec/support/performance_helper.rb
- spec/support/request/web_helper.rb
Metrics/BlockLength:
Max: 25
@@ -811,40 +812,17 @@ Metrics/ModuleLength:
- app/helpers/spree/admin/navigation_helper.rb
- app/models/spree/order/checkout.rb
- app/models/spree/payment/processing.rb
- engines/order_management/spec/services/order_management/order/updater_spec.rb
- engines/order_management/spec/services/order_management/stock/package_spec.rb
- engines/order_management/spec/services/order_management/subscriptions/estimator_spec.rb
- engines/order_management/spec/services/order_management/subscriptions/form_spec.rb
- engines/order_management/spec/services/order_management/subscriptions/proxy_order_syncer_spec.rb
- engines/order_management/spec/services/order_management/subscriptions/summarizer_spec.rb
- engines/order_management/spec/services/order_management/subscriptions/validator_spec.rb
- engines/order_management/spec/services/order_management/subscriptions/variants_list_spec.rb
- lib/open_food_network/column_preference_defaults.rb
- spec/controllers/admin/order_cycles_controller_spec.rb
- spec/controllers/api/order_cycles_controller_spec.rb
- spec/controllers/api/orders_controller_spec.rb
- spec/controllers/spree/admin/payment_methods_controller_spec.rb
- spec/lib/open_food_network/address_finder_spec.rb
- spec/lib/open_food_network/customers_report_spec.rb
- spec/lib/open_food_network/enterprise_fee_calculator_spec.rb
- spec/lib/open_food_network/order_cycle_form_applicator_spec.rb
- spec/lib/open_food_network/order_cycle_permissions_spec.rb
- spec/lib/open_food_network/order_grouper_spec.rb
- spec/lib/open_food_network/packing_report_spec.rb
- spec/lib/open_food_network/permissions_spec.rb
- spec/lib/open_food_network/products_and_inventory_report_spec.rb
- spec/lib/open_food_network/scope_variant_to_hub_spec.rb
- spec/lib/open_food_network/tag_rule_applicator_spec.rb
- spec/lib/open_food_network/user_balance_calculator_spec.rb
- spec/lib/open_food_network/users_and_enterprises_report_spec.rb
- spec/models/spree/adjustment_spec.rb
- spec/models/spree/credit_card_spec.rb
- spec/models/spree/line_item_spec.rb
- spec/models/spree/product_spec.rb
- spec/models/spree/shipping_method_spec.rb
- spec/models/spree/variant_spec.rb
- spec/services/permissions/order_spec.rb
- spec/services/variant_units/option_value_namer_spec.rb
Metrics/ParameterLists:
Max: 5

7
.rubocop_specs.yml Normal file
View File

@@ -0,0 +1,7 @@
inherit_from:
- .rubocop.yml
# This rubocop config file is only used for specs
# Here we allow specs to be 300 lines long
Metrics/ModuleLength:
Max: 300

View File

@@ -556,41 +556,6 @@ Style/ClassAndModuleChildren:
- 'app/models/tag_rule/filter_order_cycles.rb'
- 'app/models/tag_rule/filter_payment_methods.rb'
- 'app/models/tag_rule/filter_shipping_methods.rb'
- 'app/serializers/api/address_serializer.rb'
- 'app/serializers/api/admin/basic_enterprise_fee_serializer.rb'
- 'app/serializers/api/admin/basic_enterprise_serializer.rb'
- 'app/serializers/api/admin/basic_order_cycle_serializer.rb'
- 'app/serializers/api/admin/calculator/flat_percent_item_total_serializer.rb'
- 'app/serializers/api/admin/calculator_serializer.rb'
- 'app/serializers/api/admin/column_preference_serializer.rb'
- 'app/serializers/api/admin/customer_serializer.rb'
- 'app/serializers/api/admin/enterprise_fee_serializer.rb'
- 'app/serializers/api/admin/enterprise_relationship_permission_serializer.rb'
- 'app/serializers/api/admin/enterprise_relationship_serializer.rb'
- 'app/serializers/api/admin/enterprise_role_serializer.rb'
- 'app/serializers/api/admin/enterprise_serializer.rb'
- 'app/serializers/api/admin/exchange_serializer.rb'
- 'app/serializers/api/admin/for_order_cycle/enterprise_serializer.rb'
- 'app/serializers/api/admin/for_order_cycle/supplied_product_serializer.rb'
- 'app/serializers/api/admin/id_name_serializer.rb'
- 'app/serializers/api/admin/id_serializer.rb'
- 'app/serializers/api/admin/index_enterprise_serializer.rb'
- 'app/serializers/api/admin/inventory_item_serializer.rb'
- 'app/serializers/api/admin/line_item_serializer.rb'
- 'app/serializers/api/admin/order_cycle_serializer.rb'
- 'app/serializers/api/admin/order_serializer.rb'
- 'app/serializers/api/admin/payment_method/base_serializer.rb'
- 'app/serializers/api/admin/payment_method/stripe_serializer.rb'
- 'app/serializers/api/admin/product_serializer.rb'
- 'app/serializers/api/admin/shipping_method_serializer.rb'
- 'app/serializers/api/admin/tag_rule_serializer.rb'
- 'app/serializers/api/admin/tax_category_serializer.rb'
- 'app/serializers/api/admin/taxon_serializer.rb'
- 'app/serializers/api/admin/units_product_serializer.rb'
- 'app/serializers/api/admin/units_variant_serializer.rb'
- 'app/serializers/api/admin/user_serializer.rb'
- 'app/serializers/api/admin/variant_override_serializer.rb'
- 'app/serializers/api/admin/variant_serializer.rb'
- 'app/serializers/api/country_serializer.rb'
- 'app/serializers/api/currency_config_serializer.rb'
- 'app/serializers/api/current_order_serializer.rb'
@@ -845,48 +810,6 @@ Style/FrozenStringLiteralComment:
- 'app/models/variant_override_set.rb'
- 'app/serializers/api/address_serializer.rb'
- 'app/serializers/api/adjustment_serializer.rb'
- 'app/serializers/api/admin/basic_enterprise_fee_serializer.rb'
- 'app/serializers/api/admin/basic_enterprise_serializer.rb'
- 'app/serializers/api/admin/basic_order_cycle_serializer.rb'
- 'app/serializers/api/admin/calculator/flat_percent_item_total_serializer.rb'
- 'app/serializers/api/admin/calculator_serializer.rb'
- 'app/serializers/api/admin/column_preference_serializer.rb'
- 'app/serializers/api/admin/customer_serializer.rb'
- 'app/serializers/api/admin/enterprise_fee_serializer.rb'
- 'app/serializers/api/admin/enterprise_relationship_permission_serializer.rb'
- 'app/serializers/api/admin/enterprise_relationship_serializer.rb'
- 'app/serializers/api/admin/enterprise_role_serializer.rb'
- 'app/serializers/api/admin/enterprise_serializer.rb'
- 'app/serializers/api/admin/exchange_serializer.rb'
- 'app/serializers/api/admin/for_order_cycle/enterprise_serializer.rb'
- 'app/serializers/api/admin/for_order_cycle/supplied_product_serializer.rb'
- 'app/serializers/api/admin/id_email_serializer.rb'
- 'app/serializers/api/admin/id_name_serializer.rb'
- 'app/serializers/api/admin/id_serializer.rb'
- 'app/serializers/api/admin/index_enterprise_serializer.rb'
- 'app/serializers/api/admin/index_order_cycle_serializer.rb'
- 'app/serializers/api/admin/inventory_item_serializer.rb'
- 'app/serializers/api/admin/line_item_serializer.rb'
- 'app/serializers/api/admin/order_cycle_serializer.rb'
- 'app/serializers/api/admin/order_serializer.rb'
- 'app/serializers/api/admin/payment_method/base_serializer.rb'
- 'app/serializers/api/admin/payment_method/stripe_serializer.rb'
- 'app/serializers/api/admin/payment_method_serializer.rb'
- 'app/serializers/api/admin/product_serializer.rb'
- 'app/serializers/api/admin/proxy_order_serializer.rb'
- 'app/serializers/api/admin/schedule_serializer.rb'
- 'app/serializers/api/admin/shipping_method_serializer.rb'
- 'app/serializers/api/admin/subscription_customer_serializer.rb'
- 'app/serializers/api/admin/subscription_line_item_serializer.rb'
- 'app/serializers/api/admin/subscription_serializer.rb'
- 'app/serializers/api/admin/tag_rule_serializer.rb'
- 'app/serializers/api/admin/tax_category_serializer.rb'
- 'app/serializers/api/admin/taxon_serializer.rb'
- 'app/serializers/api/admin/units_product_serializer.rb'
- 'app/serializers/api/admin/units_variant_serializer.rb'
- 'app/serializers/api/admin/user_serializer.rb'
- 'app/serializers/api/admin/variant_override_serializer.rb'
- 'app/serializers/api/admin/variant_serializer.rb'
- 'app/serializers/api/cached_enterprise_serializer.rb'
- 'app/serializers/api/country_serializer.rb'
- 'app/serializers/api/credit_card_serializer.rb'

View File

@@ -149,7 +149,7 @@ GEM
nokogiri (>= 1.4.4)
uuidtools (~> 2.1)
bcrypt (3.1.13)
bugsnag (6.17.0)
bugsnag (6.18.0)
concurrent-ruby (~> 1.0)
builder (3.1.4)
byebug (11.0.1)

View File

@@ -104,7 +104,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
$scope.$watch 'sortOptions', (sort) ->
return unless sort && sort.predicate != ""
$scope.sorting = sort.getSortingExpr()
$scope.q.sorting = sort.getSortingExpr()
$scope.fetchProducts()
, true

View File

@@ -47,3 +47,8 @@ angular.module("admin.customers").controller "customersCtrl", ($scope, $q, $filt
tag.text.toLowerCase().indexOf(query.toLowerCase()) != -1
defer.resolve filtered
defer.promise
$scope.displayBalanceStatus = (customer) ->
return unless customer.balance_status
t('admin.customers.index.' + customer.balance_status)

View File

@@ -0,0 +1,30 @@
angular.module("admin.enterprises").directive 'termsAndConditionsWarning', ($compile, $templateCache, DialogDefaults, $timeout) ->
restrict: 'A'
scope: true
link: (scope, element, attr) ->
# This file input click handler will hold the browser file input dialog and show a warning modal
scope.hold_file_input_and_show_warning_modal = (event) ->
event.preventDefault()
scope.template = $compile($templateCache.get('admin/modals/terms_and_conditions_warning.html'))(scope)
if scope.template.dialog
scope.template.dialog(DialogDefaults)
scope.template.dialog('open')
scope.$apply()
element.bind 'click', scope.hold_file_input_and_show_warning_modal
# When the user presses continue in the warning modal, we open the browser file input dialog
scope.continue = ->
scope.template.dialog('close')
# unbind warning modal handler and click file input again to open the browser file input dialog
element.unbind('click').trigger('click')
# afterwards, bind warning modal handler again so that the warning is shown the next time
$timeout ->
element.bind 'click', scope.hold_file_input_and_show_warning_modal
return
scope.close = ->
scope.template.dialog('close')
return

View File

@@ -1,4 +1,4 @@
angular.module("admin.products").factory "VariantUnitManager", ->
angular.module("admin.products").factory "VariantUnitManager", (availableUnits) ->
class VariantUnitManager
@units:
'weight':
@@ -29,12 +29,13 @@ angular.module("admin.products").factory "VariantUnitManager", ->
system: 'metric'
@variantUnitOptions: ->
available = availableUnits.split(",")
options = for unit_type, _ of @units
for scale in @unitScales(unit_type)
for scale in @unitScales(unit_type, available)
name = @getUnitName(scale, unit_type)
["#{I18n.t(unit_type)} (#{name})", "#{unit_type}_#{scale}"]
options.push [[I18n.t('items'), 'items']]
[].concat options...
options = [].concat options...
@getScale: (value, unitType) ->
scaledValue = null
@@ -53,8 +54,13 @@ angular.module("admin.products").factory "VariantUnitManager", ->
else
''
@unitScales: (unitType) ->
(parseFloat(scale) for scale in Object.keys(@units[unitType])).sort (a, b) ->
@unitScales: (unitType, availableUnits = null) ->
scales = Object.keys(@units[unitType])
if availableUnits
scales = scales.filter (scale) ->
availableUnits.includes(VariantUnitManager.getUnitName(scale, unitType))
(parseFloat(scale) for scale in scales).sort (a, b) ->
a - b
@compatibleUnitScales: (scale, unitType) ->

View File

@@ -95,6 +95,10 @@ Darkswarm.factory 'Checkout', ($injector, CurrentOrder, ShippingMethods, StripeE
last_name: @order.bill_address.lastname
save_requested_by_customer: @secrets.save_requested_by_customer
}
if @terms_and_conditions_accepted()
munged_order["terms_and_conditions_accepted"] = true
munged_order
shippingMethod: ->
@@ -114,3 +118,7 @@ Darkswarm.factory 'Checkout', ($injector, CurrentOrder, ShippingMethods, StripeE
cartTotal: ->
@order.display_total + @shippingPrice() + @paymentPrice()
terms_and_conditions_accepted: ->
terms_and_conditions_checkbox = angular.element("#accept_terms")[0]
terms_and_conditions_checkbox? && terms_and_conditions_checkbox.checked

View File

@@ -0,0 +1,13 @@
%div
.margin-bottom-30.text-center
.text-big
{{ 'js.admin.modals.terms_and_conditions_info.title' | t }}
.margin-bottom-30
%p
{{ 'js.admin.modals.terms_and_conditions_info.message_1' | t }}
.margin-bottom-30
%p
{{ 'js.admin.modals.terms_and_conditions_info.message_2' | t }}
.text-center
%input.button.red.icon-plus{ type: 'button', value: t('js.admin.modals.got_it'), ng: { click: 'close()' } }

View File

@@ -0,0 +1,14 @@
%div
.margin-bottom-30.text-center
.text-big
{{ 'js.admin.modals.terms_and_conditions_warning.title' | t }}
.margin-bottom-30
%p
{{ 'js.admin.modals.terms_and_conditions_warning.message_1' | t }}
.margin-bottom-30
%p
{{ 'js.admin.modals.terms_and_conditions_warning.message_2' | t }}
.text-center
%input.button.red{ type: 'button', value: t('js.admin.modals.close'), ng: { click: 'close()' } }
%input.button.red{ type: 'button', value: t('js.admin.modals.continue'), ng: { click: 'continue()' } }

View File

@@ -154,3 +154,7 @@ input.text-big {
.pad-top {
padding-top: 1em;
}
.white-space-nowrap {
white-space: nowrap;
}

View File

@@ -181,10 +181,10 @@ module Admin
enterprise_payment_methods = @enterprise.payment_methods.to_a
enterprise_shipping_methods = @enterprise.shipping_methods.to_a
# rubocop:disable Style/TernaryParentheses
@payment_methods = Spree::PaymentMethod.managed_by(spree_current_user).sort_by! do |pm|
@payment_methods = Spree::PaymentMethod.managed_by(spree_current_user).to_a.sort_by! do |pm|
[(enterprise_payment_methods.include? pm) ? 0 : 1, pm.name]
end
@shipping_methods = Spree::ShippingMethod.managed_by(spree_current_user).sort_by! do |sm|
@shipping_methods = Spree::ShippingMethod.managed_by(spree_current_user).to_a.sort_by! do |sm|
[(enterprise_shipping_methods.include? sm) ? 0 : 1, sm.name]
end
# rubocop:enable Style/TernaryParentheses

View File

@@ -10,6 +10,7 @@ module Spree
end
def update
merge_available_units_params unless params[:available_units].nil?
params.each do |name, value|
next unless Spree::Config.has_preference? name
@@ -19,6 +20,13 @@ module Spree
redirect_to spree.edit_admin_general_settings_path
end
private
def merge_available_units_params
params[:available_units] =
params[:available_units].select { |_unit, checked| checked == "1" }.keys.join(",")
end
end
end
end

View File

@@ -127,7 +127,7 @@ module Spree
def load_hubs
# rubocop:disable Style/TernaryParentheses
@hubs = Enterprise.managed_by(spree_current_user).is_distributor.sort_by! do |d|
@hubs = Enterprise.managed_by(spree_current_user).is_distributor.to_a.sort_by! do |d|
[(@payment_method.has_distributor? d) ? 0 : 1, d.name]
end
# rubocop:enable Style/TernaryParentheses

View File

@@ -50,7 +50,7 @@ module Spree
def load_hubs
# rubocop:disable Style/TernaryParentheses
@hubs = Enterprise.managed_by(spree_current_user).is_distributor.sort_by! do |d|
@hubs = Enterprise.managed_by(spree_current_user).is_distributor.to_a.sort_by! do |d|
[(@shipping_method.has_distributor? d) ? 0 : 1, d.name]
end
# rubocop:enable Style/TernaryParentheses

View File

@@ -184,6 +184,12 @@ module Admin
json: "'#{@spree_api_key}'" }
end
def admin_inject_available_units
admin_inject_json "admin.products",
"availableUnits",
Spree::Config.available_units
end
def admin_inject_json(ng_module, name, data)
json = data.to_json
render partial: "admin/json/injection_ams",

View File

@@ -7,6 +7,8 @@ module CheckoutHelper
adjustments = order.adjustments.eligible
exclude = opts[:exclude] || {}
adjustments = adjustments.to_a
# Remove empty tax adjustments and (optionally) shipping fees
adjustments.reject! { |a| a.originator_type == 'Spree::TaxRate' && a.amount == 0 }
adjustments.reject! { |a| a.originator_type == 'Spree::ShippingMethod' } if exclude.include? :shipping

View File

@@ -4,7 +4,7 @@ module InjectionHelper
include SerializerHelper
def inject_enterprises(enterprises = nil)
inject_json_ams(
inject_json_array(
"enterprises",
enterprises || default_enterprise_query,
Api::EnterpriseSerializer,
@@ -15,7 +15,7 @@ module InjectionHelper
def inject_groups
select_only = required_attributes EnterpriseGroup, Api::GroupListSerializer
inject_json_ams(
inject_json_array(
"groups",
EnterpriseGroup.on_front_page.by_position.select(select_only).
includes(enterprises: [:shipping_methods, { address: [:state, :country] }],
@@ -26,7 +26,7 @@ module InjectionHelper
end
def inject_enterprise_shopfront(enterprise)
inject_json_ams(
inject_json(
"shopfront",
enterprise,
Api::EnterpriseShopfrontSerializer
@@ -36,7 +36,7 @@ module InjectionHelper
def inject_enterprise_shopfront_list
select_only = required_attributes Enterprise, Api::EnterpriseShopfrontListSerializer
inject_json_ams(
inject_json_array(
"enterprises",
Enterprise.activated.visible.select(select_only).includes(address: [:state, :country]).all,
Api::EnterpriseShopfrontListSerializer
@@ -50,13 +50,13 @@ module InjectionHelper
includes(:properties, address: [:state, :country], supplied_products: :properties).
all
inject_json_ams "enterprises",
enterprises_and_relatives,
Api::EnterpriseSerializer, enterprise_injection_data
inject_json_array "enterprises",
enterprises_and_relatives,
Api::EnterpriseSerializer, enterprise_injection_data
end
def inject_group_enterprises
inject_json_ams(
inject_json_array(
"enterprises",
@group.enterprises.activated.all,
Api::EnterpriseSerializer,
@@ -65,11 +65,18 @@ module InjectionHelper
end
def inject_current_hub
inject_json_ams "currentHub", current_distributor, Api::EnterpriseSerializer, enterprise_injection_data
inject_json "currentHub",
current_distributor,
Api::EnterpriseSerializer,
enterprise_injection_data
end
def inject_current_order
inject_json_ams "currentOrder", current_order, Api::CurrentOrderSerializer, current_distributor: current_distributor, current_order_cycle: current_order_cycle
inject_json "currentOrder",
current_order,
Api::CurrentOrderSerializer,
current_distributor: current_distributor,
current_order_cycle: current_order_cycle
end
def inject_current_order_cycle
@@ -79,73 +86,78 @@ module InjectionHelper
end
def inject_available_shipping_methods
inject_json_ams "shippingMethods", available_shipping_methods,
Api::ShippingMethodSerializer, current_order: current_order
inject_json_array "shippingMethods", available_shipping_methods,
Api::ShippingMethodSerializer, current_order: current_order
end
def inject_available_payment_methods
inject_json_ams "paymentMethods", available_payment_methods,
Api::PaymentMethodSerializer, current_order: current_order
inject_json_array "paymentMethods", available_payment_methods,
Api::PaymentMethodSerializer, current_order: current_order
end
def inject_taxons
inject_json_ams "taxons", Spree::Taxon.all.to_a, Api::TaxonSerializer
inject_json_array "taxons", Spree::Taxon.all.to_a, Api::TaxonSerializer
end
def inject_properties
inject_json_ams "properties", Spree::Property.all.to_a, Api::PropertySerializer
inject_json_array "properties", Spree::Property.all.to_a, Api::PropertySerializer
end
def inject_currency_config
inject_json_ams "currencyConfig", {}, Api::CurrencyConfigSerializer
inject_json "currencyConfig", {}, Api::CurrencyConfigSerializer
end
def inject_open_street_map_config
inject_json_ams "openStreetMapConfig", {}, Api::OpenStreetMapConfigSerializer
inject_json "openStreetMapConfig", {}, Api::OpenStreetMapConfigSerializer
end
def inject_spree_api_key
render partial: "json/injection_ams", locals: { name: 'spreeApiKey', json: "'#{@spree_api_key}'" }
render partial: "json/injection_ams",
locals: { name: 'spreeApiKey', json: "'#{@spree_api_key}'" }
end
def inject_available_countries
inject_json_ams "availableCountries", available_countries, Api::CountrySerializer
inject_json_array "availableCountries", available_countries, Api::CountrySerializer
end
def inject_enterprise_attributes
render partial: "json/injection_ams", locals: { name: 'enterpriseAttributes', json: @enterprise_attributes.to_json.to_s }
render partial: "json/injection_ams",
locals: { name: 'enterpriseAttributes', json: @enterprise_attributes.to_json.to_s }
end
def inject_orders
inject_json_ams "orders", @orders.all, Api::OrderSerializer
inject_json_array "orders", @orders.all, Api::OrderSerializer
end
def inject_shops
customers = spree_current_user.customers
shops = Enterprise.where(id: @orders.pluck(:distributor_id).uniq | customers.pluck(:enterprise_id))
inject_json_ams "shops", shops.all, Api::ShopForOrdersSerializer
shops = Enterprise.where(id: @orders.pluck(:distributor_id).uniq |
customers.pluck(:enterprise_id))
inject_json_array "shops", shops.all, Api::ShopForOrdersSerializer
end
def inject_saved_credit_cards
data = spree_current_user ? spree_current_user.credit_cards.with_payment_profile.all : []
inject_json_ams "savedCreditCards", data, Api::CreditCardSerializer
inject_json_array "savedCreditCards", data, Api::CreditCardSerializer
end
def inject_current_user
inject_json_ams "user", spree_current_user, Api::UserSerializer
inject_json "user", spree_current_user, Api::UserSerializer
end
def inject_rails_flash
inject_json_ams "railsFlash", OpenStruct.new(flash.to_hash), Api::RailsFlashSerializer
inject_json "railsFlash", OpenStruct.new(flash.to_hash), Api::RailsFlashSerializer
end
def inject_json_ams(name, data, serializer, opts = {})
if data.is_a?(Array)
opts = { each_serializer: serializer }.merge(opts)
serializer = ActiveModel::ArraySerializer
end
def inject_json_array(name, data, serializer, opts = {})
opts = { each_serializer: serializer }.merge(opts)
serializer = ActiveModel::ArraySerializer
inject_json(name, data, serializer, opts)
end
def inject_json(name, data, serializer, opts = {})
serializer_instance = serializer.new(data, opts)
json = serializer_instance.to_json
render partial: "json/injection_ams", locals: { name: name, json: json }

View File

@@ -8,6 +8,10 @@ module Spree
end
options_from_collection_for_select(currencies, :first, :last, Spree::Config[:currency])
end
def all_units
["g", "oz", "lb", "kg", "T", "mL", "L", "kL"]
end
end
end
end

View File

@@ -0,0 +1,16 @@
# frozen_string_literal: true
module TermsAndConditionsHelper
def terms_and_conditions_activated?
current_order.distributor.terms_and_conditions.file?
end
def terms_and_conditions_already_accepted?
customer_terms_and_conditions_accepted_at = spree_current_user&.
customer_of(current_order.distributor)&.terms_and_conditions_accepted_at
customer_terms_and_conditions_accepted_at.present? &&
(customer_terms_and_conditions_accepted_at >
current_order.distributor.terms_and_conditions_updated_at)
end
end

View File

@@ -60,11 +60,11 @@ class ProducerMailer < Spree::BaseMailer
end
def total_from_line_items(line_items)
Spree::Money.new line_items.sum(&:total)
Spree::Money.new line_items.to_a.sum(&:total)
end
def tax_total_from_line_items(line_items)
Spree::Money.new line_items.sum(&:included_tax)
Spree::Money.new line_items.to_a.sum(&:included_tax)
end
# This hack makes ActiveRecord skip the default_scope (deleted_at IS NULL)

View File

@@ -8,10 +8,12 @@ module Spree
def reset_password_instructions(user, token, _opts = {})
@edit_password_reset_url = spree.
edit_spree_user_password_url(reset_password_token: token)
subject = "#{Spree::Config[:site_name]} " \
"#{I18n.t('spree.user_mailer.reset_password_instructions.subject')}"
mail(to: user.email, from: from_address,
subject: Spree::Config[:site_name] + ' ' +
I18n.t(:subject, scope: [:devise, :mailer, :reset_password_instructions]))
I18n.with_locale valid_locale(user) do
mail(to: user.email, from: from_address, subject: subject)
end
end
# This is a OFN specific email, not from Devise::Mailer

View File

@@ -49,7 +49,7 @@ module Calculator
# Finds relevant fees for each line_item,
# calculates the tax on them, and returns the total tax
def per_item_fees_total(order, calculator)
order.line_items.sum do |line_item|
order.line_items.to_a.sum do |line_item|
calculator.per_item_enterprise_fee_applicators_for(line_item.variant)
.select { |applicator| applicable_rate?(applicator, line_item) }
.sum { |applicator| applicator.enterprise_fee.compute_amount(line_item) }

View File

@@ -18,7 +18,7 @@ class Calculator::FlatPercentPerItem < Spree::Calculator
end
def compute(object)
line_items_for(object).sum do |li|
line_items_for(object).to_a.sum do |li|
unless li.price.present? && li.quantity.present?
raise ArgumentError, "object must respond to #price and #quantity"
end

View File

@@ -32,7 +32,7 @@ module Calculator
private
def total_weight(line_items)
line_items.sum do |line_item|
line_items.to_a.sum do |line_item|
line_item_weight(line_item)
end
end

View File

@@ -470,6 +470,8 @@ class Enterprise < ActiveRecord::Base
end
def initialize_permalink
return unless name
self.permalink = Enterprise.find_available_permalink(name)
end

View File

@@ -50,6 +50,7 @@ class ModelSet
# Remove all elements to be deleted from collection and return them
# Allows us to render @model_set.collection without deleted elements
deleted = []
@collection = collection.to_a
collection.delete_if { |e| deleted << e if @delete_if.andand.call(e.attributes) }
deleted
end

View File

@@ -144,5 +144,8 @@ module Spree
# Enable cache
preference :enable_products_cache?, :boolean,
default: (Rails.env.production? || Rails.env.staging?)
# Available units
preference :available_units, :string, default: "g,kg,T,mL,L,kL"
end
end

View File

@@ -192,7 +192,7 @@ module Spree
line_item_adjustments = OrderAdjustmentsFetcher.new(order).line_item_adjustments(self)
(price + line_item_adjustments.sum(&:amount) / quantity).round(2)
(price + line_item_adjustments.to_a.sum(&:amount) / quantity).round(2)
end
def single_display_amount_with_adjustments

View File

@@ -30,7 +30,7 @@ module Spree
def fetch_stock_items
# Don't re-fetch associated stock items from the DB if we've already eager-loaded them
return @variant.stock_items.to_a if @variant.stock_items.loaded?
return @variant.stock_items if @variant.stock_items.loaded?
Spree::StockItem.joins(:stock_location).
where(:variant_id => @variant, Spree::StockLocation.table_name => { active: true })

View File

@@ -1,3 +1,9 @@
class Api::Admin::BasicEnterpriseFeeSerializer < ActiveModel::Serializer
attributes :id, :enterprise_id
# frozen_string_literal: true
module Api
module Admin
class BasicEnterpriseFeeSerializer < ActiveModel::Serializer
attributes :id, :enterprise_id
end
end
end

View File

@@ -1,12 +1,18 @@
class Api::Admin::BasicEnterpriseSerializer < ActiveModel::Serializer
attributes :name, :id, :is_primary_producer, :is_distributor, :sells, :category,
:payment_method_ids, :shipping_method_ids, :producer_profile_only, :permalink
# frozen_string_literal: true
def payment_method_ids
object.payment_methods.map(&:id)
end
module Api
module Admin
class BasicEnterpriseSerializer < ActiveModel::Serializer
attributes :name, :id, :is_primary_producer, :is_distributor, :sells, :category,
:payment_method_ids, :shipping_method_ids, :producer_profile_only, :permalink
def shipping_method_ids
object.shipping_methods.map(&:id)
def payment_method_ids
object.payment_methods.map(&:id)
end
def shipping_method_ids
object.shipping_methods.map(&:id)
end
end
end
end

View File

@@ -1,20 +1,26 @@
class Api::Admin::BasicOrderCycleSerializer < ActiveModel::Serializer
include OrderCyclesHelper
# frozen_string_literal: true
attributes :id, :name, :status, :orders_open_at, :orders_close_at
module Api
module Admin
class BasicOrderCycleSerializer < ActiveModel::Serializer
include OrderCyclesHelper
has_many :suppliers, serializer: Api::Admin::IdNameSerializer
has_many :distributors, serializer: Api::Admin::IdNameSerializer
attributes :id, :name, :status, :orders_open_at, :orders_close_at
def status
order_cycle_status_class object
end
has_many :suppliers, serializer: Api::Admin::IdNameSerializer
has_many :distributors, serializer: Api::Admin::IdNameSerializer
def orders_open_at
object.orders_open_at.andand.strftime("%F %T %z")
end
def status
order_cycle_status_class object
end
def orders_close_at
object.orders_close_at.andand.strftime("%F %T %z")
def orders_open_at
object.orders_open_at.andand.strftime("%F %T %z")
end
def orders_close_at
object.orders_close_at.andand.strftime("%F %T %z")
end
end
end
end

View File

@@ -1,7 +1,15 @@
class Api::Admin::Calculator::FlatPercentItemTotalSerializer < ActiveModel::Serializer
attributes :id, :preferred_flat_percent
# frozen_string_literal: true
def preferred_flat_percent
object.preferred_flat_percent.to_i
module Api
module Admin
module Calculator
class FlatPercentItemTotalSerializer < ActiveModel::Serializer
attributes :id, :preferred_flat_percent
def preferred_flat_percent
object.preferred_flat_percent.to_i
end
end
end
end
end

View File

@@ -1,7 +1,13 @@
class Api::Admin::CalculatorSerializer < ActiveModel::Serializer
attributes :name, :description
# frozen_string_literal: true
delegate :name, to: :object
module Api
module Admin
class CalculatorSerializer < ActiveModel::Serializer
attributes :name, :description
delegate :description, to: :object
delegate :name, to: :object
delegate :description, to: :object
end
end
end

View File

@@ -1,3 +1,9 @@
class Api::Admin::ColumnPreferenceSerializer < ActiveModel::Serializer
attributes :id, :user_id, :action_name, :column_name, :name, :visible
# frozen_string_literal: true
module Api
module Admin
class ColumnPreferenceSerializer < ActiveModel::Serializer
attributes :id, :user_id, :action_name, :column_name, :name, :visible
end
end
end

View File

@@ -1,36 +1,61 @@
class Api::Admin::CustomerSerializer < ActiveModel::Serializer
attributes :id, :email, :enterprise_id, :user_id, :code, :tags, :tag_list, :name,
:allow_charges, :default_card_present?
# frozen_string_literal: true
has_one :ship_address, serializer: Api::AddressSerializer
has_one :bill_address, serializer: Api::AddressSerializer
module Api
module Admin
class CustomerSerializer < ActiveModel::Serializer
attributes :id, :email, :enterprise_id, :user_id, :code, :tags, :tag_list, :name,
:allow_charges, :default_card_present?, :balance, :balance_status
def tag_list
customer_tag_list.join(",")
end
has_one :ship_address, serializer: Api::AddressSerializer
has_one :bill_address, serializer: Api::AddressSerializer
def name
object.name.presence || object.bill_address.andand.full_name
end
def name
object.name.presence || object.bill_address.andand.full_name
end
def tags
customer_tag_list.map do |tag|
tag_rule_map = options[:tag_rule_mapping].andand[tag]
tag_rule_map || { text: tag, rules: nil }
def tag_list
customer_tag_list.join(",")
end
def balance
Spree::Money.new(balance_value, currency: Spree::Config[:currency]).to_s
end
def balance_status
if balance_value.positive?
"credit_owed"
elsif balance_value.negative?
"balance_due"
else
""
end
end
def tags
customer_tag_list.map do |tag|
tag_rule_map = options[:tag_rule_mapping].andand[tag]
tag_rule_map || { text: tag, rules: nil }
end
end
def default_card_present?
return unless object.user
object.user.default_card.present?
end
private
def customer_tag_list
return object.tag_list unless options[:customer_tags]
options[:customer_tags].andand[object.id] || []
end
def balance_value
@balance_value ||=
OpenFoodNetwork::UserBalanceCalculator.new(object.email, object.enterprise).balance
end
end
end
def default_card_present?
return unless object.user
object.user.default_card.present?
end
private
def customer_tag_list
return object.tag_list unless options[:customer_tags]
options[:customer_tags].andand[object.id] || []
end
end

View File

@@ -1,26 +1,32 @@
class Api::Admin::EnterpriseFeeSerializer < ActiveModel::Serializer
attributes :id, :enterprise_id, :fee_type, :name, :tax_category_id, :inherits_tax_category,
:calculator_type, :enterprise_name, :calculator_description, :calculator_settings
# frozen_string_literal: true
def enterprise_name
object.enterprise.andand.name
end
module Api
module Admin
class EnterpriseFeeSerializer < ActiveModel::Serializer
attributes :id, :enterprise_id, :fee_type, :name, :tax_category_id, :inherits_tax_category,
:calculator_type, :enterprise_name, :calculator_description, :calculator_settings
def calculator_description
object.calculator.andand.description
end
def enterprise_name
object.enterprise.andand.name
end
def calculator_settings
return nil unless options[:include_calculators]
def calculator_description
object.calculator.andand.description
end
result = nil
def calculator_settings
return nil unless options[:include_calculators]
options[:controller].__send__(:with_format, :html) do
result = options[:controller].
render_to_string(partial: 'admin/enterprise_fees/calculator_settings',
locals: { enterprise_fee: object })
result = nil
options[:controller].__send__(:with_format, :html) do
result = options[:controller].
render_to_string(partial: 'admin/enterprise_fees/calculator_settings',
locals: { enterprise_fee: object })
end
result.gsub('[0]', '[{{ $index }}]').gsub('_0_', '_{{ $index }}_')
end
end
result.gsub('[0]', '[{{ $index }}]').gsub('_0_', '_{{ $index }}_')
end
end

View File

@@ -1,3 +1,9 @@
class Api::Admin::EnterpriseRelationshipPermissionSerializer < ActiveModel::Serializer
attributes :id, :name
# frozen_string_literal: true
module Api
module Admin
class EnterpriseRelationshipPermissionSerializer < ActiveModel::Serializer
attributes :id, :name
end
end
end

View File

@@ -1,13 +1,19 @@
class Api::Admin::EnterpriseRelationshipSerializer < ActiveModel::Serializer
attributes :id, :parent_id, :parent_name, :child_id, :child_name
# frozen_string_literal: true
has_many :permissions
module Api
module Admin
class EnterpriseRelationshipSerializer < ActiveModel::Serializer
attributes :id, :parent_id, :parent_name, :child_id, :child_name
def parent_name
object.parent.name
end
has_many :permissions
def child_name
object.child.name
def parent_name
object.parent.name
end
def child_name
object.child.name
end
end
end
end

View File

@@ -1,11 +1,17 @@
class Api::Admin::EnterpriseRoleSerializer < ActiveModel::Serializer
attributes :id, :user_id, :enterprise_id, :user_email, :enterprise_name
# frozen_string_literal: true
def user_email
object.user.email
end
module Api
module Admin
class EnterpriseRoleSerializer < ActiveModel::Serializer
attributes :id, :user_id, :enterprise_id, :user_email, :enterprise_name
def enterprise_name
object.enterprise.name
def user_email
object.user.email
end
def enterprise_name
object.enterprise.name
end
end
end
end

View File

@@ -1,77 +1,92 @@
class Api::Admin::EnterpriseSerializer < ActiveModel::Serializer
attributes :name, :id, :is_primary_producer, :is_distributor, :sells, :category, :permalink,
:payment_method_ids, :shipping_method_ids, :producer_profile_only, :long_description,
:preferred_shopfront_message, :preferred_shopfront_closed_message,
:preferred_shopfront_taxon_order, :preferred_shopfront_order_cycle_order,
:preferred_product_selection_from_inventory_only,
:preferred_show_customer_names_to_suppliers, :owner, :contact, :users, :tag_groups,
:default_tag_group, :require_login, :allow_guest_orders, :allow_order_changes,
:logo, :promo_image, :terms_and_conditions, :terms_and_conditions_file_name
# frozen_string_literal: true
has_one :owner, serializer: Api::Admin::UserSerializer
has_many :users, serializer: Api::Admin::UserSerializer
has_one :address, serializer: Api::AddressSerializer
module Api
module Admin
class EnterpriseSerializer < ActiveModel::Serializer
attributes :name, :id, :is_primary_producer, :is_distributor, :sells, :category, :permalink,
:payment_method_ids, :shipping_method_ids, :producer_profile_only,
:long_description, :preferred_product_selection_from_inventory_only,
:preferred_shopfront_message, :preferred_shopfront_closed_message,
:preferred_shopfront_taxon_order, :preferred_shopfront_order_cycle_order,
:preferred_show_customer_names_to_suppliers, :owner, :contact, :users, :tag_groups,
:default_tag_group, :require_login, :allow_guest_orders, :allow_order_changes,
:logo, :promo_image, :terms_and_conditions,
:terms_and_conditions_file_name, :terms_and_conditions_updated_at
def logo
attachment_urls(object.logo, [:thumb, :small, :medium])
end
has_one :owner, serializer: Api::Admin::UserSerializer
has_many :users, serializer: Api::Admin::UserSerializer
has_one :address, serializer: Api::AddressSerializer
def promo_image
attachment_urls(object.promo_image, [:thumb, :medium, :large])
end
def terms_and_conditions
return unless @object.terms_and_conditions.file?
@object.terms_and_conditions.url
end
def tag_groups
object.tag_rules.prioritised.reject(&:is_default).each_with_object([]) do |tag_rule, tag_groups|
tag_group = find_match(tag_groups, tag_rule.preferred_customer_tags.
split(",").
map{ |t| { text: t } })
if tag_group[:rules].blank?
tag_groups << tag_group
tag_group[:position] = tag_groups.count
def logo
attachment_urls(object.logo, [:thumb, :small, :medium])
end
tag_group[:rules] << Api::Admin::TagRuleSerializer.new(tag_rule).serializable_hash
end
end
def default_tag_group
default_rules = object.tag_rules.select(&:is_default)
serialized_rules =
ActiveModel::ArraySerializer.new(default_rules,
each_serializer: Api::Admin::TagRuleSerializer)
{ tags: [], rules: serialized_rules }
end
def promo_image
attachment_urls(object.promo_image, [:thumb, :medium, :large])
end
def find_match(tag_groups, tags)
tag_groups.each do |tag_group|
return tag_group if tag_group[:tags].length == tags.length &&
(tag_group[:tags] & tags) == tag_group[:tags]
end
{ tags: tags, rules: [] }
end
def terms_and_conditions
return unless object.terms_and_conditions.file?
private
object.terms_and_conditions.url
end
# Returns a hash of URLs for specified versions of an attachment.
#
# Example:
#
# attachment_urls(object.logo, [:thumb, :small, :medium])
# # {
# # thumb: LOGO_THUMB_URL,
# # small: LOGO_SMALL_URL,
# # medium: LOGO_MEDIUM_URL
# # }
def attachment_urls(attachment, versions)
return unless attachment.file?
def terms_and_conditions_updated_at
object.terms_and_conditions_updated_at&.to_s
end
versions.each_with_object({}) do |version, urls|
urls[version] = attachment.url(version)
def tag_groups
prioritized_tag_rules.each_with_object([]) do |tag_rule, tag_groups|
tag_group = find_match(tag_groups, tag_rule.preferred_customer_tags.
split(",").
map{ |t| { text: t } })
if tag_group[:rules].blank?
tag_groups << tag_group
tag_group[:position] = tag_groups.count
end
tag_group[:rules] << Api::Admin::TagRuleSerializer.new(tag_rule).serializable_hash
end
end
def default_tag_group
default_rules = object.tag_rules.select(&:is_default)
serialized_rules =
ActiveModel::ArraySerializer.new(default_rules,
each_serializer: Api::Admin::TagRuleSerializer)
{ tags: [], rules: serialized_rules }
end
def find_match(tag_groups, tags)
tag_groups.each do |tag_group|
return tag_group if tag_group[:tags].length == tags.length &&
(tag_group[:tags] & tags) == tag_group[:tags]
end
{ tags: tags, rules: [] }
end
private
def prioritized_tag_rules
object.tag_rules.prioritised.reject(&:is_default)
end
# Returns a hash of URLs for specified versions of an attachment.
#
# Example:
#
# attachment_urls(object.logo, [:thumb, :small, :medium])
# # {
# # thumb: LOGO_THUMB_URL,
# # small: LOGO_SMALL_URL,
# # medium: LOGO_MEDIUM_URL
# # }
def attachment_urls(attachment, versions)
return unless attachment.file?
versions.each_with_object({}) do |version, urls|
urls[version] = attachment.url(version)
end
end
end
end
end

View File

@@ -1,48 +1,54 @@
class Api::Admin::ExchangeSerializer < ActiveModel::Serializer
attributes :id, :sender_id, :receiver_id, :incoming, :variants,
:receival_instructions, :pickup_time, :pickup_instructions,
:tags, :tag_list
# frozen_string_literal: true
has_many :enterprise_fees, serializer: Api::Admin::BasicEnterpriseFeeSerializer
module Api
module Admin
class ExchangeSerializer < ActiveModel::Serializer
attributes :id, :sender_id, :receiver_id, :incoming, :variants,
:receival_instructions, :pickup_time, :pickup_instructions,
:tags, :tag_list
def variants
variants = object.incoming? ? visible_incoming_variants : visible_outgoing_variants
Hash[object.variants.merge(variants).map { |v| [v.id, true] }]
end
has_many :enterprise_fees, serializer: Api::Admin::BasicEnterpriseFeeSerializer
private
def variants
variants = object.incoming? ? visible_incoming_variants : visible_outgoing_variants
Hash[object.variants.merge(variants).map { |v| [v.id, true] }]
end
def visible_incoming_variants
if object.order_cycle.prefers_product_selection_from_coordinator_inventory_only?
permitted_incoming_variants.visible_for(object.order_cycle.coordinator)
else
permitted_incoming_variants
private
def visible_incoming_variants
if object.order_cycle.prefers_product_selection_from_coordinator_inventory_only?
permitted_incoming_variants.visible_for(object.order_cycle.coordinator)
else
permitted_incoming_variants
end
end
def visible_outgoing_variants
if object.receiver.prefers_product_selection_from_inventory_only?
permitted_outgoing_variants.visible_for(object.receiver)
else
permitted_outgoing_variants.not_hidden_for(object.receiver)
end
end
def permitted_incoming_variants
OpenFoodNetwork::OrderCyclePermissions.new(options[:current_user], object.order_cycle).
visible_variants_for_incoming_exchanges_from(object.sender)
end
def permitted_outgoing_variants
OpenFoodNetwork::OrderCyclePermissions.new(options[:current_user], object.order_cycle)
.visible_variants_for_outgoing_exchanges_to(object.receiver)
end
def tag_list
object.tag_list.join(",")
end
def tags
object.tag_list.map{ |t| { text: t } }
end
end
end
def visible_outgoing_variants
if object.receiver.prefers_product_selection_from_inventory_only?
permitted_outgoing_variants.visible_for(object.receiver)
else
permitted_outgoing_variants.not_hidden_for(object.receiver)
end
end
def permitted_incoming_variants
OpenFoodNetwork::OrderCyclePermissions.new(options[:current_user], object.order_cycle).
visible_variants_for_incoming_exchanges_from(object.sender)
end
def permitted_outgoing_variants
OpenFoodNetwork::OrderCyclePermissions.new(options[:current_user], object.order_cycle)
.visible_variants_for_outgoing_exchanges_to(object.receiver)
end
def tag_list
object.tag_list.join(",")
end
def tags
object.tag_list.map{ |t| { text: t } }
end
end

View File

@@ -1,46 +1,54 @@
# frozen_string_literal: true
require 'open_food_network/enterprise_issue_validator'
class Api::Admin::ForOrderCycle::EnterpriseSerializer < ActiveModel::Serializer
attributes :id, :name, :managed,
:issues_summary_supplier, :issues_summary_distributor,
:is_primary_producer, :is_distributor, :sells
module Api
module Admin
module ForOrderCycle
class EnterpriseSerializer < ActiveModel::Serializer
attributes :id, :name, :managed,
:issues_summary_supplier, :issues_summary_distributor,
:is_primary_producer, :is_distributor, :sells
def issues_summary_supplier
issues =
OpenFoodNetwork::EnterpriseIssueValidator.
new(object).
issues_summary(confirmation_only: true)
def issues_summary_supplier
issues =
OpenFoodNetwork::EnterpriseIssueValidator.
new(object).
issues_summary(confirmation_only: true)
if issues.nil? && products.empty?
issues = "no products in inventory"
if issues.nil? && products.empty?
issues = "no products in inventory"
end
issues
end
def issues_summary_distributor
OpenFoodNetwork::EnterpriseIssueValidator.new(object).issues_summary
end
def managed
Enterprise.managed_by(options[:spree_current_user]).include? object
end
private
def products_scope
products_relation = object.supplied_products
if order_cycle.prefers_product_selection_from_coordinator_inventory_only?
products_relation = products_relation.
visible_for(order_cycle.coordinator)
end
products_relation
end
def products
@products ||= products_scope
end
def order_cycle
options[:order_cycle]
end
end
end
issues
end
def issues_summary_distributor
OpenFoodNetwork::EnterpriseIssueValidator.new(object).issues_summary
end
def managed
Enterprise.managed_by(options[:spree_current_user]).include? object
end
private
def products_scope
products_relation = object.supplied_products
if order_cycle.prefers_product_selection_from_coordinator_inventory_only?
products_relation = products_relation.
visible_for(order_cycle.coordinator)
end
products_relation
end
def products
@products ||= products_scope
end
def order_cycle
options[:order_cycle]
end
end

View File

@@ -1,31 +1,39 @@
class Api::Admin::ForOrderCycle::SuppliedProductSerializer < ActiveModel::Serializer
attributes :name, :supplier_name, :image_url, :master_id, :variants
# frozen_string_literal: true
def supplier_name
object.supplier.andand.name
end
module Api
module Admin
module ForOrderCycle
class SuppliedProductSerializer < ActiveModel::Serializer
attributes :name, :supplier_name, :image_url, :master_id, :variants
def image_url
object.images.present? ? object.images.first.attachment.url(:mini) : nil
end
def supplier_name
object.supplier.andand.name
end
def master_id
object.master.id
end
def image_url
object.images.present? ? object.images.first.attachment.url(:mini) : nil
end
def variants
variants = if order_cycle.present? &&
order_cycle.prefers_product_selection_from_coordinator_inventory_only?
object.variants.visible_for(order_cycle.coordinator)
else
object.variants
end
variants.map { |variant| { id: variant.id, label: variant.full_name } }
end
def master_id
object.master.id
end
private
def variants
variants = if order_cycle.present? &&
order_cycle.prefers_product_selection_from_coordinator_inventory_only?
object.variants.visible_for(order_cycle.coordinator)
else
object.variants
end
variants.map { |variant| { id: variant.id, label: variant.full_name } }
end
def order_cycle
options[:order_cycle]
private
def order_cycle
options[:order_cycle]
end
end
end
end
end

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Api
module Admin
class IdEmailSerializer < ActiveModel::Serializer

View File

@@ -1,3 +1,9 @@
class Api::Admin::IdNameSerializer < ActiveModel::Serializer
attributes :id, :name
# frozen_string_literal: true
module Api
module Admin
class IdNameSerializer < ActiveModel::Serializer
attributes :id, :name
end
end
end

View File

@@ -1,3 +1,9 @@
class Api::Admin::IdSerializer < ActiveModel::Serializer
attributes :id
# frozen_string_literal: true
module Api
module Admin
class IdSerializer < ActiveModel::Serializer
attributes :id
end
end
end

View File

@@ -1,24 +1,30 @@
# frozen_string_literal: true
require 'open_food_network/enterprise_issue_validator'
class Api::Admin::IndexEnterpriseSerializer < ActiveModel::Serializer
attributes :name, :id, :permalink, :is_primary_producer, :sells, :producer_profile_only, :owned,
:edit_path, :issues, :warnings
module Api
module Admin
class IndexEnterpriseSerializer < ActiveModel::Serializer
attributes :name, :id, :permalink, :is_primary_producer, :sells,
:producer_profile_only, :owned, :edit_path, :issues, :warnings
def owned
return true if options[:spree_current_user].admin?
def owned
return true if options[:spree_current_user].admin?
object.owner == options[:spree_current_user]
end
object.owner == options[:spree_current_user]
end
def edit_path
edit_admin_enterprise_path(object)
end
def edit_path
edit_admin_enterprise_path(object)
end
def issues
OpenFoodNetwork::EnterpriseIssueValidator.new(object).issues
end
def issues
OpenFoodNetwork::EnterpriseIssueValidator.new(object).issues
end
def warnings
OpenFoodNetwork::EnterpriseIssueValidator.new(object).warnings
def warnings
OpenFoodNetwork::EnterpriseIssueValidator.new(object).warnings
end
end
end
end

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'open_food_network/order_cycle_permissions'
module Api

View File

@@ -1,3 +1,9 @@
class Api::Admin::InventoryItemSerializer < ActiveModel::Serializer
attributes :id, :enterprise_id, :variant_id, :visible
# frozen_string_literal: true
module Api
module Admin
class InventoryItemSerializer < ActiveModel::Serializer
attributes :id, :enterprise_id, :variant_id, :visible
end
end
end

View File

@@ -1,29 +1,35 @@
class Api::Admin::LineItemSerializer < ActiveModel::Serializer
attributes :id, :quantity, :max_quantity, :price, :supplier, :final_weight_volume,
:units_product, :units_variant
# frozen_string_literal: true
has_one :order, serializer: Api::Admin::IdSerializer
module Api
module Admin
class LineItemSerializer < ActiveModel::Serializer
attributes :id, :quantity, :max_quantity, :price, :supplier, :final_weight_volume,
:units_product, :units_variant
def supplier
{ id: object.product.supplier_id }
end
has_one :order, serializer: Api::Admin::IdSerializer
def units_product
Api::Admin::UnitsProductSerializer.new(object.product).serializable_hash
end
def supplier
{ id: object.product.supplier_id }
end
def units_variant
Api::Admin::UnitsVariantSerializer.new(object.variant).serializable_hash
end
def units_product
Api::Admin::UnitsProductSerializer.new(object.product).serializable_hash
end
def final_weight_volume
object.final_weight_volume.to_f
end
def units_variant
Api::Admin::UnitsVariantSerializer.new(object.variant).serializable_hash
end
def max_quantity
return object.quantity unless object.max_quantity.present? &&
object.max_quantity > object.quantity
def final_weight_volume
object.final_weight_volume.to_f
end
object.max_quantity
def max_quantity
return object.quantity unless object.max_quantity.present? &&
object.max_quantity > object.quantity
object.max_quantity
end
end
end
end

View File

@@ -1,88 +1,95 @@
# frozen_string_literal: true
require 'open_food_network/order_cycle_permissions'
class Api::Admin::OrderCycleSerializer < ActiveModel::Serializer
attributes :id, :name, :orders_open_at, :orders_close_at, :coordinator_id, :exchanges,
:editable_variants_for_incoming_exchanges, :editable_variants_for_outgoing_exchanges,
:visible_variants_for_outgoing_exchanges,
:viewing_as_coordinator, :schedule_ids, :subscriptions_count
module Api
module Admin
class OrderCycleSerializer < ActiveModel::Serializer
attributes :id, :name, :orders_open_at, :orders_close_at, :coordinator_id, :exchanges,
:editable_variants_for_incoming_exchanges,
:editable_variants_for_outgoing_exchanges,
:visible_variants_for_outgoing_exchanges,
:viewing_as_coordinator, :schedule_ids, :subscriptions_count
has_many :coordinator_fees, serializer: Api::IdSerializer
has_many :coordinator_fees, serializer: Api::IdSerializer
def orders_open_at
object.orders_open_at.to_s
end
def orders_open_at
object.orders_open_at.to_s
end
def orders_close_at
object.orders_close_at.to_s
end
def orders_close_at
object.orders_close_at.to_s
end
def viewing_as_coordinator
Enterprise.managed_by(options[:current_user]).include? object.coordinator
end
def viewing_as_coordinator
Enterprise.managed_by(options[:current_user]).include? object.coordinator
end
def subscriptions_count
ProxyOrder.not_canceled.where(order_cycle_id: object.id).count
end
def subscriptions_count
ProxyOrder.not_canceled.where(order_cycle_id: object.id).count
end
def exchanges
scoped_exchanges = permissions.visible_exchanges.by_enterprise_name
def exchanges
scoped_exchanges = permissions.visible_exchanges.by_enterprise_name
ActiveModel::ArraySerializer.
new(scoped_exchanges, each_serializer: Api::Admin::ExchangeSerializer,
current_user: options[:current_user])
end
ActiveModel::ArraySerializer.
new(scoped_exchanges, each_serializer: Api::Admin::ExchangeSerializer,
current_user: options[:current_user])
end
def editable_variants_for_incoming_exchanges
variant_ids_by_supplier_id(permissions.all_incoming_editable_variants.all)
end
def editable_variants_for_incoming_exchanges
variant_ids_by_supplier_id(permissions.all_incoming_editable_variants.all)
end
def editable_variants_for_outgoing_exchanges
# For each enterprise that the current user is able to see in this order cycle,
# work out which variants should be editable within incoming exchanges from that enterprise
editable = {}
visible_enterprises.each do |enterprise|
variants = permissions.editable_variants_for_outgoing_exchanges_to(enterprise).pluck(:id)
editable[enterprise.id] = variants if variants.any?
end
editable
end
def editable_variants_for_outgoing_exchanges
# For each enterprise that the current user is able to see in this order cycle,
# work out which variants should be editable within incoming exchanges from that enterprise
editable = {}
visible_enterprises.each do |enterprise|
variants = permissions.editable_variants_for_outgoing_exchanges_to(enterprise).pluck(:id)
editable[enterprise.id] = variants if variants.any?
end
editable
end
def visible_variants_for_outgoing_exchanges
# For each enterprise that the current user is able to see in this order cycle,
# work out which variants should be visible within outgoing exchanges from that enterprise
visible = {}
visible_enterprises.each do |enterprise|
# This is hopefully a temporary measure, pending the arrival of multiple named inventories
# for shops. We need this here to allow hubs to restrict visible variants to only those in
# their inventory if they so choose
variants = if enterprise.prefers_product_selection_from_inventory_only?
permissions.
visible_variants_for_outgoing_exchanges_to(enterprise).
visible_for(enterprise)
else
permissions.
visible_variants_for_outgoing_exchanges_to(enterprise).
not_hidden_for(enterprise)
end.pluck(:id)
visible[enterprise.id] = variants if variants.any?
end
visible
end
def visible_variants_for_outgoing_exchanges
# For each enterprise that the current user is able to see in this order cycle,
# work out which variants should be visible within outgoing exchanges from that enterprise
visible = {}
visible_enterprises.each do |enterprise|
# This is hopefully a temporary measure, pending the arrival of multiple named inventories
# for shops. We need this here to allow hubs to restrict visible variants to only those in
# their inventory if they so choose
variants = if enterprise.prefers_product_selection_from_inventory_only?
permissions.
visible_variants_for_outgoing_exchanges_to(enterprise).
visible_for(enterprise)
else
permissions.
visible_variants_for_outgoing_exchanges_to(enterprise).
not_hidden_for(enterprise)
end.pluck(:id)
visible[enterprise.id] = variants if variants.any?
end
visible
end
private
private
def permissions
@permissions ||= OpenFoodNetwork::OrderCyclePermissions.new(options[:current_user], object)
end
def permissions
@permissions ||= OpenFoodNetwork::OrderCyclePermissions.new(options[:current_user], object)
end
def visible_enterprises
@visible_enterprises ||= permissions.visible_enterprises
end
def visible_enterprises
@visible_enterprises ||= permissions.visible_enterprises
end
def variant_ids_by_supplier_id(variants)
grouped_by_supplier = variants.group_by(&:supplier_id)
grouped_by_supplier.each do |supplier_id, grouped_variants|
grouped_by_supplier[supplier_id] = grouped_variants.map(&:id)
def variant_ids_by_supplier_id(variants)
grouped_by_supplier = variants.group_by(&:supplier_id)
grouped_by_supplier.each do |supplier_id, grouped_variants|
grouped_by_supplier[supplier_id] = grouped_variants.map(&:id)
end
end
end
end
end

View File

@@ -1,71 +1,77 @@
class Api::Admin::OrderSerializer < ActiveModel::Serializer
attributes :id, :number, :user_id, :full_name, :email, :phone, :completed_at, :display_total,
:edit_path, :state, :payment_state, :shipment_state,
:payments_path, :ready_to_ship, :ready_to_capture, :created_at,
:distributor_name, :special_instructions,
:item_total, :adjustment_total, :payment_total, :total, :display_outstanding_balance
# frozen_string_literal: true
has_one :distributor, serializer: Api::Admin::IdSerializer
has_one :order_cycle, serializer: Api::Admin::IdSerializer
module Api
module Admin
class OrderSerializer < ActiveModel::Serializer
attributes :id, :number, :user_id, :full_name, :email, :phone, :completed_at, :display_total,
:edit_path, :state, :payment_state, :shipment_state,
:payments_path, :ready_to_ship, :ready_to_capture, :created_at,
:distributor_name, :special_instructions, :display_outstanding_balance,
:item_total, :adjustment_total, :payment_total, :total
def full_name
object.billing_address.nil? ? "" : ( object.billing_address.full_name || "" )
end
has_one :distributor, serializer: Api::Admin::IdSerializer
has_one :order_cycle, serializer: Api::Admin::IdSerializer
def distributor_name
object.distributor.andand.name
end
def full_name
object.billing_address.nil? ? "" : ( object.billing_address.full_name || "" )
end
def display_outstanding_balance
return "" if object.outstanding_balance.zero?
def distributor_name
object.distributor.andand.name
end
object.display_outstanding_balance.to_s
end
def display_outstanding_balance
return "" if object.outstanding_balance.zero?
def edit_path
return '' unless object.id
object.display_outstanding_balance.to_s
end
spree_routes_helper.edit_admin_order_path(object)
end
def edit_path
return '' unless object.id
def payments_path
return '' unless object.payment_state
spree_routes_helper.edit_admin_order_path(object)
end
spree_routes_helper.admin_order_payments_path(object)
end
def payments_path
return '' unless object.payment_state
def ready_to_capture
pending_payment = object.pending_payments.first
object.payment_required? && pending_payment
end
spree_routes_helper.admin_order_payments_path(object)
end
def ready_to_ship
object.ready_to_ship?
end
def ready_to_capture
pending_payment = object.pending_payments.first
object.payment_required? && pending_payment
end
def display_total
object.display_total.to_html
end
def ready_to_ship
object.ready_to_ship?
end
def email
object.email || ""
end
def display_total
object.display_total.to_html
end
def phone
object.billing_address.nil? ? "a" : ( object.billing_address.phone || "" )
end
def email
object.email || ""
end
def created_at
object.created_at.blank? ? "" : I18n.l(object.created_at, format: '%B %d, %Y')
end
def phone
object.billing_address.nil? ? "a" : ( object.billing_address.phone || "" )
end
def completed_at
object.completed_at.blank? ? "" : I18n.l(object.completed_at, format: '%B %d, %Y')
end
def created_at
object.created_at.blank? ? "" : I18n.l(object.created_at, format: '%B %d, %Y')
end
private
def completed_at
object.completed_at.blank? ? "" : I18n.l(object.completed_at, format: '%B %d, %Y')
end
def spree_routes_helper
Spree::Core::Engine.routes.url_helpers
private
def spree_routes_helper
Spree::Core::Engine.routes.url_helpers
end
end
end
end

View File

@@ -1,13 +1,19 @@
module Api::Admin::PaymentMethod
class BaseSerializer < ActiveModel::Serializer
attributes :id, :name, :type, :tag_list, :tags
# frozen_string_literal: true
def tag_list
object.tag_list.join(",")
end
module Api
module Admin
module PaymentMethod
class BaseSerializer < ActiveModel::Serializer
attributes :id, :name, :type, :tag_list, :tags
def tags
object.tag_list.map{ |t| { text: t } }
def tag_list
object.tag_list.join(",")
end
def tags
object.tag_list.map{ |t| { text: t } }
end
end
end
end
end

View File

@@ -1,5 +1,11 @@
module Api::Admin::PaymentMethod
class StripeSerializer < BaseSerializer
attributes :preferred_enterprise_id
# frozen_string_literal: true
module Api
module Admin
module PaymentMethod
class StripeSerializer < BaseSerializer
attributes :preferred_enterprise_id
end
end
end
end

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Api
module Admin
class PaymentMethodSerializer < ActiveModel::Serializer

View File

@@ -1,44 +1,50 @@
class Api::Admin::ProductSerializer < ActiveModel::Serializer
attributes :id, :name, :sku, :variant_unit, :variant_unit_scale, :variant_unit_name,
:inherits_properties, :on_hand, :price, :available_on, :permalink_live,
:tax_category_id, :import_date, :image_url, :thumb_url
# frozen_string_literal: true
has_one :supplier, key: :producer_id, embed: :id
has_one :primary_taxon, key: :category_id, embed: :id
has_many :variants, key: :variants, serializer: Api::Admin::VariantSerializer
has_one :master, serializer: Api::Admin::VariantSerializer
module Api
module Admin
class ProductSerializer < ActiveModel::Serializer
attributes :id, :name, :sku, :variant_unit, :variant_unit_scale, :variant_unit_name,
:inherits_properties, :on_hand, :price, :available_on, :permalink_live,
:tax_category_id, :import_date, :image_url, :thumb_url
def image_url
if object.images.present?
object.images.first.attachment.url(:product)
else
"/noimage/product.png"
has_one :supplier, key: :producer_id, embed: :id
has_one :primary_taxon, key: :category_id, embed: :id
has_many :variants, key: :variants, serializer: Api::Admin::VariantSerializer
has_one :master, serializer: Api::Admin::VariantSerializer
def image_url
if object.images.present?
object.images.first.attachment.url(:product)
else
"/noimage/product.png"
end
end
def thumb_url
if object.images.present?
object.images.first.attachment.url(:mini)
else
"/noimage/mini.png"
end
end
def on_hand
return 0 if object.on_hand.nil?
object.on_hand
end
def price
object.price.nil? ? '0.0' : object.price
end
def available_on
object.available_on.blank? ? "" : object.available_on.strftime("%F %T")
end
def permalink_live
object.permalink
end
end
end
def thumb_url
if object.images.present?
object.images.first.attachment.url(:mini)
else
"/noimage/mini.png"
end
end
def on_hand
return 0 if object.on_hand.nil?
object.on_hand
end
def price
object.price.nil? ? '0.0' : object.price
end
def available_on
object.available_on.blank? ? "" : object.available_on.strftime("%F %T")
end
def permalink_live
object.permalink
end
end

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Api
module Admin
class ProxyOrderSerializer < ActiveModel::Serializer

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Api
module Admin
class ScheduleSerializer < ActiveModel::Serializer

View File

@@ -1,11 +1,17 @@
class Api::Admin::ShippingMethodSerializer < ActiveModel::Serializer
attributes :id, :name, :tag_list, :tags
# frozen_string_literal: true
def tag_list
object.tag_list.join(",")
end
module Api
module Admin
class ShippingMethodSerializer < ActiveModel::Serializer
attributes :id, :name, :tag_list, :tags
def tags
object.tag_list.map{ |t| { text: t } }
def tag_list
object.tag_list.join(",")
end
def tags
object.tag_list.map{ |t| { text: t } }
end
end
end
end

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Api
module Admin
# Used by admin subscription form

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Api
module Admin
class SubscriptionLineItemSerializer < ActiveModel::Serializer

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Api
module Admin
class SubscriptionSerializer < ActiveModel::Serializer

View File

@@ -1,51 +1,63 @@
class Api::Admin::TagRuleSerializer < ActiveModel::Serializer
delegate :serializable_hash, to: :rule_specific_serializer
# frozen_string_literal: true
def rule_specific_serializer
"Api::Admin::#{object.class}Serializer".constantize.new(object)
end
end
module Api
module Admin
class TagRuleSerializer < ActiveModel::Serializer
delegate :serializable_hash, to: :rule_specific_serializer
module Api::Admin::TagRule
class BaseSerializer < ActiveModel::Serializer
attributes :id, :enterprise_id, :type, :is_default, :preferred_customer_tags
end
class DiscountOrderSerializer < BaseSerializer
has_one :calculator, serializer: Api::Admin::Calculator::FlatPercentItemTotalSerializer
end
class FilterShippingMethodsSerializer < BaseSerializer
attributes :preferred_matched_shipping_methods_visibility, :preferred_shipping_method_tags,
:shipping_method_tags
def shipping_method_tags
object.preferred_shipping_method_tags.split(",")
end
end
class FilterPaymentMethodsSerializer < BaseSerializer
attributes :preferred_matched_payment_methods_visibility, :preferred_payment_method_tags,
:payment_method_tags
def payment_method_tags
object.preferred_payment_method_tags.split(",")
end
end
class FilterProductsSerializer < BaseSerializer
attributes :preferred_matched_variants_visibility, :preferred_variant_tags, :variant_tags
def variant_tags
object.preferred_variant_tags.split(",")
end
end
class FilterOrderCyclesSerializer < BaseSerializer
attributes :preferred_matched_order_cycles_visibility, :preferred_exchange_tags, :exchange_tags
def exchange_tags
object.preferred_exchange_tags.split(",")
def rule_specific_serializer
"Api::Admin::#{object.class}Serializer".constantize.new(object)
end
end
end
end
module Api
module Admin
module TagRule
class BaseSerializer < ActiveModel::Serializer
attributes :id, :enterprise_id, :type, :is_default, :preferred_customer_tags
end
class DiscountOrderSerializer < BaseSerializer
has_one :calculator, serializer: Api::Admin::Calculator::FlatPercentItemTotalSerializer
end
class FilterShippingMethodsSerializer < BaseSerializer
attributes :preferred_matched_shipping_methods_visibility, :preferred_shipping_method_tags,
:shipping_method_tags
def shipping_method_tags
object.preferred_shipping_method_tags.split(",")
end
end
class FilterPaymentMethodsSerializer < BaseSerializer
attributes :preferred_matched_payment_methods_visibility, :preferred_payment_method_tags,
:payment_method_tags
def payment_method_tags
object.preferred_payment_method_tags.split(",")
end
end
class FilterProductsSerializer < BaseSerializer
attributes :preferred_matched_variants_visibility, :preferred_variant_tags, :variant_tags
def variant_tags
object.preferred_variant_tags.split(",")
end
end
class FilterOrderCyclesSerializer < BaseSerializer
attributes :preferred_matched_order_cycles_visibility,
:preferred_exchange_tags,
:exchange_tags
def exchange_tags
object.preferred_exchange_tags.split(",")
end
end
end
end
end

View File

@@ -1,3 +1,9 @@
class Api::Admin::TaxCategorySerializer < ActiveModel::Serializer
attributes :id, :name
# frozen_string_literal: true
module Api
module Admin
class TaxCategorySerializer < ActiveModel::Serializer
attributes :id, :name
end
end
end

View File

@@ -1,3 +1,9 @@
class Api::Admin::TaxonSerializer < ActiveModel::Serializer
attributes :id, :name, :pretty_name
# frozen_string_literal: true
module Api
module Admin
class TaxonSerializer < ActiveModel::Serializer
attributes :id, :name, :pretty_name
end
end
end

View File

@@ -1,3 +1,9 @@
class Api::Admin::UnitsProductSerializer < ActiveModel::Serializer
attributes :id, :name, :group_buy_unit_size, :variant_unit
# frozen_string_literal: true
module Api
module Admin
class UnitsProductSerializer < ActiveModel::Serializer
attributes :id, :name, :group_buy_unit_size, :variant_unit
end
end
end

View File

@@ -1,8 +1,14 @@
class Api::Admin::UnitsVariantSerializer < ActiveModel::Serializer
attributes :id, :full_name, :unit_value
# frozen_string_literal: true
def full_name
full_name = object.full_name
object.product.name + (full_name.blank? ? "" : ": #{full_name}")
module Api
module Admin
class UnitsVariantSerializer < ActiveModel::Serializer
attributes :id, :full_name, :unit_value
def full_name
full_name = object.full_name
object.product.name + (full_name.blank? ? "" : ": #{full_name}")
end
end
end
end

View File

@@ -1,20 +1,26 @@
# frozen_string_literal: true
require 'open_food_network/address_finder'
class Api::Admin::UserSerializer < ActiveModel::Serializer
attributes :id, :email, :confirmed
module Api
module Admin
class UserSerializer < ActiveModel::Serializer
attributes :id, :email, :confirmed
has_one :ship_address, serializer: Api::AddressSerializer
has_one :bill_address, serializer: Api::AddressSerializer
has_one :ship_address, serializer: Api::AddressSerializer
has_one :bill_address, serializer: Api::AddressSerializer
def ship_address
OpenFoodNetwork::AddressFinder.new(object.email, object).ship_address
end
def ship_address
OpenFoodNetwork::AddressFinder.new(object.email, object).ship_address
end
def bill_address
OpenFoodNetwork::AddressFinder.new(object.email, object).bill_address
end
def bill_address
OpenFoodNetwork::AddressFinder.new(object.email, object).bill_address
end
def confirmed
object.confirmed?
def confirmed
object.confirmed?
end
end
end
end

View File

@@ -1,12 +1,18 @@
class Api::Admin::VariantOverrideSerializer < ActiveModel::Serializer
attributes :id, :hub_id, :variant_id, :sku, :price, :count_on_hand, :on_demand, :default_stock,
:resettable, :tag_list, :tags, :import_date
# frozen_string_literal: true
def tag_list
object.tag_list.join(",")
end
module Api
module Admin
class VariantOverrideSerializer < ActiveModel::Serializer
attributes :id, :hub_id, :variant_id, :sku, :price, :count_on_hand, :on_demand,
:default_stock, :resettable, :tag_list, :tags, :import_date
def tags
object.tag_list.map { |t| { text: t } }
def tag_list
object.tag_list.join(",")
end
def tags
object.tag_list.map { |t| { text: t } }
end
end
end
end

View File

@@ -1,53 +1,60 @@
class Api::Admin::VariantSerializer < ActiveModel::Serializer
attributes :id, :name, :producer_name, :image, :sku, :import_date,
:options_text, :unit_value, :unit_description, :unit_to_display,
:display_as, :display_name, :name_to_display,
:price, :on_demand, :on_hand, :in_stock, :stock_location_id, :stock_location_name
# frozen_string_literal: true
has_many :variant_overrides
module Api
module Admin
class VariantSerializer < ActiveModel::Serializer
attributes :id, :name, :producer_name, :image, :sku, :import_date,
:options_text, :unit_value, :unit_description, :unit_to_display,
:display_as, :display_name, :name_to_display,
:price, :on_demand, :on_hand, :in_stock, :stock_location_id, :stock_location_name
def name
if object.full_name.present?
"#{object.name} - #{object.full_name}"
else
object.name
has_many :variant_overrides
def name
if object.full_name.present?
"#{object.name} - #{object.full_name}"
else
object.name
end
end
def on_hand
return 0 if object.on_hand.nil?
object.on_hand
end
def price
# Decimals are passed to json as strings,
# we need to run parseFloat.toFixed(2) on the client.
object.price.nil? ? 0.to_f : object.price
end
def producer_name
object.product.supplier.name
end
def image
return if object.product.images.empty?
object.product.images.first.mini_url
end
def in_stock
object.in_stock?
end
def stock_location_id
return if object.stock_items.empty?
object.stock_items.first.stock_location.id
end
def stock_location_name
return if object.stock_items.empty?
object.stock_items.first.stock_location.name
end
end
end
def on_hand
return 0 if object.on_hand.nil?
object.on_hand
end
def price
# Decimals are passed to json as strings, we need to run parseFloat.toFixed(2) on the client.
object.price.nil? ? 0.to_f : object.price
end
def producer_name
object.product.supplier.name
end
def image
return if object.product.images.empty?
object.product.images.first.mini_url
end
def in_stock
object.in_stock?
end
def stock_location_id
return if object.stock_items.empty?
object.stock_items.first.stock_location.id
end
def stock_location_name
return if object.stock_items.empty?
object.stock_items.first.stock_location.name
end
end

View File

@@ -8,6 +8,7 @@ module Checkout
end
def success(controller, params, current_user)
set_customer_terms_and_conditions_accepted_at(params)
save_order_addresses_as_user_default(params, current_user)
OrderCompletionReset.new(controller, @order).call
end
@@ -26,5 +27,11 @@ module Checkout
user_default_address_setter.set_default_bill_address if params[:order][:default_bill_address]
user_default_address_setter.set_default_ship_address if params[:order][:default_ship_address]
end
def set_customer_terms_and_conditions_accepted_at(params)
return unless params[:order]
@order.customer.update(terms_and_conditions_accepted_at: Time.zone.now) if params[:order][:terms_and_conditions_accepted]
end
end
end

View File

@@ -55,6 +55,7 @@
%col.tags{ width: "20%", 'ng-show' => 'columns.tags.visible' }
%col.bill_address{ width: "10%", 'ng-show' => 'columns.bill_address.visible' }
%col.ship_address{ width: "10%", 'ng-show' => 'columns.ship_address.visible' }
%col.balance{ width: "10%", 'ng-show' => 'columns.balance.visible' }
%col.actions{ width: "10%"}
%thead
%tr{ ng: { controller: "ColumnsCtrl" } }
@@ -69,6 +70,7 @@
%th.tags{ 'ng-show' => 'columns.tags.visible' }=t('admin.tags')
%th.bill_address{ 'ng-show' => 'columns.bill_address.visible' }=t('admin.customers.index.bill_address')
%th.ship_address{ 'ng-show' => 'columns.ship_address.visible' }=t('admin.customers.index.ship_address')
%th.balance{ 'ng-show' => 'columns.balance.visible' }=t('admin.customers.index.balance')
%th.actions
Ask?&nbsp;
%input{ :type => 'checkbox', 'ng-model' => "confirmDelete" }
@@ -92,6 +94,9 @@
%a{ id: 'bill-address-link', href: 'javascript:void(0)', "ng-bind" => "customer.bill_address ? customer.bill_address.address1 : '#{t('admin.customers.index.edit')}' | limitTo: 15", 'edit-address-dialog' => true }
%td.ship_address{ 'ng-show' => 'columns.ship_address.visible' }
%a{ id: 'ship-address-link', href: 'javascript:void(0)', "ng-bind" => "customer.ship_address ? customer.ship_address.address1 : '#{t('admin.customers.index.edit')}' | limitTo: 15", 'edit-address-dialog' => true }
%td.balance.align-center{ 'ng-show' => 'columns.balance.visible'}
%span.state.white-space-nowrap{ 'ng-class' => 'customer.balance_status', 'ng-bind' => 'displayBalanceStatus(customer)' }
%span{ 'ng-bind' => '::customer.balance' }
%td.actions
%a{ 'ng-click' => "deleteCustomer(customer)", :class => "delete-customer icon-trash no-text" }

View File

@@ -35,12 +35,15 @@
.row
.alpha.three.columns
= f.label :terms_and_conditions, t('.terms_and_conditions')
%i.text-big.icon-question-sign.help-modal{ template: 'admin/modals/terms_and_conditions_info.html' }
.omega.eight.columns
%a{ href: '{{ Enterprise.terms_and_conditions }}', ng: { if: 'Enterprise.terms_and_conditions' } }
%a{ href: '{{ Enterprise.terms_and_conditions }}', target: '_blank', ng: { if: 'Enterprise.terms_and_conditions' } }
= '{{ Enterprise.terms_and_conditions_file_name }}'
= t('.uploaded_on')
= '{{ Enterprise.terms_and_conditions_updated_at }}'
.pad-top
= f.file_field :terms_and_conditions
= f.file_field :terms_and_conditions, accept: 'application/pdf', 'terms-and-conditions-warning' => 'true'
.pad-top
%a.button.red{ href: '', ng: {click: 'removeTermsAndConditions()', if: 'Enterprise.terms_and_conditions'} }
= t('.remove_terms_and_conditions')

View File

@@ -16,6 +16,6 @@
= render "checkout/already_ordered", f: f if show_bought_items?
= render "checkout/terms_and_conditions", f: f
%p
%button.button.primary{type: :submit}
%button.button.primary{ type: :submit, ng: { disabled: "terms_and_conditions_activated && !terms_and_conditions_accepted" } }
= t :checkout_send
/ {{ checkout.$valid }}

View File

@@ -1,2 +1,4 @@
%p.small
= t('.message_html', terms_and_conditions_link: link_to( t( '.link_text' ), current_order.distributor.terms_and_conditions.url, target: '_blank')) if current_order.distributor.terms_and_conditions.file?
- if terms_and_conditions_activated?
%p
%input{ type: 'checkbox', id: 'accept_terms', ng: { model: "terms_and_conditions_accepted", init: "terms_and_conditions_activated=#{terms_and_conditions_activated?}; terms_and_conditions_accepted=#{terms_and_conditions_already_accepted?}" } }
%label.small{for: "accept_terms"}= t('.message_html', terms_and_conditions_link: link_to( t( '.link_text' ), current_order.distributor.terms_and_conditions.url, target: '_blank'))

View File

@@ -87,6 +87,14 @@
.field
= preference_field_tag(:enable_localized_number?, Spree::Config[:enable_localized_number?], type: Spree::Config.preference_type(:enable_localized_number?))
= label_tag(:enable_localized_number?, t('admin.number_localization.enable_localized_number')) + tag(:br)
%fieldset.available_units.no-border-bottom
%legend{:align => "center"}= t('admin.available_units')
.field
- available_units = Spree::Config[:available_units].split(",")
- all_units.each do |unit|
- selected = available_units.include?(unit)
= preference_field_tag("available_units[#{unit}]", selected, { type: :boolean, selected: selected })
= label_tag(unit, unit.downcase) + tag(:br)
.form-buttons.filter-actions.actions{"data-hook" => "buttons"}
= button Spree.t('actions.update'), 'icon-refresh'

View File

@@ -10,6 +10,7 @@
= render :partial => 'spree/admin/shared/order_sub_menu'
= admin_inject_column_preferences module: 'admin.lineItems'
= admin_inject_available_units
%div{ ng: { controller: 'LineItemsCtrl' } }
%save-bar{ dirty: "bulk_order_form.$dirty", persist: "false" }

View File

@@ -1,5 +1,6 @@
= render 'spree/admin/products/index/header'
= render 'spree/admin/products/index/data'
= admin_inject_available_units
%div{ ng: { app: 'ofn.admin', controller: 'AdminProductEditCtrl', init: 'initialise()' } }

View File

@@ -4,6 +4,8 @@
= render partial: 'spree/shared/error_messages', locals: { target: @variant }
= admin_inject_available_units
= form_for [:admin, @product, @variant], :url => admin_product_variant_path(@product, @variant, @url_filters) do |f|
%fieldset.no-border-top
%div

View File

@@ -1,5 +1,7 @@
= render partial: 'spree/shared/error_messages', locals: { target: @variant }
= admin_inject_available_units
= form_for [:admin, @product, @variant], :url => admin_product_variants_path(@product, @url_filters) do |f|
%fieldset{'data-hook' => "admin_variant_new_form"}
%legend{align: "center"}= t('.new_variant')

View File

@@ -3,7 +3,7 @@
%td.toggle-bought{ colspan: 2, ng: { click: 'showBought=!showBought' } }
%h5.brick
%i{ ng: { class: "{ 'ofn-i_007-caret-right': !showBought, 'ofn-i_005-caret-down': showBought}"} }
= t(:orders_bought_items_notice, count: @order.finalised_line_items.sum(&:quantity))
= t(:orders_bought_items_notice, count: @order.finalised_line_items.to_a.sum(&:quantity))
%td.text-right{ colspan: 3 }
%a.edit-finalised.button.radius.expand.small{ href: changeable_orders_link_path, ng: { class: "{secondary: !showBought, primary: showBought}" } }
= t(:orders_bought_edit_button)

View File

@@ -1,7 +1,9 @@
# Google requires an API key with a billing account to use their API.
# The key is stored in config/application.yml.
Geocoder.configure(
lookup: :google,
timeout: ENV.fetch('GEOCODER_TIMEOUT', 3).to_i,
lookup: ENV.fetch('GEOCODER_SERVICE', :google).to_sym,
use_https: true,
api_key: ENV.fetch('GOOGLE_MAPS_API_KEY', nil)
api_key: ENV.fetch('GEOCODER_API_KEY', ENV["GOOGLE_MAPS_API_KEY"])
)

View File

@@ -351,6 +351,7 @@ ar:
has_n_rules: "لديه %{num} قواعد"
unsaved_confirm_leave: "هناك تغييرات لم يتم حفظها في هذه الصفحة. أكمل بدون حفظ؟"
unsaved_changes: "لم تحفظ التغييرات"
available_units: "الوحدات المتاحة"
shopfront_settings:
embedded_shopfront_settings: "إعدادات واجهة المتجر المدمجة "
enable_embedded_shopfronts: "تمكين واجهة المتجر المدمجة"
@@ -396,20 +397,23 @@ ar:
duplicate_code: "هذا الكود مستخدم بالفعل"
bill_address: "عنوان وصول الفواتير"
ship_address: "عنوان الشحن"
update_address_success: 'تم تحديث العنوان بنجاح.'
update_address_error: 'آسف! يرجى إدخال جميع الحقول المطلوبة!'
edit_bill_address: 'تحرير عنوان الفواتير'
edit_ship_address: 'تحرير عنوان الشحن'
required_fileds: 'تتم الإشارة إلى الحقول المطلوبة بعلامة النجمة'
select_country: 'اختر الدولة'
select_state: 'اختر ولايه'
edit: 'تعديل'
update_address: 'تحديث العنوان'
confirm_delete: 'متأكد من ان يتم حذف؟'
balance: "الباقي"
update_address_success: "تم تحديث العنوان بنجاح."
update_address_error: "آسف! يرجى إدخال جميع الحقول المطلوبة!"
edit_bill_address: "تحرير عنوان الفواتير"
edit_ship_address: "تحرير عنوان الشحن"
required_fileds: "تتم الإشارة إلى الحقول المطلوبة بعلامة النجمة"
select_country: "اختر الدولة"
select_state: "اختر ولايه"
edit: "تعديل"
update_address: "تحديث العنوان"
confirm_delete: "متأكد من ان يتم حذف؟"
search_by_email: "البحث عن طريق البريد الإلكتروني / الرمز ..."
guest_label: 'الخروج كضيف'
guest_label: "الخروج كضيف"
credit_owed: "الائتمان مدين"
balance_due: "الرصيد المستحق"
destroy:
has_associated_orders: 'فشل الحذف: قام العميل بربط الطلبات مع متجره'
has_associated_orders: "فشل الحذف: قام العميل بربط الطلبات مع متجره"
contents:
edit:
title: المحتوى
@@ -1160,8 +1164,7 @@ ar:
cart: "سلة التسوق"
message_html: "لديك طلب لدورة الطلب هذه بالفعل. تحقق من %{cart} لرؤية العناصر التي طلبتها من قبل. يمكنك أيضًا إلغاء العناصر طالما كانت دورة الطلب مفتوحة."
terms_and_conditions:
message_html: "من خلال تقديم هذا الطلب ، فإنك توافق على %{terms_and_conditions_link}."
link_text: "شروط الخدمة"
link_text: "الأحكام والشروط"
failed: "فشل الخروج. يرجى إعلامنا حتى نتمكن من معالجة طلبك."
shops:
hubs:
@@ -2383,8 +2386,9 @@ ar:
admin:
enterprise_limit_reached: "لقد وصلت إلى الحد القياسي للمؤسسات لكل حساب. اكتب %{contact_email} إذا كنت بحاجة إلى زيادته."
modals:
got_it: فهمتك
got_it: "فهمتك"
close: "إغلاق"
continue: "تابع"
invite: "ادعو"
invite_title: "دعوة مستخدم غير مسجل"
tag_rule_help:
@@ -3044,6 +3048,7 @@ ar:
new_taxonomy: "تصنيف جديد"
back_to_taxonomies_list: "العودة إلى قائمة التصنيفات"
shipping_methods: "طرق الشحن"
shipping_method: "طريقة الشحن"
shipping_categories: "فئات الشحن"
new_shipping_category: "فئة الشحن الجديدة"
back_to_shipping_categories: "العودة إلى فئات الشحن"
@@ -3519,6 +3524,7 @@ ar:
issue_text: |
إذا لم يعمل عنوان URL أعلاه ، فحاول نسخه ولصقه في متصفحك.
إذا كنت لا تزال تواجه مشاكل ، فلا تتردد في الاتصال بنا.
subject: "تعليمات إعادة تعيين كلمة المرور"
confirmation_instructions:
subject: "يرجى تأكيد حسابك OFN"
shipment_mailer:

View File

@@ -396,20 +396,22 @@ ca:
duplicate_code: "Aquest codi ja s'ha utilitzat."
bill_address: "Adreça de facturació"
ship_address: "Adreça d'enviament"
update_address_success: 'L''adreça s''ha actualitzat correctament.'
update_address_error: 'Ho sentim! Introduïu tots els camps obligatoris.'
edit_bill_address: 'Edita l''adreça de facturació'
edit_ship_address: 'Edita l''adreça d''enviament'
required_fileds: 'Els camps obligatoris es denoten amb un asterisc'
select_country: 'Selecciona país'
select_state: 'Selecciona província'
edit: 'Editar'
update_address: 'Actualitza l''adreça'
confirm_delete: 'Estàs segur que vols suprimir?'
balance: "Balanç"
update_address_success: "L'adreça s'ha actualitzat correctament."
update_address_error: "Ho sentim! Introduïu tots els camps obligatoris."
edit_bill_address: "Edita l'adreça de facturació"
edit_ship_address: "Edita l'adreça d'enviament"
required_fileds: "Els camps obligatoris es denoten amb un asterisc"
select_country: "Selecciona país"
select_state: "Selecciona província"
edit: "Editar"
update_address: "Actualitza l'adreça"
confirm_delete: "Estàs segur que vols suprimir?"
search_by_email: "Cerca per correu electrònic/codi ..."
guest_label: 'Fer comanda com a convidat'
guest_label: "Fer comanda com a convidat"
credit_owed: "Crèdit a deure"
destroy:
has_associated_orders: 'S''ha produït un error en suprimir: la consumidora té comandes associades amb la seva botiga'
has_associated_orders: "S'ha produït un error en suprimir: la consumidora té comandes associades amb la seva botiga"
contents:
edit:
title: Contingut
@@ -1164,8 +1166,7 @@ ca:
cart: "cistella"
message_html: "Ja teniu una comanda per a aquest cicle de comanda. Consulteu %{cart} per veure els articles que heu demanat anteriorment. També podeu cancel·lar articles sempre que el cicle de comanda estigui obert."
terms_and_conditions:
message_html: "En fer aquesta comanda accepteu %{terms_and_conditions_link}."
link_text: "Termes del servei"
link_text: "Termes i condicions"
failed: "La comanda ha fallat. Informeu-nos perquè puguem processar la vostra comanda."
shops:
hubs:
@@ -2381,8 +2382,9 @@ ca:
admin:
enterprise_limit_reached: "Has assolit el límit estàndard d'organitzacions per compte. Escriu a %{contact_email} si necessites augmentar-lo."
modals:
got_it: Ho tinc
got_it: "Ho tinc"
close: "Tanca"
continue: "Continua"
invite: "Convida"
invite_title: "Convida un usuari no registrat"
tag_rule_help:
@@ -2952,6 +2954,7 @@ ca:
new_taxonomy: "Nova taxonomia"
back_to_taxonomies_list: "Torna a la llista de taxonomies"
shipping_methods: "Mètodes d'enviament"
shipping_method: "Mètode d'enviament"
shipping_categories: "Tipus d'enviament"
new_shipping_category: "Nova categoria denviament"
back_to_shipping_categories: "Tornar a les categories d'enviament"
@@ -3368,7 +3371,7 @@ ca:
or_enter_new_card: "O bé introdueix els detalls d'una nova targeta:"
remember_this_card: Recordar aquesta targeta?
date_picker:
format: '%d-% m-% Y'
format: '%d-%m-%Y'
js_format: 'dd-mm-yy'
orders:
error_flash_for_unavailable_items: "Un ítem del teu carret ja no està disponible. Sis plau actualitza les quantitats seleccionades."

View File

@@ -379,20 +379,21 @@ de_DE:
duplicate_code: "Dieser Kode wird bereits verwendet."
bill_address: "Rechnungsadresse"
ship_address: "Lieferadresse"
update_address_success: 'Adresse wurde erfolgreich aktualisiert.'
update_address_error: 'Es tut uns leid! Bitte füllen Sie alle erforderlichen Felder aus!'
edit_bill_address: 'Rechnungsadresse bearbeiten'
edit_ship_address: 'Lieferadresse bearbeiten'
required_fileds: 'Die erforderlichen Felder sind mit einem Sternchen gekennzeichnet.'
select_country: 'Land wählen'
select_state: 'Bundesland wählen'
edit: 'Bearbeiten'
update_address: 'Adresse aktualisieren'
confirm_delete: 'Sicher zu löschen?'
balance: "Saldo"
update_address_success: "Adresse wurde erfolgreich aktualisiert."
update_address_error: "Es tut uns leid! Bitte füllen Sie alle erforderlichen Felder aus!"
edit_bill_address: "Rechnungsadresse bearbeiten"
edit_ship_address: "Lieferadresse bearbeiten"
required_fileds: "Die erforderlichen Felder sind mit einem Sternchen gekennzeichnet."
select_country: "Land wählen"
select_state: "Bundesland wählen"
edit: "Bearbeiten"
update_address: "Adresse aktualisieren"
confirm_delete: "Sicher zu löschen?"
search_by_email: "Suche nach Email/Kode"
guest_label: 'Gäste Kasse'
guest_label: "Gäste Kasse"
destroy:
has_associated_orders: 'Löschen fehlgeschlagen: Kunde hat Bestellungen mit diesem Laden'
has_associated_orders: "Löschen fehlgeschlagen: Kunde hat Bestellungen mit diesem Laden"
contents:
edit:
title: Inhalt
@@ -2314,8 +2315,9 @@ de_DE:
admin:
enterprise_limit_reached: "Sie haben die Standardgrenze für Unternehmen pro Konto erreicht. Schreiben Sie an %{contact_email}, wenn Sie es erhöhen müssen."
modals:
got_it: Ich habs
got_it: "Ich habs"
close: "Schließen"
continue: "Fortsetzen"
invite: "Einladen"
invite_title: "Laden Sie einen nicht registrierten Benutzer ein"
tag_rule_help:
@@ -2862,6 +2864,7 @@ de_DE:
new_taxonomy: "Neue Taxonomie"
back_to_taxonomies_list: "Zurück zur Taxonomieliste"
shipping_methods: "Lieferart"
shipping_method: "Lieferart"
shipping_categories: "Versandkategorien"
new_shipping_category: "Neue Versandkategorie"
back_to_shipping_categories: "Zurück zu den Versandkategorien"
@@ -3230,8 +3233,8 @@ de_DE:
or_enter_new_card: "Oder geben Sie Details für eine neue Karte ein:"
remember_this_card: Diese Karte speichern?
date_picker:
format: '% Y-% m-%d'
js_format: 'JJ-MM-TT'
format: '%Y.%m.%d'
js_format: 'dd.mm.yy'
orders:
edit:
login_to_view_order: "Bitte loggen Sie sich ein, um Ihre Bestellung anzuzeigen."

View File

@@ -394,6 +394,8 @@ en:
unsaved_confirm_leave: "There are unsaved changed on this page. Continue without saving?"
unsaved_changes: "You have unsaved changes"
available_units: "Available Units"
shopfront_settings:
embedded_shopfront_settings: "Embedded Shopfront Settings"
enable_embedded_shopfronts: "Enable Embedded Shopfronts"
@@ -444,20 +446,23 @@ en:
duplicate_code: "This code is used already."
bill_address: "Billing Address"
ship_address: "Shipping Address"
update_address_success: 'Address updated successfully.'
update_address_error: 'Sorry! Please input all of the required fields!'
edit_bill_address: 'Edit Billing Address'
edit_ship_address: 'Edit Shipping Address'
required_fileds: 'Required fields are denoted with an asterisk '
select_country: 'Select Country'
select_state: 'Select State'
edit: 'Edit'
update_address: 'Update Address'
confirm_delete: 'Sure to delete?'
balance: "Balance"
update_address_success: "Address updated successfully."
update_address_error: "Sorry! Please input all of the required fields!"
edit_bill_address: "Edit Billing Address"
edit_ship_address: "Edit Shipping Address"
required_fileds: "Required fields are denoted with an asterisk "
select_country: "Select Country"
select_state: "Select State"
edit: "Edit"
update_address: "Update Address"
confirm_delete: "Sure to delete?"
search_by_email: "Search by email/code..."
guest_label: 'Guest checkout'
guest_label: "Guest checkout"
credit_owed: "Credit Owed"
balance_due: "Balance Due"
destroy:
has_associated_orders: 'Delete failed: customer has associated orders with his shop'
has_associated_orders: "Delete failed: customer has associated orders with his shop"
contents:
edit:
@@ -700,6 +705,7 @@ en:
invoice_text: Add customized text at the end of invoices
terms_and_conditions: "Terms and Conditions"
remove_terms_and_conditions: "Remove File"
uploaded_on: "uploaded on"
contact:
name: Name
name_placeholder: eg. Gustav Plum
@@ -1230,8 +1236,8 @@ en:
cart: "cart"
message_html: "You have an order for this order cycle already. Check the %{cart} to see the items you ordered before. You can also cancel items as long as the order cycle is open."
terms_and_conditions:
message_html: "By placing this order you agree to the %{terms_and_conditions_link}."
link_text: "Terms of Service"
message_html: "I agree to the seller's %{terms_and_conditions_link}."
link_text: "Terms and Conditions"
failed: "The checkout failed. Please let us know so that we can process your order."
shops:
hubs:
@@ -2512,8 +2518,9 @@ See the %{link} to find out more about %{sitename}'s features and to start using
admin:
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
modals:
got_it: Got it
got_it: "Got it"
close: "Close"
continue: "Continue"
invite: "Invite"
invite_title: "Invite an unregistered user"
tag_rule_help:
@@ -2532,6 +2539,14 @@ See the %{link} to find out more about %{sitename}'s features and to start using
customer_tagged_rules_text: >
By creating rules related to a specific customer tag, you can override the default
behaviour (whether it be to show or to hide items) for customers with the specified tag.
terms_and_conditions_info:
title: "Uploading Terms and Conditions"
message_1: "Terms and Conditions are the contract between you, the seller, and the shopper. If you upload a file here shoppers must accept your Terms and Conditions in order to complete checkout. For the shopper this will appear as a checkbox at checkout that must be checked in order to proceed with checkout. We highly recommend you upload Terms and Conditions in alignment with national legislation."
message_2: "Shoppers will only be required to accept Terms and Conditions once. However if you change you Terms and Conditions shoppers will again be required to accept them before they can checkout."
terms_and_conditions_warning:
title: "Uploading Terms and Conditions"
message_1: "All your buyers will have to agree to them once at checkout. If you update the file, all your buyers will have to agree to them again at checkout."
message_2: "For buyers with subscriptions, you need to email them the Terms and Conditions (or the changes to them) for now, nothing will notify them about these new Terms and Conditions."
panels:
save: SAVE
saved: SAVED
@@ -3104,6 +3119,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
back_to_taxonomies_list: "Back to Taxonomies List"
shipping_methods: "Shipping Methods"
shipping_method: "Shipping Method"
shipping_categories: "Shipping Categories"
new_shipping_category: "New Shipping Category"
@@ -3583,6 +3599,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
issue_text: |
If the above URL does not work try copying and pasting it into your browser.
If you continue to have problems please feel free to contact us.
subject: "Reset password instructions"
confirmation_instructions:
subject: "Please confirm your OFN account"
shipment_mailer:

View File

@@ -373,20 +373,21 @@ en_AU:
duplicate_code: "This code is used already."
bill_address: "Billing Address"
ship_address: "Shipping Address"
update_address_success: 'Address updated successfully.'
update_address_error: 'Sorry! Please input all of the required fields!'
edit_bill_address: 'Edit Billing Address'
edit_ship_address: 'Edit Shipping Address'
required_fileds: 'Required fields are denoted with an asterisk '
select_country: 'Select Country'
select_state: 'Select State'
edit: 'Edit'
update_address: 'Update Address'
confirm_delete: 'Sure to delete?'
balance: "Balance"
update_address_success: "Address updated successfully."
update_address_error: "Sorry! Please input all of the required fields!"
edit_bill_address: "Edit Billing Address"
edit_ship_address: "Edit Shipping Address"
required_fileds: "Required fields are denoted with an asterisk "
select_country: "Select Country"
select_state: "Select State"
edit: "Edit"
update_address: "Update Address"
confirm_delete: "Sure to delete?"
search_by_email: "Search by email/code..."
guest_label: 'Guest checkout'
guest_label: "Guest checkout"
destroy:
has_associated_orders: 'Delete failed: customer has associated orders with his shop'
has_associated_orders: "Delete failed: customer has associated orders with his shop"
contents:
edit:
title: Content
@@ -2315,8 +2316,9 @@ en_AU:
admin:
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
modals:
got_it: Got it
got_it: "Got it"
close: "Close"
continue: "Continue"
invite: "Invite"
invite_title: "Invite an unregistered user"
tag_rule_help:
@@ -2786,6 +2788,7 @@ en_AU:
new_taxonomy: "New Taxonomy"
back_to_taxonomies_list: "Back to Taxonomies List"
shipping_methods: "Shipping Methods"
shipping_method: "Shipping Method"
shipping_categories: "Shipping Categories"
new_shipping_category: "New Shipping Category"
back_to_shipping_categories: "Back To Shipping Categories"

View File

@@ -368,20 +368,21 @@ en_BE:
duplicate_code: "This code is used already."
bill_address: "Billing Address"
ship_address: "Shipping Address"
update_address_success: 'Address updated successfully.'
update_address_error: 'Sorry! Please input all of the required fields!'
edit_bill_address: 'Edit Billing Address'
edit_ship_address: 'Edit Shipping Address'
required_fileds: 'Required fields are denoted with an asterisk '
select_country: 'Select Country'
select_state: 'Select State'
edit: 'Edit'
update_address: 'Update Address'
confirm_delete: 'Sure to delete?'
balance: "Balance"
update_address_success: "Address updated successfully."
update_address_error: "Sorry! Please input all of the required fields!"
edit_bill_address: "Edit Billing Address"
edit_ship_address: "Edit Shipping Address"
required_fileds: "Required fields are denoted with an asterisk "
select_country: "Select Country"
select_state: "Select State"
edit: "Edit"
update_address: "Update Address"
confirm_delete: "Sure to delete?"
search_by_email: "Search by email/code..."
guest_label: 'Guest checkout'
guest_label: "Guest checkout"
destroy:
has_associated_orders: 'Delete failed: customer has associated orders with his shop'
has_associated_orders: "Delete failed: customer has associated orders with his shop"
contents:
edit:
title: Content
@@ -2275,8 +2276,9 @@ en_BE:
admin:
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
modals:
got_it: Got it
got_it: "Got it"
close: "Close"
continue: "Continue"
invite: "Invite"
invite_title: "Invite an unregistered user"
tag_rule_help:
@@ -2743,6 +2745,7 @@ en_BE:
new_taxonomy: "New Taxonomy"
back_to_taxonomies_list: "Back to Taxonomies List"
shipping_methods: "Shipping Methods"
shipping_method: "Shipping Method"
shipping_categories: "Shipping Categories"
new_shipping_category: "New Shipping Category"
back_to_shipping_categories: "Back To Shipping Categories"

View File

@@ -396,20 +396,22 @@ en_CA:
duplicate_code: "This code is used already."
bill_address: "Billing Address"
ship_address: "Shipping Address"
update_address_success: 'Address updated successfully.'
update_address_error: 'Sorry! Please input all of the required fields!'
edit_bill_address: 'Edit Billing Address'
edit_ship_address: 'Edit Shipping Address'
required_fileds: 'Required fields are denoted with an asterisk '
select_country: 'Select Country'
select_state: 'Select Province'
edit: 'Edit'
update_address: 'Update Address'
confirm_delete: 'Sure to delete?'
balance: "Balance"
update_address_success: "Address updated successfully."
update_address_error: "Sorry! Please input all of the required fields!"
edit_bill_address: "Edit Billing Address"
edit_ship_address: "Edit Shipping Address"
required_fileds: "Required fields are denoted with an asterisk "
select_country: "Select Country"
select_state: "Select Province"
edit: "Edit"
update_address: "Update Address"
confirm_delete: "Sure to delete?"
search_by_email: "Search by email/code..."
guest_label: 'Guest checkout'
guest_label: "Guest checkout"
credit_owed: "Credit Owed"
destroy:
has_associated_orders: 'Delete failed: customer has associated orders with his shop'
has_associated_orders: "Delete failed: customer has associated orders with his shop"
contents:
edit:
title: Content
@@ -1161,8 +1163,7 @@ en_CA:
cart: "cart"
message_html: "You have an order for this order cycle already. Check the %{cart} to see the items you ordered before. You can also cancel items as long as the order cycle is open."
terms_and_conditions:
message_html: "By placing this order you agree to the %{terms_and_conditions_link}."
link_text: "Terms of Service"
link_text: "Terms and Conditions"
failed: "The checkout failed. Please let us know so that we can process your order."
shops:
hubs:
@@ -2378,8 +2379,9 @@ en_CA:
admin:
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
modals:
got_it: Got it
got_it: "Got it"
close: "Close"
continue: "Continue"
invite: "Invite"
invite_title: "Invite an unregistered user"
tag_rule_help:
@@ -2947,6 +2949,7 @@ en_CA:
new_taxonomy: "New Taxonomy"
back_to_taxonomies_list: "Back to Taxonomies List"
shipping_methods: "Delivery/Pick-up Methods"
shipping_method: "Shipping Method"
shipping_categories: "Shipping Categories"
new_shipping_category: "New Shipping Category"
back_to_shipping_categories: "Back to Shipping Categories"

View File

@@ -373,20 +373,21 @@ en_DE:
duplicate_code: "This code is used already."
bill_address: "Billing Address"
ship_address: "Shipping Address"
update_address_success: 'Address updated successfully.'
update_address_error: 'Sorry! Please input all of the required fields!'
edit_bill_address: 'Edit Billing Address'
edit_ship_address: 'Edit Shipping Address'
required_fileds: 'Required fields are denoted with an asterisk '
select_country: 'Select Country'
select_state: 'Select State'
edit: 'Edit'
update_address: 'Update Address'
confirm_delete: 'Sure to delete?'
balance: "Balance"
update_address_success: "Address updated successfully."
update_address_error: "Sorry! Please input all of the required fields!"
edit_bill_address: "Edit Billing Address"
edit_ship_address: "Edit Shipping Address"
required_fileds: "Required fields are denoted with an asterisk "
select_country: "Select Country"
select_state: "Select State"
edit: "Edit"
update_address: "Update Address"
confirm_delete: "Sure to delete?"
search_by_email: "Search by email/code..."
guest_label: 'Guest checkout'
guest_label: "Guest checkout"
destroy:
has_associated_orders: 'Delete failed: customer has associated orders with his shop'
has_associated_orders: "Delete failed: customer has associated orders with his shop"
contents:
edit:
title: Content
@@ -2285,8 +2286,9 @@ en_DE:
admin:
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
modals:
got_it: Got it
got_it: "Got it"
close: "Close"
continue: "Continue"
invite: "Invite"
invite_title: "Invite an unregistered user"
tag_rule_help:
@@ -2756,6 +2758,7 @@ en_DE:
new_taxonomy: "New Taxonomy"
back_to_taxonomies_list: "Back to Taxonomies List"
shipping_methods: "Shipping Methods"
shipping_method: "Shipping Method"
shipping_categories: "Shipping Categories"
new_shipping_category: "New Shipping Category"
back_to_shipping_categories: "Back To Shipping Categories"

View File

@@ -351,6 +351,7 @@ en_FR:
has_n_rules: "has %{num} rules"
unsaved_confirm_leave: "There are unsaved changed on this page. Continue without saving?"
unsaved_changes: "You have unsaved changes"
available_units: "Available Units"
shopfront_settings:
embedded_shopfront_settings: "Embedded Shopfront Settings"
enable_embedded_shopfronts: "Enable Embedded Shopfronts"
@@ -396,20 +397,23 @@ en_FR:
duplicate_code: "This code is used already."
bill_address: "Billing Address"
ship_address: "Shipping Address"
update_address_success: 'Address updated successfully.'
update_address_error: 'Sorry! Please input all of the required fields!'
edit_bill_address: 'Edit Billing Address'
edit_ship_address: 'Edit Shipping Address'
required_fileds: 'Required fields are denoted with an asterisk '
select_country: 'Select Country'
select_state: 'Select State'
edit: 'Edit'
update_address: 'Update Address'
confirm_delete: 'Sure to delete?'
balance: "Balance"
update_address_success: "Address updated successfully."
update_address_error: "Sorry! Please input all of the required fields!"
edit_bill_address: "Edit Billing Address"
edit_ship_address: "Edit Shipping Address"
required_fileds: "Required fields are denoted with an asterisk "
select_country: "Select Country"
select_state: "Select State"
edit: "Edit"
update_address: "Update Address"
confirm_delete: "Sure to delete?"
search_by_email: "Search by email/code..."
guest_label: 'Guest checkout'
guest_label: "Guest checkout"
credit_owed: "Credit Owed"
balance_due: "Balance Due"
destroy:
has_associated_orders: 'Delete failed: customer has associated orders with his shop'
has_associated_orders: "Delete failed: customer has associated orders with his shop"
contents:
edit:
title: Content
@@ -1161,8 +1165,7 @@ en_FR:
cart: "cart"
message_html: "You have an order for this order cycle already. Check the %{cart} to see the items you ordered before. You can also cancel items as long as the order cycle is open."
terms_and_conditions:
message_html: "By placing this order you agree to the%{terms_and_conditions_link}."
link_text: "Terms of Service"
link_text: "Terms and Conditions"
failed: "The checkout failed. Please let us know so that we can process your order."
shops:
hubs:
@@ -1256,9 +1259,9 @@ en_FR:
menu_4_title: "Groups"
menu_4_url: "/groups"
menu_5_title: "Open my shop"
menu_5_url: "https://apropos.coopcircuits.fr/"
menu_5_url: "/sell"
menu_6_title: "About"
menu_6_url: "https://apropos.coopcircuits.fr/blog/"
menu_6_url: "https://apropos.coopcircuits.fr/"
menu_7_title: "Learn"
menu_7_url: "https://apropos.coopcircuits.fr/ressources/"
logo: "Logo (640x130)"
@@ -2378,8 +2381,9 @@ en_FR:
admin:
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
modals:
got_it: Got it
got_it: "Got it"
close: "Close"
continue: "Continue"
invite: "Invite"
invite_title: "Invite an unregistered user"
tag_rule_help:
@@ -2948,6 +2952,7 @@ en_FR:
new_taxonomy: "New Taxonomy"
back_to_taxonomies_list: "Back to Taxonomies List"
shipping_methods: "Shipping Methods"
shipping_method: "Shipping Method"
shipping_categories: "Shipping Categories"
new_shipping_category: "New Shipping Category"
back_to_shipping_categories: "Back To Shipping Categories"
@@ -3419,6 +3424,7 @@ en_FR:
issue_text: |
If the above URL does not work try copying and pasting it into your browser.
If you continue to have problems please feel free to contact us.
subject: "Reset password instructions"
confirmation_instructions:
subject: "Please confirm your OFN account"
shipment_mailer:

View File

@@ -393,20 +393,22 @@ en_GB:
duplicate_code: "This code is used already."
bill_address: "Billing Address"
ship_address: "Shipping Address"
update_address_success: 'Address updated successfully.'
update_address_error: 'Sorry! Please input all of the required fields!'
edit_bill_address: 'Edit Billing Address'
edit_ship_address: 'Edit Shipping Address'
required_fileds: 'Required fields are denoted with an asterisk'
select_country: 'Select Country'
select_state: 'Select County'
edit: 'Edit'
update_address: 'Update Address'
confirm_delete: 'Sure to delete?'
balance: "Balance"
update_address_success: "Address updated successfully."
update_address_error: "Sorry! Please input all of the required fields!"
edit_bill_address: "Edit Billing Address"
edit_ship_address: "Edit Shipping Address"
required_fileds: "Required fields are denoted with an asterisk"
select_country: "Select Country"
select_state: "Select County"
edit: "Edit"
update_address: "Update Address"
confirm_delete: "Sure to delete?"
search_by_email: "Search by email/code..."
guest_label: 'Guest checkout'
guest_label: "Guest checkout"
credit_owed: "Credit Owed"
destroy:
has_associated_orders: 'Delete failed: customer has associated orders with this shop'
has_associated_orders: "Delete failed: customer has associated orders with this shop"
contents:
edit:
title: Content
@@ -1158,8 +1160,7 @@ en_GB:
cart: "cart"
message_html: "You have an order for this order cycle already. Check the %{cart} to see the items you ordered before. You can also cancel items as long as the order cycle is open."
terms_and_conditions:
message_html: "By placing this order you agree to the %{terms_and_conditions_link}."
link_text: "Terms of Service"
link_text: "Terms and Conditions"
failed: "The checkout failed. Please let us know so that we can process your order."
shops:
hubs:
@@ -2374,8 +2375,9 @@ en_GB:
admin:
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
modals:
got_it: Got it
got_it: "Got it"
close: "Close"
continue: "Continue"
invite: "Invite"
invite_title: "Invite an unregistered user"
tag_rule_help:
@@ -2946,6 +2948,7 @@ en_GB:
new_taxonomy: "New Taxonomy"
back_to_taxonomies_list: "Back to Taxonomies List"
shipping_methods: "Shipping Methods"
shipping_method: "Shipping Method"
shipping_categories: "Shipping Categories"
new_shipping_category: "New Shipping Category"
back_to_shipping_categories: "Back To Shipping Categories"

View File

@@ -24,6 +24,9 @@ en_IE:
spree/credit_card:
base: "Credit Card"
number: "Number"
month: "Month"
verification_value: "Verification Value"
year: "Year"
order_cycle:
orders_close_at: Close date
variant_override:
@@ -122,6 +125,7 @@ en_IE:
not_array_error: "must be an array"
invalid_element_error: "must contain only valid integers"
datetime_picker_ui:
current_text: Now
close_text: Done
time_text: Time
enterprise_mailer:
@@ -231,6 +235,7 @@ en_IE:
enterprises: Enterprises
enterprise_groups: Groups
reports: Reports
listing_reports: Listing Reports
variant_overrides: Inventory
import: Import
spree_products: Spree Products
@@ -391,20 +396,22 @@ en_IE:
duplicate_code: "This code is used already."
bill_address: "Billing Address"
ship_address: "Shipping Address"
update_address_success: 'Address updated successfully.'
update_address_error: 'Sorry! Please input all of the required fields!'
edit_bill_address: 'Edit Billing Address'
edit_ship_address: 'Edit Shipping Address'
required_fileds: 'Required fields are denoted with an asterisk'
select_country: 'Select Country'
select_state: 'Select County'
edit: 'Edit'
update_address: 'Update Address'
confirm_delete: 'Sure to delete?'
balance: "Balance"
update_address_success: "Address updated successfully."
update_address_error: "Sorry! Please input all of the required fields!"
edit_bill_address: "Edit Billing Address"
edit_ship_address: "Edit Shipping Address"
required_fileds: "Required fields are denoted with an asterisk"
select_country: "Select Country"
select_state: "Select County"
edit: "Edit"
update_address: "Update Address"
confirm_delete: "Sure to delete?"
search_by_email: "Search by email/code..."
guest_label: 'Guest checkout'
guest_label: "Guest checkout"
credit_owed: "Credit Owed"
destroy:
has_associated_orders: 'Delete failed: customer has associated orders with this shop'
has_associated_orders: "Delete failed: customer has associated orders with this shop"
contents:
edit:
title: Content
@@ -600,6 +607,7 @@ en_IE:
order_date: "Completed at"
max: "Max"
product_unit: "Product: Unit"
weight_volume: "Weight/Volume (g)"
ask: "Ask?"
page_title: "Bulk Order Management"
actions_delete: "Delete Selected"
@@ -636,6 +644,8 @@ en_IE:
acn_placeholder: eg. 123 456 789
display_invoice_logo: Display logo in invoices
invoice_text: Add customized text at the end of invoices
terms_and_conditions: "Terms and Conditions"
remove_terms_and_conditions: "Remove File"
contact:
name: Name
name_placeholder: eg. Amanda Plum
@@ -726,6 +736,8 @@ en_IE:
enable_subscriptions_tip: "Enable subscriptions functionality?"
enable_subscriptions_false: "Disabled"
enable_subscriptions_true: "Enabled"
customer_names_in_reports: "Customer Names in Reports"
customer_names_tip: "Enable your suppliers to see your customers names in reports"
customer_names_false: "Disabled"
customer_names_true: "Enabled"
shopfront_message: "Shopfront Message"
@@ -1142,12 +1154,16 @@ en_IE:
destroy_attachment_does_not_exist: "Logo does not exist"
enterprise_promo_image:
destroy_attachment_does_not_exist: "Promo image does not exist"
enterprise_terms_and_conditions:
destroy_attachment_does_not_exist: "Terms and Conditions file does not exist"
orders:
failed_to_update: "Failed to update order"
checkout:
already_ordered:
cart: "cart"
message_html: "You have an order for this order cycle already. Check the %{cart} to see the items you ordered before. You can also cancel items as long as the order cycle is open."
terms_and_conditions:
link_text: "Terms and Conditions"
failed: "The checkout failed. Please let us know so that we can process your order."
shops:
hubs:
@@ -1377,9 +1393,9 @@ en_IE:
cookies_policy_link: "cookies policy"
cookies_accept_button: "Accept Cookies"
home_shop: Shop Now
brandstory_headline: "Growing Local Food Online"
brandstory_intro: "THE online community helping you to build a successful food enterprise"
brandstory_part1: "The Open Food Network software platform allows farmers to sell produce online, at a price that works for them. It has been built specifically for selling food so it can handle tricky measures or stock levels that only food has - a dozen eggs, a bunch of parsley, a whole chicken that varies in weight…"
brandstory_headline: "Powering a new food system"
brandstory_intro: "Our open source platform enables new, ethical supply chains. Food producers can sell online, wholesalers can manage buying groups and supply produce through networks of food hubs and shops. Communities can bring together producers to create a virtual farmers market, building a resilient local food economy."
brandstory_part1: "The Open Food Network software platform allows farmers and producers to sell at a price that works for them. It has been built specifically for selling food so it can handle tricky measures or stock levels that only food has - a dozen eggs, a bunch of parsley, a whole chicken that varies in weight…"
brandstory_part2: "Food Producers can create an online shop, collect payments, sell through other shops on the platform and access reduced-rate courier services."
brandstory_part3: "Wholesalers can integrate OFN with their existing systems and manage buying groups to  supply customers with their produce through our national network of food hubs and shops."
brandstory_part4: "Communities can bring together producers in their local area to create virtual farmers markets, building a resilient local food economy."
@@ -1986,6 +2002,7 @@ en_IE:
calculator: "Calculator"
calculator_values: "Calculator values"
calculator_settings_warning: "If you are changing the calculator type, you must save first before you can edit the calculator settings"
calculator_preferred_unit_error: "must be kg or lb"
flat_percent_per_item: "Flat Percent (per item)"
flat_rate_per_item: "Flat Rate (per item)"
flat_rate_per_order: "Flat Rate (per order)"
@@ -2295,6 +2312,7 @@ en_IE:
enterprise_name_error: "has already been taken. If this is your enterprise and you would like to claim ownership, or if you would like to trade with this enterprise please contact the current manager of this profile at %{email}."
enterprise_owner_error: "^%{email} is not permitted to own any more enterprises (limit is %{enterprise_limit})."
enterprise_role_uniqueness_error: "^That role is already present."
enterprise_terms_and_conditions_type_error: "Only PDFs are allowed"
inventory_item_visibility_error: must be true or false
product_importer_file_error: "error: no file uploaded"
product_importer_spreadsheet_error: "could not process file: invalid filetype"
@@ -2361,8 +2379,9 @@ en_IE:
admin:
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
modals:
got_it: Got it
got_it: "Got it"
close: "Close"
continue: "Continue"
invite: "Invite"
invite_title: "Invite an unregistered user"
tag_rule_help:
@@ -2579,6 +2598,8 @@ en_IE:
immediate_logo_removal_warning: "The logo will be removed immediately after you confirm."
removed_promo_image_successfully: "Promo image removed successfully"
immediate_promo_image_removal_warning: "The promo image will be removed immediately after you confirm."
immediate_terms_and_conditions_removal_warning: "The Terms and Conditions file will be removed immediately after you confirm."
removed_terms_and_conditions_successfully: "Terms and Conditions file removed successfully"
insufficient_stock: "Insufficient stock available, only %{on_hand} remaining"
out_of_stock:
reduced_stock_available: Reduced stock available
@@ -2590,8 +2611,12 @@ en_IE:
shopfront:
variant:
add_to_cart: "Add"
in_cart: "in cart"
quantity_in_cart: "%{quantity} in cart"
bulk_buy_modal:
min_quantity: "Min quantity"
max_quantity: "Max quantity"
price_breakdown: "Price breakdown"
variants:
on_demand:
'yes': "Unlimited"
@@ -2657,6 +2682,11 @@ en_IE:
signup_or_login: "Start By signing up (or logging in)"
have_an_account: "Already have an account?"
action_login: "Log in now."
stripe_elements:
unknown_error_from_stripe: |
There was a problem setting up your card in our payments gateway.
Please refresh the page and try again, if it fails a second time,
please contact us for support.
inflections:
each:
one: "each"
@@ -2787,6 +2817,8 @@ en_IE:
adjustments: "Adjustments"
payments: "Payments"
return_authorizations: "Return Authorisations"
credit_owed: "Credit Owed"
new_adjustment: "New Adjustment"
payment: "Payment"
payment_method: "Payment Method"
shipment: "Shipment"
@@ -2924,6 +2956,7 @@ en_IE:
new_taxonomy: "New Taxonomy"
back_to_taxonomies_list: "Back to Taxonomies List"
shipping_methods: "Shipping Methods"
shipping_method: "Shipping Method"
shipping_categories: "Shipping Categories"
new_shipping_category: "New Shipping Category"
back_to_shipping_categories: "Back To Shipping Categories"
@@ -2965,13 +2998,18 @@ en_IE:
inventory_error_flash_for_insufficient_quantity: "An item in your cart has become unavailable."
inventory: Inventory
zipcode: Postcode
weight: Weight (per kg or lb)
error_user_destroy_with_orders: "Users with completed orders may not be deleted"
cannot_create_payment_without_payment_methods: "You cannot create a payment for an order without any payment methods defined."
please_define_payment_methods: "Please define some payment methods first."
options: "Options"
has_no_shipped_units: "has no shipped units"
successfully_created: '%{resource} has been successfully created!'
successfully_updated: '%{resource} has been successfully updated!'
payment_processing_failed: "Payment could not be processed, please check the details you entered"
not_available: "N/A"
order_populator:
out_of_stock: '%{item} is out of stock.'
actions:
update: "Update"
shared:
@@ -2981,6 +3019,7 @@ en_IE:
other: "%{count} errors prohibited this record from being saved:"
there_were_problems_with_the_following_fields: "There were problems with the following fields"
payments_list:
date_time: "Date/time"
amount: "Amount"
payment_method: "Payment Method"
payment_state: "Payment County"
@@ -3253,6 +3292,8 @@ en_IE:
bulk_coop_allocation: 'Bulk Co-op - Allocation'
bulk_coop_packing_sheets: 'Bulk Co-op - Packing Sheets'
bulk_coop_customer_payments: 'Bulk Co-op - Customer Payments'
customer_names_message:
customer_names_tip: "If customer names are hidden for orders you have supplied, you can contact the distributor and ask if they can update their shop preferences to allow their suppliers to view customer names."
users:
index:
listing_users: "Listing Users"
@@ -3387,6 +3428,7 @@ en_IE:
issue_text: |
If the above URL does not work try copying and pasting it into your browser.
If you continue to have problems please feel free to contact us.
subject: "Reset password instructions"
confirmation_instructions:
subject: "Please confirm your OFN account"
shipment_mailer:
@@ -3485,3 +3527,8 @@ en_IE:
shipment:
cannot_ready: "Cannot ready shipment."
invalid_taxonomy_id: "Invalid taxonomy id."
activerecord:
models:
spree/payment:
one: Payment
other: Payments

View File

@@ -387,20 +387,21 @@ en_IN:
duplicate_code: "This code is used already."
bill_address: "Billing Address"
ship_address: "Shipping Address"
update_address_success: 'Address updated successfully.'
update_address_error: 'Sorry! Please input all of the required fields!'
edit_bill_address: 'Edit Billing Address'
edit_ship_address: 'Edit Shipping Address'
required_fileds: 'Required fields are denoted with an asterisk'
select_country: 'Select Country'
select_state: 'Select State'
edit: 'Edit'
update_address: 'Update Address'
confirm_delete: 'Sure to delete?'
balance: "Balance"
update_address_success: "Address updated successfully."
update_address_error: "Sorry! Please input all of the required fields!"
edit_bill_address: "Edit Billing Address"
edit_ship_address: "Edit Shipping Address"
required_fileds: "Required fields are denoted with an asterisk"
select_country: "Select Country"
select_state: "Select State"
edit: "Edit"
update_address: "Update Address"
confirm_delete: "Sure to delete?"
search_by_email: "Search by email/code..."
guest_label: 'Guest checkout'
guest_label: "Guest checkout"
destroy:
has_associated_orders: 'Delete failed: customer has associated orders with this shop'
has_associated_orders: "Delete failed: customer has associated orders with this shop"
contents:
edit:
title: Content
@@ -2355,8 +2356,9 @@ en_IN:
admin:
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
modals:
got_it: Got it
got_it: "Got it"
close: "Close"
continue: "Continue"
invite: "Invite"
invite_title: "Invite an unregistered user"
tag_rule_help:
@@ -2918,6 +2920,7 @@ en_IN:
new_taxonomy: "New Taxonomy"
back_to_taxonomies_list: "Back to Taxonomies List"
shipping_methods: "Shipping Methods"
shipping_method: "Shipping Method"
shipping_categories: "Shipping Categories"
new_shipping_category: "New Shipping Category"
back_to_shipping_categories: "Back To Shipping Categories"

View File

@@ -393,20 +393,22 @@ en_NZ:
duplicate_code: "This code is used already."
bill_address: "Billing Address"
ship_address: "Shipping Address"
update_address_success: 'Address updated successfully.'
update_address_error: 'Sorry! Please input all of the required fields!'
edit_bill_address: 'Edit Billing Address'
edit_ship_address: 'Edit Shipping Address'
required_fileds: 'Required fields are denoted with an asterisk '
select_country: 'Select Country'
select_state: 'Select State'
edit: 'Edit'
update_address: 'Update Address'
confirm_delete: 'Sure to delete?'
balance: "Balance"
update_address_success: "Address updated successfully."
update_address_error: "Sorry! Please input all of the required fields!"
edit_bill_address: "Edit Billing Address"
edit_ship_address: "Edit Shipping Address"
required_fileds: "Required fields are denoted with an asterisk "
select_country: "Select Country"
select_state: "Select State"
edit: "Edit"
update_address: "Update Address"
confirm_delete: "Sure to delete?"
search_by_email: "Search by email/code..."
guest_label: 'Guest checkout'
guest_label: "Guest checkout"
credit_owed: "Credit Owed"
destroy:
has_associated_orders: 'Delete failed: customer has associated orders with his shop'
has_associated_orders: "Delete failed: customer has associated orders with his shop"
contents:
edit:
title: Content
@@ -1158,8 +1160,7 @@ en_NZ:
cart: "cart"
message_html: "You have an order for this order cycle already. Check the %{cart} to see the items you ordered before. You can also cancel items as long as the order cycle is open."
terms_and_conditions:
message_html: "By placing this order you agree to the %{terms_and_conditions_link}."
link_text: "Terms of Service"
link_text: "Terms and Conditions"
failed: "The checkout failed. Please let us know so that we can process your order."
shops:
hubs:
@@ -2374,8 +2375,9 @@ en_NZ:
admin:
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
modals:
got_it: Got it
got_it: "Got it"
close: "Close"
continue: "Continue"
invite: "Invite"
invite_title: "Invite an unregistered user"
tag_rule_help:
@@ -2940,6 +2942,7 @@ en_NZ:
new_taxonomy: "New Taxonomy"
back_to_taxonomies_list: "Back to Taxonomies List"
shipping_methods: "Shipping Methods"
shipping_method: "Shipping Method"
shipping_categories: "Shipping Categories"
new_shipping_category: "New Shipping Category"
back_to_shipping_categories: "Back To Shipping Categories"

View File

@@ -381,20 +381,21 @@ en_PH:
duplicate_code: "This code is used already."
bill_address: "Billing Address"
ship_address: "Shipping Address"
update_address_success: 'Address updated successfully.'
update_address_error: 'Sorry! Please input all of the required fields!'
edit_bill_address: 'Edit Billing Address'
edit_ship_address: 'Edit Shipping Address'
required_fileds: 'Required fields are denoted with an asterisk '
select_country: 'Select Country'
select_state: 'Select Province'
edit: 'Edit'
update_address: 'Update Address'
confirm_delete: 'Sure to delete?'
balance: "Balance"
update_address_success: "Address updated successfully."
update_address_error: "Sorry! Please input all of the required fields!"
edit_bill_address: "Edit Billing Address"
edit_ship_address: "Edit Shipping Address"
required_fileds: "Required fields are denoted with an asterisk "
select_country: "Select Country"
select_state: "Select Province"
edit: "Edit"
update_address: "Update Address"
confirm_delete: "Sure to delete?"
search_by_email: "Search by email/code..."
guest_label: 'Guest checkout'
guest_label: "Guest checkout"
destroy:
has_associated_orders: 'Delete failed: customer has associated orders with his shop'
has_associated_orders: "Delete failed: customer has associated orders with his shop"
contents:
edit:
title: Content
@@ -2322,8 +2323,9 @@ en_PH:
admin:
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
modals:
got_it: Got it
got_it: "Got it"
close: "Close"
continue: "Continue"
invite: "Invite"
invite_title: "Invite an unregistered user"
tag_rule_help:
@@ -2873,6 +2875,7 @@ en_PH:
new_taxonomy: "New Category"
back_to_taxonomies_list: "Back to Taxonomies List"
shipping_methods: "Shipping Methods"
shipping_method: "Shipping Method"
shipping_categories: "Shipping Categories"
new_shipping_category: "New Shipping Category"
back_to_shipping_categories: "Back To Shipping Categories"

View File

@@ -393,20 +393,22 @@ en_US:
duplicate_code: "This code is used already."
bill_address: "Billing Address"
ship_address: "Shipping Address"
update_address_success: 'Address updated successfully.'
update_address_error: 'Sorry! Please input all of the required fields!'
edit_bill_address: 'Edit Billing Address'
edit_ship_address: 'Edit Shipping Address'
required_fileds: 'Required fields are denoted with an asterisk '
select_country: 'Select Country'
select_state: 'Select State'
edit: 'Edit'
update_address: 'Update Address'
confirm_delete: 'Sure to delete?'
balance: "Balance"
update_address_success: "Address updated successfully."
update_address_error: "Sorry! Please input all of the required fields!"
edit_bill_address: "Edit Billing Address"
edit_ship_address: "Edit Shipping Address"
required_fileds: "Required fields are denoted with an asterisk "
select_country: "Select Country"
select_state: "Select State"
edit: "Edit"
update_address: "Update Address"
confirm_delete: "Sure to delete?"
search_by_email: "Search by email/code..."
guest_label: 'Guest checkout'
guest_label: "Guest checkout"
credit_owed: "Credit Owed"
destroy:
has_associated_orders: 'Delete failed: customer has associated orders with his shop'
has_associated_orders: "Delete failed: customer has associated orders with his shop"
contents:
edit:
title: Content
@@ -1158,8 +1160,7 @@ en_US:
cart: "cart"
message_html: "You have an order for this order cycle already. Check the %{cart} to see the items you ordered before. You can also cancel items as long as the order cycle is open."
terms_and_conditions:
message_html: "By placing this order you agree to the %{terms_and_conditions_link}."
link_text: "Terms of Service"
link_text: "Terms and Conditions"
failed: "The checkout failed. Please let us know so that we can process your order."
shops:
hubs:
@@ -2375,8 +2376,9 @@ en_US:
admin:
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
modals:
got_it: Got it
got_it: "Got it"
close: "Close"
continue: "Continue"
invite: "Invite"
invite_title: "Invite an unregistered user"
tag_rule_help:
@@ -2941,6 +2943,7 @@ en_US:
new_taxonomy: "New Taxonomy"
back_to_taxonomies_list: "Back to Taxonomies List"
shipping_methods: "Shipping Methods"
shipping_method: "Shipping Method"
shipping_categories: "Shipping Categories"
new_shipping_category: "New Shipping Category"
back_to_shipping_categories: "Back To Shipping Categories"

Some files were not shown because too many files have changed in this diff Show More