mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-12 18:36:49 +00:00
Compare commits
108 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5b37a5171 | ||
|
|
3efe2f878d | ||
|
|
064fee79b3 | ||
|
|
d13f182801 | ||
|
|
ee34935223 | ||
|
|
0b7ce0d6db | ||
|
|
9dd02044a5 | ||
|
|
d8a7190f43 | ||
|
|
e5e0fcc887 | ||
|
|
6635a89af7 | ||
|
|
8c95399292 | ||
|
|
14c1abb861 | ||
|
|
be844253eb | ||
|
|
b4ffd4dcc2 | ||
|
|
9eabbb8dab | ||
|
|
d4f2fcb98a | ||
|
|
0b2417849c | ||
|
|
3e8369c8f5 | ||
|
|
cbaedcec92 | ||
|
|
0284eebf35 | ||
|
|
e4ba515109 | ||
|
|
af1f6f6c6d | ||
|
|
b0e8ee42c1 | ||
|
|
86aeb6a3c7 | ||
|
|
9820d7de38 | ||
|
|
910eca810a | ||
|
|
6feaddf747 | ||
|
|
10f6fb91f6 | ||
|
|
c7bd4b94b8 | ||
|
|
dd223a21f2 | ||
|
|
549366ff15 | ||
|
|
e92f60fb1c | ||
|
|
92b05c76a3 | ||
|
|
fa6fa0be64 | ||
|
|
752efac7cf | ||
|
|
2b1f1f748b | ||
|
|
798cd9e778 | ||
|
|
de2d4a5870 | ||
|
|
d3d6921a0f | ||
|
|
68393f1444 | ||
|
|
229e6fa0a3 | ||
|
|
8a069787d1 | ||
|
|
29ed38a6cc | ||
|
|
4c7d3a491a | ||
|
|
b0f90cf43c | ||
|
|
02ec0634b3 | ||
|
|
64d21969f0 | ||
|
|
0995adeb59 | ||
|
|
073a3fe2b4 | ||
|
|
c07df6a5a6 | ||
|
|
a7d109833d | ||
|
|
0364a14073 | ||
|
|
ddc8d33356 | ||
|
|
cd81dfaead | ||
|
|
25073ada84 | ||
|
|
15b6f9dd5e | ||
|
|
0377e02dc1 | ||
|
|
f679708a4e | ||
|
|
0f748a3333 | ||
|
|
bdedaa06d8 | ||
|
|
6a41d9be87 | ||
|
|
a3af6617a9 | ||
|
|
9f7fb654c8 | ||
|
|
b4a6686eac | ||
|
|
ac13ff114c | ||
|
|
af9187947f | ||
|
|
f0fdbf7cf4 | ||
|
|
74ab31c0e6 | ||
|
|
9400516b56 | ||
|
|
6ebfb02d0e | ||
|
|
11a77043eb | ||
|
|
58b43c7bc9 | ||
|
|
be41271038 | ||
|
|
04e13e1136 | ||
|
|
8868b7eb12 | ||
|
|
c85d00fcb8 | ||
|
|
2c6dab9c85 | ||
|
|
c45194473b | ||
|
|
3c0e6eeee2 | ||
|
|
ca5a5bf301 | ||
|
|
8c7a7348f4 | ||
|
|
3c2b6f4ed1 | ||
|
|
aae5ae9f1e | ||
|
|
888e0e0bb4 | ||
|
|
a0b0fb05a6 | ||
|
|
ffb8edef0b | ||
|
|
7a8b5e89be | ||
|
|
90690cd238 | ||
|
|
90c621ac07 | ||
|
|
2d5eccbf97 | ||
|
|
7e6259da31 | ||
|
|
5739a82c19 | ||
|
|
3d6fd10e59 | ||
|
|
81482683cf | ||
|
|
57f1742f24 | ||
|
|
3b467dbae8 | ||
|
|
306390440a | ||
|
|
267131626e | ||
|
|
02099ebdae | ||
|
|
d153e58933 | ||
|
|
c2a59a374c | ||
|
|
2a1011921b | ||
|
|
df27ee0d3e | ||
|
|
c2851015ce | ||
|
|
d0c246c345 | ||
|
|
6aed9ba549 | ||
|
|
4f2bc33ec3 | ||
|
|
0f3404ca27 |
@@ -123,14 +123,11 @@ Metrics/LineLength:
|
||||
- app/serializers/api/admin/subscription_serializer.rb
|
||||
- app/serializers/api/admin/tag_rule_serializer.rb
|
||||
- app/serializers/api/admin/variant_override_serializer.rb
|
||||
- app/serializers/api/admin/variant_serializer.rb
|
||||
- app/services/cart_service.rb
|
||||
- app/services/default_stock_location.rb
|
||||
- app/services/embedded_page_service.rb
|
||||
- app/services/line_item_syncer.rb
|
||||
- app/services/order_cycle_form.rb
|
||||
- app/services/order_factory.rb
|
||||
- app/services/order_syncer.rb
|
||||
- app/services/subscriptions_count.rb
|
||||
- app/services/variants_stock_levels.rb
|
||||
- app/views/json/_groups.rabl
|
||||
@@ -157,7 +154,6 @@ Metrics/LineLength:
|
||||
- lib/open_food_network/permalink_generator.rb
|
||||
- lib/open_food_network/products_cache.rb
|
||||
- lib/open_food_network/products_renderer.rb
|
||||
- lib/open_food_network/proxy_order_syncer.rb
|
||||
- lib/open_food_network/reports/bulk_coop_allocation_report.rb
|
||||
- lib/open_food_network/reports/line_items.rb
|
||||
- lib/open_food_network/sales_tax_report.rb
|
||||
@@ -344,10 +340,8 @@ Metrics/LineLength:
|
||||
- spec/models/tag_rule/filter_shipping_methods_spec.rb
|
||||
- spec/models/variant_override_spec.rb
|
||||
- spec/performance/orders_controller_spec.rb
|
||||
- spec/performance/proxy_order_syncer_spec.rb
|
||||
- spec/performance/shop_controller_spec.rb
|
||||
- spec/requests/checkout/failed_checkout_spec.rb
|
||||
- spec/requests/checkout/paypal_spec.rb
|
||||
- spec/requests/checkout/stripe_connect_spec.rb
|
||||
- spec/requests/embedded_shopfronts_headers_spec.rb
|
||||
- spec/requests/shop_spec.rb
|
||||
|
||||
@@ -42,6 +42,6 @@ $ docker-compose up
|
||||
```
|
||||
|
||||
This command will setup the database and seed it with sample data. The default admin user is 'ofn@example.com' with 'ofn123' password.
|
||||
Check the app in the browser at `http:://localhost:3000`.
|
||||
Check the app in the browser at `http://localhost:3000`.
|
||||
|
||||
You will then get the trace of the containers in the terminal. You can stop the containers using Ctrl-C in the terminal.
|
||||
|
||||
6
Gemfile
6
Gemfile
@@ -37,7 +37,7 @@ gem 'stripe'
|
||||
gem 'activemerchant', '~> 1.78'
|
||||
|
||||
gem 'devise', '~> 2.2.5'
|
||||
gem 'devise-encryptable', '0.1.2'
|
||||
gem 'devise-encryptable', '0.2.0'
|
||||
gem 'jwt', '~> 2.2'
|
||||
gem 'oauth2', '~> 1.4.1' # Used for Stripe Connect
|
||||
|
||||
@@ -119,6 +119,10 @@ gem 'jquery-rails', '3.0.4'
|
||||
|
||||
gem 'ofn-qz', github: 'openfoodfoundation/ofn-qz', ref: '60da2ae4c44cbb4c8d602f59fb5fff8d0f21db3c'
|
||||
|
||||
group :production, :staging do
|
||||
gem 'ddtrace'
|
||||
end
|
||||
|
||||
group :test, :development do
|
||||
# Pretty printed test output
|
||||
gem 'atomic'
|
||||
|
||||
16
Gemfile.lock
16
Gemfile.lock
@@ -223,6 +223,8 @@ GEM
|
||||
activerecord (>= 3.2.0, < 5.0)
|
||||
fog (~> 1.0)
|
||||
rails (>= 3.2.0, < 5.0)
|
||||
ddtrace (0.26.0)
|
||||
msgpack
|
||||
debugger-linecache (1.2.0)
|
||||
deface (1.0.2)
|
||||
colorize (>= 0.5.8)
|
||||
@@ -244,7 +246,7 @@ GEM
|
||||
orm_adapter (~> 0.1)
|
||||
railties (~> 3.1)
|
||||
warden (~> 1.2.1)
|
||||
devise-encryptable (0.1.2)
|
||||
devise-encryptable (0.2.0)
|
||||
devise (>= 2.1.0)
|
||||
diff-lcs (1.3)
|
||||
diffy (3.3.0)
|
||||
@@ -454,7 +456,7 @@ GEM
|
||||
rspec (>= 2.99.0, < 4.0)
|
||||
haml (4.0.7)
|
||||
tilt
|
||||
hashdiff (0.4.0)
|
||||
hashdiff (1.0.0)
|
||||
highline (1.6.18)
|
||||
hike (1.2.3)
|
||||
http_parser.rb (0.6.0)
|
||||
@@ -505,6 +507,7 @@ GEM
|
||||
railties (>= 3.1)
|
||||
money (5.1.1)
|
||||
i18n (~> 0.6.0)
|
||||
msgpack (1.3.1)
|
||||
multi_json (1.13.1)
|
||||
multi_xml (0.6.0)
|
||||
multipart-post (2.1.1)
|
||||
@@ -555,7 +558,7 @@ GEM
|
||||
pry-byebug (3.4.3)
|
||||
byebug (>= 9.0, < 9.1)
|
||||
pry (~> 0.10)
|
||||
public_suffix (3.0.3)
|
||||
public_suffix (3.1.1)
|
||||
rabl (0.8.4)
|
||||
activesupport (>= 2.3.14)
|
||||
rack (1.4.7)
|
||||
@@ -591,7 +594,7 @@ GEM
|
||||
thor (>= 0.14.6, < 2.0)
|
||||
rainbow (3.0.0)
|
||||
raindrops (0.19.0)
|
||||
rake (12.3.2)
|
||||
rake (12.3.3)
|
||||
ransack (0.7.2)
|
||||
actionpack (~> 3.0)
|
||||
activerecord (~> 3.0)
|
||||
@@ -736,7 +739,7 @@ GEM
|
||||
nokogiri (~> 1.6)
|
||||
rubyzip (~> 1.0)
|
||||
selenium-webdriver (~> 3.0)
|
||||
webmock (3.6.0)
|
||||
webmock (3.6.2)
|
||||
addressable (>= 2.3.6)
|
||||
crack (>= 0.3.2)
|
||||
hashdiff (>= 0.4.0, < 2.0.0)
|
||||
@@ -775,12 +778,13 @@ DEPENDENCIES
|
||||
dalli
|
||||
database_cleaner (= 0.7.1)
|
||||
db2fog
|
||||
ddtrace
|
||||
debugger-linecache
|
||||
deface (= 1.0.2)
|
||||
delayed_job_active_record
|
||||
delayed_job_web
|
||||
devise (~> 2.2.5)
|
||||
devise-encryptable (= 0.1.2)
|
||||
devise-encryptable (= 0.2.0)
|
||||
diffy
|
||||
eventmachine (>= 1.2.3)
|
||||
factory_bot_rails
|
||||
|
||||
@@ -27,8 +27,6 @@ angular.module("admin.utils").directive "variantAutocomplete", ($timeout) ->
|
||||
window.variants = data # this is how spree auto complete JS code picks up variants
|
||||
results: data
|
||||
formatResult: (variant) ->
|
||||
if variant["images"][0] != undefined && variant["images"][0].image != undefined
|
||||
variant.image = variant.images[0].image.mini_url
|
||||
variantTemplate variant: variant
|
||||
formatSelection: (variant) ->
|
||||
element.parent().children(".options_placeholder").html variant.options_text
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
Darkswarm.directive "cart", ->
|
||||
# Toggles visibility of the "cart" popover
|
||||
restrict: 'A'
|
||||
link: (scope, elem, attr)->
|
||||
scope.open = false
|
||||
elem.bind 'click', ->
|
||||
scope.$apply ->
|
||||
scope.open = !scope.open
|
||||
@@ -0,0 +1,19 @@
|
||||
Darkswarm.directive "cartToggle", ($document) ->
|
||||
# Toggles visibility of the "cart" popover
|
||||
restrict: 'A'
|
||||
link: (scope, elem, attr)->
|
||||
scope.open = false
|
||||
|
||||
$document.bind 'click', (event) ->
|
||||
cart_button = elem[0]
|
||||
element_and_parents = [event.target, event.target.parentElement, event.target.parentElement.parentElement]
|
||||
cart_button_clicked = (element_and_parents.indexOf(cart_button) != -1)
|
||||
|
||||
if cart_button_clicked
|
||||
scope.$apply ->
|
||||
scope.open = !scope.open
|
||||
else
|
||||
scope.$apply ->
|
||||
scope.open = false
|
||||
|
||||
return
|
||||
@@ -0,0 +1,11 @@
|
||||
.add-line-item {
|
||||
fieldset {
|
||||
.vertical-align-top {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.actions {
|
||||
padding-top: 18px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,5 +35,6 @@ $med-grey: #666;
|
||||
$med-drk-grey: #444;
|
||||
$dark-grey: #333;
|
||||
$light-grey: #ddd;
|
||||
$light-grey-transparency: rgba(0, 0, 0, .1);
|
||||
$black: #000;
|
||||
$white: #fff;
|
||||
|
||||
@@ -42,7 +42,7 @@ nav.top-bar {
|
||||
}
|
||||
|
||||
.top-bar-section {
|
||||
border-bottom: 1px solid $ofn-grey;
|
||||
border-bottom: 1px solid $light-grey-transparency;
|
||||
|
||||
a.icon {
|
||||
&:hover {
|
||||
@@ -170,9 +170,10 @@ nav.top-bar {
|
||||
|
||||
.tab-bar {
|
||||
background-color: white;
|
||||
border-bottom: 1px solid $light-grey-transparency;
|
||||
height: 2.8em;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 2.8em;
|
||||
z-index: 1;
|
||||
|
||||
.cart-span {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
@import "mixins";
|
||||
@import "branding";
|
||||
@import "compass/css3/user-interface";
|
||||
@import 'variables';
|
||||
|
||||
.cart {
|
||||
@include user-select(none);
|
||||
@@ -15,8 +16,8 @@
|
||||
|
||||
.joyride-tip-guide {
|
||||
display: block;
|
||||
right: 10px;
|
||||
top: 55px;
|
||||
right: 0;
|
||||
top: $topbar-height;
|
||||
width: 480px;
|
||||
|
||||
@media screen and (min-width: 641px) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
require 'open_food_network/permissions'
|
||||
require 'open_food_network/proxy_order_syncer'
|
||||
|
||||
module Admin
|
||||
class SubscriptionsController < ResourceController
|
||||
@@ -32,21 +33,11 @@ module Admin
|
||||
end
|
||||
|
||||
def create
|
||||
form = SubscriptionForm.new(@subscription, params[:subscription])
|
||||
if form.save
|
||||
render_as_json @subscription
|
||||
else
|
||||
render json: { errors: form.json_errors }, status: :unprocessable_entity
|
||||
end
|
||||
save_form_and_render(false)
|
||||
end
|
||||
|
||||
def update
|
||||
form = SubscriptionForm.new(@subscription, params[:subscription])
|
||||
if form.save
|
||||
render_as_json @subscription, order_update_issues: form.order_update_issues
|
||||
else
|
||||
render json: { errors: form.json_errors }, status: :unprocessable_entity
|
||||
end
|
||||
save_form_and_render
|
||||
end
|
||||
|
||||
def cancel
|
||||
@@ -67,12 +58,26 @@ module Admin
|
||||
end
|
||||
|
||||
def unpause
|
||||
@subscription.update_attributes(paused_at: nil)
|
||||
render_as_json @subscription
|
||||
params[:subscription][:paused_at] = nil
|
||||
save_form_and_render
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def save_form_and_render(render_issues = true)
|
||||
form = SubscriptionForm.new(@subscription, params[:subscription])
|
||||
unless form.save
|
||||
render json: { errors: form.json_errors }, status: :unprocessable_entity
|
||||
return
|
||||
end
|
||||
|
||||
if render_issues
|
||||
render_as_json @subscription, order_update_issues: form.order_update_issues
|
||||
else
|
||||
render_as_json @subscription
|
||||
end
|
||||
end
|
||||
|
||||
def permissions
|
||||
return @permissions unless @permissions.nil?
|
||||
@permissions = OpenFoodNetwork::Permissions.new(spree_current_user)
|
||||
|
||||
@@ -9,8 +9,8 @@ module Admin
|
||||
def map_by_tag
|
||||
respond_to do |format|
|
||||
format.json do
|
||||
serialiser = ActiveModel::ArraySerializer.new(collection)
|
||||
render json: serialiser.to_json
|
||||
serializer = ActiveModel::ArraySerializer.new(collection)
|
||||
render json: serializer.to_json
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module Api
|
||||
class ProductImagesController < Spree::Api::BaseController
|
||||
class ProductImagesController < BaseController
|
||||
respond_to :json
|
||||
|
||||
def update_product_image
|
||||
@@ -8,11 +8,11 @@ module Api
|
||||
|
||||
if @product.images.first.nil?
|
||||
@image = Spree::Image.create(attachment: params[:file], viewable_id: @product.master.id, viewable_type: 'Spree::Variant')
|
||||
respond_with(@image, status: 201)
|
||||
render json: @image, serializer: ImageSerializer, status: :created
|
||||
else
|
||||
@image = @product.images.first
|
||||
@image.update_attributes(attachment: params[:file])
|
||||
respond_with(@image, status: 200)
|
||||
render json: @image, serializer: ImageSerializer, status: :ok
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -27,12 +27,12 @@ class ShopController < BaseController
|
||||
if oc = OrderCycle.with_distributor(@distributor).active.find_by_id(params[:order_cycle_id])
|
||||
current_order(true).set_order_cycle! oc
|
||||
@current_order_cycle = oc
|
||||
render partial: "json/order_cycle"
|
||||
render json: @current_order_cycle, serializer: Api::OrderCycleSerializer
|
||||
else
|
||||
render status: :not_found, json: ""
|
||||
end
|
||||
else
|
||||
render partial: "json/order_cycle"
|
||||
render json: current_order_cycle, serializer: Api::OrderCycleSerializer
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ Spree::Admin::BaseController.class_eval do
|
||||
|
||||
def active_distributors_not_ready_for_checkout
|
||||
ocs = OrderCycle.managed_by(spree_current_user).active
|
||||
distributors = ocs.map(&:distributors).flatten.uniq
|
||||
distributors = ocs.includes(:distributors).map(&:distributors).flatten.uniq
|
||||
Enterprise.where('enterprises.id IN (?)', distributors).not_ready_for_checkout
|
||||
end
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ Spree::Admin::VariantsController.class_eval do
|
||||
def search
|
||||
scoper = OpenFoodNetwork::ScopeVariantsForSearch.new(params)
|
||||
@variants = scoper.search
|
||||
render json: @variants, each_serializer: Api::Admin::VariantSerializer
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
||||
@@ -61,6 +61,12 @@ module InjectionHelper
|
||||
inject_json_ams "currentOrder", current_order, Api::CurrentOrderSerializer, current_distributor: current_distributor, current_order_cycle: current_order_cycle
|
||||
end
|
||||
|
||||
def inject_current_order_cycle
|
||||
serializer = Api::OrderCycleSerializer.new(current_order_cycle)
|
||||
json = serializer.object.present? ? serializer.to_json : "{}"
|
||||
render partial: "json/injection_ams", locals: { name: "orderCycleData", json: json }
|
||||
end
|
||||
|
||||
def inject_available_shipping_methods
|
||||
inject_json_ams "shippingMethods", available_shipping_methods,
|
||||
Api::ShippingMethodSerializer, current_order: current_order
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
/replace 'code[erb-loud]:contains("form_for @payment")'
|
||||
= form_for @payment, :url => admin_order_payments_path(@order), :html => {"ng-app" => "admin.payments", "ng-controller" => "PaymentCtrl"} do |f|
|
||||
@@ -1,3 +0,0 @@
|
||||
/ insert_before "fieldset.no-border-top"
|
||||
|
||||
%save-bar{ persist: "true" }
|
||||
@@ -1,2 +0,0 @@
|
||||
/replace 'code[erb-loud]:contains("button @order.cart?")'
|
||||
= button_tag t(:update), type: 'button', "ng-click" => "submitPayment()"
|
||||
@@ -1,15 +1,49 @@
|
||||
class Api::Admin::VariantSerializer < ActiveModel::Serializer
|
||||
attributes :id, :options_text, :unit_value, :unit_description, :unit_to_display, :on_demand, :display_as, :display_name, :name_to_display, :sku
|
||||
attributes :on_hand, :price, :import_date
|
||||
attributes :id, :name, :producer_name, :image, :sku, :import_date
|
||||
attributes :options_text, :unit_value, :unit_description, :unit_to_display
|
||||
attributes :display_as, :display_name, :name_to_display
|
||||
attributes :price, :on_demand, :on_hand, :in_stock, :stock_location_id, :stock_location_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 side.
|
||||
# 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
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
class Api::ImageSerializer < ActiveModel::Serializer
|
||||
attributes :id, :alt, :small_url, :large_url
|
||||
attributes :id, :alt, :thumb_url, :small_url, :image_url, :large_url
|
||||
|
||||
def thumb_url
|
||||
object.attachment.url(:mini, false)
|
||||
end
|
||||
|
||||
def small_url
|
||||
object.attachment.url(:small, false)
|
||||
end
|
||||
|
||||
def image_url
|
||||
object.attachment.url(:product, false)
|
||||
end
|
||||
|
||||
def large_url
|
||||
object.attachment.url(:large, false)
|
||||
end
|
||||
|
||||
13
app/serializers/api/order_cycle_serializer.rb
Normal file
13
app/serializers/api/order_cycle_serializer.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
module Api
|
||||
class OrderCycleSerializer < ActiveModel::Serializer
|
||||
attributes :order_cycle_id, :orders_close_at
|
||||
|
||||
def order_cycle_id
|
||||
object.id
|
||||
end
|
||||
|
||||
def orders_close_at
|
||||
object.orders_close_at.to_s
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -22,20 +22,36 @@ class LineItemSyncer
|
||||
def update_item_quantities(order)
|
||||
changed_subscription_line_items.each do |sli|
|
||||
line_item = order.line_items.find_by_variant_id(sli.variant_id)
|
||||
next if update_quantity(line_item, sli)
|
||||
product_name = "#{line_item.product.name} - #{line_item.full_name}"
|
||||
order_update_issues.add(order, product_name)
|
||||
|
||||
if line_item.blank?
|
||||
order_update_issues.add(order, sli.variant.product_and_full_name)
|
||||
next
|
||||
end
|
||||
|
||||
unless update_quantity(line_item, sli)
|
||||
add_order_update_issue(order, line_item)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def create_new_items(order)
|
||||
new_subscription_line_items.each do |sli|
|
||||
order.line_items.create(variant_id: sli.variant_id, quantity: sli.quantity, skip_stock_check: true)
|
||||
new_line_item = order.line_items.create(variant_id: sli.variant_id,
|
||||
quantity: sli.quantity,
|
||||
skip_stock_check: skip_stock_check?(order))
|
||||
next if skip_stock_check?(order) || new_line_item.sufficient_stock?
|
||||
|
||||
order.line_items.delete(new_line_item)
|
||||
add_order_update_issue(order, new_line_item)
|
||||
end
|
||||
end
|
||||
|
||||
def destroy_obsolete_items(order)
|
||||
order.line_items.where(variant_id: subscription_line_items.select(&:marked_for_destruction?).map(&:variant_id)).destroy_all
|
||||
order.line_items.
|
||||
where(variant_id: subscription_line_items.
|
||||
select(&:marked_for_destruction?).
|
||||
map(&:variant_id)).
|
||||
destroy_all
|
||||
end
|
||||
|
||||
def changed_subscription_line_items
|
||||
@@ -48,8 +64,27 @@ class LineItemSyncer
|
||||
|
||||
def update_quantity(line_item, sli)
|
||||
if line_item.quantity == sli.quantity_was
|
||||
return line_item.update_attributes(quantity: sli.quantity, skip_stock_check: true)
|
||||
return line_item.update_attributes(quantity: sli.quantity,
|
||||
skip_stock_check: skip_stock_check?(line_item.order))
|
||||
end
|
||||
line_item.quantity == sli.quantity
|
||||
end
|
||||
|
||||
def skip_stock_check?(order)
|
||||
!order.complete?
|
||||
end
|
||||
|
||||
def add_order_update_issue(order, line_item)
|
||||
issue_description = "#{line_item.product.name} - #{line_item.variant.full_name}"
|
||||
issue_description << " - #{stock_issue_description(line_item)}" if line_item.insufficient_stock?
|
||||
order_update_issues.add(order, issue_description)
|
||||
end
|
||||
|
||||
def stock_issue_description(line_item)
|
||||
if line_item.variant.in_stock?
|
||||
I18n.t("admin.subscriptions.stock.insufficient_stock")
|
||||
else
|
||||
I18n.t("admin.subscriptions.stock.out_of_stock")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# Responsible for ensuring that any updates to a Subscription are propagated to any
|
||||
# orders belonging to that Subscription which have been instantiated
|
||||
|
||||
class OrderSyncer
|
||||
attr_reader :order_update_issues
|
||||
|
||||
@@ -11,8 +10,9 @@ class OrderSyncer
|
||||
end
|
||||
|
||||
def sync!
|
||||
future_and_undated_orders.all? do |order|
|
||||
order.assign_attributes(customer_id: customer_id, email: customer.andand.email, distributor_id: shop_id)
|
||||
orders_in_order_cycles_not_closed.all? do |order|
|
||||
order.assign_attributes(customer_id: customer_id, email: customer.andand.email,
|
||||
distributor_id: shop_id)
|
||||
update_associations_for(order)
|
||||
line_item_syncer.sync!(order)
|
||||
order.save
|
||||
@@ -25,7 +25,8 @@ class OrderSyncer
|
||||
|
||||
delegate :orders, :bill_address, :ship_address, :subscription_line_items, to: :subscription
|
||||
delegate :shop_id, :customer, :customer_id, to: :subscription
|
||||
delegate :shipping_method, :shipping_method_id, :payment_method, :payment_method_id, to: :subscription
|
||||
delegate :shipping_method, :shipping_method_id,
|
||||
:payment_method, :payment_method_id, to: :subscription
|
||||
delegate :shipping_method_id_changed?, :shipping_method_id_was, to: :subscription
|
||||
delegate :payment_method_id_changed?, :payment_method_id_was, to: :subscription
|
||||
|
||||
@@ -36,9 +37,10 @@ class OrderSyncer
|
||||
update_payment_for(order) if payment_method_id_changed?
|
||||
end
|
||||
|
||||
def future_and_undated_orders
|
||||
return @future_and_undated_orders unless @future_and_undated_orders.nil?
|
||||
@future_and_undated_orders = orders.joins(:order_cycle).merge(OrderCycle.not_closed).readonly(false)
|
||||
def orders_in_order_cycles_not_closed
|
||||
return @orders_in_order_cycles_not_closed unless @orders_in_order_cycles_not_closed.nil?
|
||||
@orders_in_order_cycles_not_closed = orders.joins(:order_cycle).
|
||||
merge(OrderCycle.not_closed).readonly(false)
|
||||
end
|
||||
|
||||
def update_bill_address_for(order)
|
||||
@@ -49,7 +51,8 @@ class OrderSyncer
|
||||
end
|
||||
|
||||
def update_payment_for(order)
|
||||
payment = order.payments.with_state('checkout').where(payment_method_id: payment_method_id_was).last
|
||||
payment = order.payments.
|
||||
with_state('checkout').where(payment_method_id: payment_method_id_was).last
|
||||
if payment
|
||||
payment.andand.void_transaction!
|
||||
order.payments.create(payment_method_id: payment_method_id, amount: order.reload.total)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#add-line-item
|
||||
#add-line-item.add-line-item
|
||||
%fieldset
|
||||
%legend{ align: 'center'}= t(:products)
|
||||
%table.no-borders.layout
|
||||
@@ -6,15 +6,15 @@
|
||||
%col{ width: '20%' }
|
||||
%col{ width: '20%' }
|
||||
%tr
|
||||
%td{ style: "vertical-align:top" }
|
||||
%td.vertical-align-top
|
||||
.field
|
||||
= label_tag :add_variant_id, t(:name_or_sku)
|
||||
= label_tag :add_variant_id, t('.name_or_sku')
|
||||
%input#add_variant_id.variant_autocomplete.fullwidth{ type: 'number', ng: { model: 'newItem.variant_id' } }
|
||||
%td{ style: "vertical-align:top" }
|
||||
%td.vertical-align-top
|
||||
.field
|
||||
= label_tag :add_quantity, t(:qty)
|
||||
= label_tag :add_quantity, t('.quantity')
|
||||
%input#add_quantity.fullwidth{ type: 'number', min: 1, ng: { model: 'newItem.quantity' } }
|
||||
%td{ style: "vertical-align:top" }
|
||||
%td
|
||||
.actions
|
||||
%a.icon-plus.button.fullwidth{ href: 'javascript:void(0)', method: :post, ng: { click: 'addSubscriptionLineItem()' } }
|
||||
= t(:add)
|
||||
= t('.add')
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
object @image
|
||||
attributes(*image_attributes)
|
||||
attributes :viewable_type, :viewable_id
|
||||
node( :thumb_url ) { @product.images.first.attachment.url(:mini) }
|
||||
node( :image_url ) { @product.images.first.attachment.url(:product) }
|
||||
@@ -1,3 +0,0 @@
|
||||
object current_order_cycle
|
||||
attributes :orders_close_at
|
||||
attribute id: :order_cycle_id
|
||||
@@ -1,5 +1,5 @@
|
||||
%span.cart-span{"ng-controller" => "CartCtrl", "ng-class" => "{ dirty: Cart.dirty || Cart.empty(), 'pure-dirty': Cart.dirty }"}
|
||||
%a#cart.icon{cart: true}
|
||||
%a#cart.icon{"cart-toggle" => true}
|
||||
%span
|
||||
= t '.cart'
|
||||
%span.count
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
- content_for :scripts do
|
||||
:javascript
|
||||
angular.module('Darkswarm').value('orderCycleData', #{render "json/order_cycle"})
|
||||
- content_for :injection_data do
|
||||
= inject_current_order_cycle
|
||||
|
||||
%ordercycle{"ng-controller" => "OrderCycleCtrl"}
|
||||
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
<%= admin_inject_json "admin.payments", "currentOrderNumber", @order.number %>
|
||||
<%= admin_inject_json_ams_array "admin.payments", "paymentMethods", @payment_methods, Api::PaymentMethodSerializer, current_order: @order %>
|
||||
|
||||
<div data-hook="admin_payment_form_fields" class="row">
|
||||
<div class="alpha three columns">
|
||||
<div class="field">
|
||||
<%= f.label :amount, t(:amount) %>
|
||||
<%= f.text_field :amount, :value => @order.outstanding_balance, :class => 'fullwidth', "watch-value-as" => 'form_data.amount' %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="omega nine columns">
|
||||
<div class="field">
|
||||
<label><%= t(:payment_method) %></label>
|
||||
<ul>
|
||||
<% @payment_methods.each do |method| %>
|
||||
<li>
|
||||
<label data-hook="payment_method_field">
|
||||
<%= radio_button_tag 'payment[payment_method_id]', method.id, method == @payment_method, { class: "payment_methods_radios", "ng-model" => 'form_data.payment_method' } %>
|
||||
<%= t(method.name, :scope => :payment_methods, :default => method.name) %>
|
||||
</label>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<div class="payment-method-settings">
|
||||
<% @payment_methods.each do |method| %>
|
||||
<div class="payment-methods" id="payment_method_<%= method.id %>">
|
||||
<% if method.source_required? %>
|
||||
<br />
|
||||
<%= render :partial => "spree/admin/payments/source_forms/#{method.method_type}", :locals => { :payment_method => method } %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
23
app/views/spree/admin/payments/_form.html.haml
Normal file
23
app/views/spree/admin/payments/_form.html.haml
Normal file
@@ -0,0 +1,23 @@
|
||||
= admin_inject_json "admin.payments", "currentOrderNumber", @order.number
|
||||
= admin_inject_json_ams_array "admin.payments", "paymentMethods", @payment_methods, Api::PaymentMethodSerializer, current_order: @order
|
||||
|
||||
.row
|
||||
.alpha.three.columns
|
||||
.field
|
||||
= f.label :amount, t(:amount)
|
||||
= f.text_field :amount, value: @order.outstanding_balance, class: 'fullwidth', "watch-value-as" => 'form_data.amount'
|
||||
.omega.nine.columns
|
||||
.field
|
||||
%label= t(:payment_method)
|
||||
%ul
|
||||
- @payment_methods.each do |method|
|
||||
%li
|
||||
%label
|
||||
= radio_button_tag 'payment[payment_method_id]', method.id, method == @payment_method, { class: "payment_methods_radios", "ng-model" => 'form_data.payment_method' }
|
||||
= t(method.name, scope: :payment_methods, default: method.name)
|
||||
.payment-method-settings
|
||||
- @payment_methods.each do |method|
|
||||
.payment-methods{id: "payment_method_#{method.id}"}
|
||||
- if method.source_required?
|
||||
%br/
|
||||
= render partial: "spree/admin/payments/source_forms/#{method.method_type}", locals: { payment_method: method }
|
||||
19
app/views/spree/admin/payments/_list.html.haml
Normal file
19
app/views/spree/admin/payments/_list.html.haml
Normal file
@@ -0,0 +1,19 @@
|
||||
%table.index
|
||||
%thead
|
||||
%tr
|
||||
%th= "#{Spree.t('date')}/#{Spree.t('time')}"
|
||||
%th= Spree.t(:amount)
|
||||
%th= Spree.t(:payment_method)
|
||||
%th= Spree.t(:payment_state)
|
||||
%th.actions
|
||||
%tbody
|
||||
- payments.each do |payment|
|
||||
%tr{class: "#{cycle('odd', 'even')}"}
|
||||
%td= pretty_time(payment.created_at)
|
||||
%td.align-center= payment.display_amount.to_html
|
||||
%td.align-center= link_to payment_method_name(payment), spree.admin_order_payment_path(@order, payment)
|
||||
%td.align-center
|
||||
%span{class: "state #{payment.state}"}= Spree.t(payment.state, scope: :payment_states, default: payment.state.capitalize)
|
||||
%td.actions
|
||||
- payment.actions.each do |action|
|
||||
= link_to_with_icon "icon-#{action}", Spree.t(action), fire_admin_order_payment_path(@order, payment, e: action), method: :put, no_text: true, data: {action: action}
|
||||
22
app/views/spree/admin/payments/index.html.haml
Normal file
22
app/views/spree/admin/payments/index.html.haml
Normal file
@@ -0,0 +1,22 @@
|
||||
= render partial: 'spree/admin/shared/order_tabs', locals: { current: 'Payments' }
|
||||
|
||||
- content_for :page_actions do
|
||||
- if @order.outstanding_balance?
|
||||
%li#new_payment_section
|
||||
= button_link_to Spree.t(:new_payment), new_admin_order_payment_url(@order), icon: 'icon-plus'
|
||||
%li= button_link_to Spree.t(:back_to_orders_list), admin_orders_path, icon: 'icon-arrow-left'
|
||||
|
||||
- content_for :page_title do
|
||||
%i.icon-arrow-right
|
||||
= Spree.t(:payments)
|
||||
|
||||
- if @order.outstanding_balance?
|
||||
%h5.outstanding-balance
|
||||
= @order.outstanding_balance < 0 ? Spree.t(:credit_owed) : Spree.t(:balance_due)
|
||||
\:
|
||||
%strong= @order.display_outstanding_balance
|
||||
|
||||
- if @payments.any?
|
||||
= render partial: 'list', locals: { payments: @payments }
|
||||
- else
|
||||
.alpha.twelve.columns.no-objects-found= Spree.t(:order_has_no_payments)
|
||||
22
app/views/spree/admin/payments/new.html.haml
Normal file
22
app/views/spree/admin/payments/new.html.haml
Normal file
@@ -0,0 +1,22 @@
|
||||
= render partial: 'spree/admin/shared/order_tabs', locals: { current: 'Payments' }
|
||||
|
||||
- content_for :page_title do
|
||||
%i.icon-arrow-right
|
||||
= Spree.t(:new_payment)
|
||||
|
||||
- content_for :page_actions do
|
||||
%li= button_link_to Spree.t(:back_to_payments_list), spree.admin_order_payments_url(@order), icon: 'icon-arrow-left'
|
||||
|
||||
- if @payment_methods.any?
|
||||
= render partial: 'spree/shared/error_messages', locals: { target: @payment }
|
||||
|
||||
= form_for @payment, url: admin_order_payments_path(@order), html: {"ng-app" => "admin.payments", "ng-controller" => "PaymentCtrl"} do |f|
|
||||
%save-bar{ persist: "true" }
|
||||
%fieldset.no-border-top
|
||||
= render partial: 'form', locals: { f: f }
|
||||
.filter-actions.actions
|
||||
= button_tag t(:update), type: 'button', "ng-click" => "submitPayment()"
|
||||
|
||||
- else
|
||||
= Spree.t(:cannot_create_payment_without_payment_methods)
|
||||
= link_to Spree.t(:please_define_payment_methods), admin_payment_methods_url
|
||||
18
app/views/spree/admin/payments/show.html.haml
Normal file
18
app/views/spree/admin/payments/show.html.haml
Normal file
@@ -0,0 +1,18 @@
|
||||
= render partial: 'spree/admin/shared/order_tabs', locals: { current: 'Payments' }
|
||||
|
||||
- content_for :page_title do
|
||||
%i.icon-arrow-right
|
||||
= Spree.t("activerecord.models.#{@payment.class.to_s.underscore}.one")
|
||||
%i.icon-arrow-right
|
||||
= payment_method_name(@payment)
|
||||
|
||||
- content_for :page_actions do
|
||||
%li= button_link_to Spree.t(:back_to_payments_list), spree.admin_order_payments_url(@order), icon: 'icon-arrow-left'
|
||||
|
||||
= render partial: "spree/admin/payments/source_views/#{@payment.payment_method.method_type}", locals: { payment: @payment.source.is_a?(Spree::Payment) ? @payment.source : @payment }
|
||||
|
||||
.align-center
|
||||
%h5
|
||||
= label_tag nil, Spree.t(:amount)
|
||||
\:
|
||||
%span.green= @payment.amount
|
||||
@@ -1,58 +0,0 @@
|
||||
<fieldset class="no-border-bottom">
|
||||
<div class="field" data-hook="previous_cards">
|
||||
<% @previous_cards.each do |card| %>
|
||||
<label><%= radio_button_tag :card, card.id, card == @previous_cards.first %> <%= card.display_number %><br /></label>
|
||||
<% end %>
|
||||
<label><%= radio_button_tag :card, 'new', @previous_cards.none?, { class: "card_new" } %> <%= t(:use_new_cc) %></label>
|
||||
</div>
|
||||
|
||||
<div class="card_form" data-hook>
|
||||
<% param_prefix = "payment_source[#{payment_method.id}]" %>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="alpha four columns">
|
||||
<div data-hook="card_number">
|
||||
<div class="field">
|
||||
<%= hidden_field_tag "#{param_prefix}[cc_type]", '', {class: 'ccType'} %>
|
||||
<%= label_tag "card_number#{payment_method.id}", raw(t(:card_number) + content_tag(:span, ' *', :class => 'required')) %>
|
||||
<%= text_field_tag "#{param_prefix}[number]", '', :class => 'required fullwidth cardNumber', :id => "card_number#{payment_method.id}", :maxlength => 19 %>
|
||||
<span id="card_type" style="display:none;">
|
||||
( <span id="looks_like" ><%= t(:card_type_is) %> <span id="type"></span></span>
|
||||
<span id="unrecognized"><%= t(:unrecognized_card_type) %></span>
|
||||
)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="alpha four columns">
|
||||
<div data-hook="card_name">
|
||||
<div class="field">
|
||||
<%= label_tag "card_name#{payment_method.id}", raw(t(:name) + content_tag(:span, ' *', :class => 'required')) %>
|
||||
<%= text_field_tag "#{param_prefix}[name]", '', id: "card_name#{payment_method.id}", class: 'required fullwidth', maxlength: 19 %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="three columns">
|
||||
<div data-hook="card_expiration" class="field">
|
||||
<%= label_tag "card_expiry#{payment_method.id}", raw(t(:expiration) + content_tag(:span, ' *', :class => 'required')) %><br>
|
||||
<%= text_field_tag "#{param_prefix}[expiry]", '', id: "card_expiry#{payment_method.id}", class: "required cardExpiry", placeholder: "MM / YY" %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="omega two columns">
|
||||
<div data-hook="card_code" class="field">
|
||||
<%= label_tag "card_code#{payment_method.id}", raw(t(:card_code) + content_tag(:span, ' *', :class => "required")) %>
|
||||
<%= text_field_tag "#{param_prefix}[verification_value]", '', id: "card_code#{payment_method.id}", class: 'required fullwidth cardCode', size: 5 %>
|
||||
<a href="/content/cvv" class="info cvvLink" target="_blank">
|
||||
(<%= t(:what_is_this) %>)
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="nine columns">
|
||||
<%= image_tag 'credit_cards/credit_card.gif', :class => 'credit-card-image' %>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</fieldset>
|
||||
@@ -0,0 +1,45 @@
|
||||
%fieldset.no-border-bottom
|
||||
.field
|
||||
- @previous_cards.each do |card|
|
||||
%label
|
||||
= radio_button_tag :card, card.id, card == @previous_cards.first
|
||||
= card.display_number
|
||||
%br/
|
||||
%label
|
||||
= radio_button_tag :card, 'new', @previous_cards.none?, { class: "card_new" }
|
||||
= t(:use_new_cc)
|
||||
.card_form
|
||||
- param_prefix = "payment_source[#{payment_method.id}]"
|
||||
.clear
|
||||
.alpha.four.columns
|
||||
%div
|
||||
.field
|
||||
= hidden_field_tag "#{param_prefix}[cc_type]", '', {class: 'ccType'}
|
||||
= label_tag "card_number#{payment_method.id}", raw(t(:card_number) + content_tag(:span, ' *', class: 'required'))
|
||||
= text_field_tag "#{param_prefix}[number]", '', class: 'required fullwidth cardNumber', id: "card_number#{payment_method.id}", maxlength: 19
|
||||
%span#card_type{style: "display:none;"}
|
||||
(
|
||||
%span#looks_like
|
||||
= t(:card_type_is)
|
||||
%span#type
|
||||
%span#unrecognized= t(:unrecognized_card_type)
|
||||
)
|
||||
.alpha.four.columns
|
||||
%div
|
||||
.field
|
||||
= label_tag "card_name#{payment_method.id}", raw(t(:name) + content_tag(:span, ' *', class: 'required'))
|
||||
= text_field_tag "#{param_prefix}[name]", '', id: "card_name#{payment_method.id}", class: 'required fullwidth', maxlength: 19
|
||||
.three.columns
|
||||
.field
|
||||
= label_tag "card_expiry#{payment_method.id}", raw(t(:expiration) + content_tag(:span, ' *', class: 'required'))
|
||||
%br/
|
||||
= text_field_tag "#{param_prefix}[expiry]", '', id: "card_expiry#{payment_method.id}", class: "required cardExpiry", placeholder: "MM / YY"
|
||||
.omega.two.columns
|
||||
.field
|
||||
= label_tag "card_code#{payment_method.id}", raw(t(:card_code) + content_tag(:span, ' *', class: "required"))
|
||||
= text_field_tag "#{param_prefix}[verification_value]", '', id: "card_code#{payment_method.id}", class: 'required fullwidth cardCode', size: 5
|
||||
%a.info.cvvLink{href: "/content/cvv", target: "_blank"}
|
||||
(#{t(:what_is_this)})
|
||||
.nine.columns
|
||||
= image_tag 'credit_cards/credit_card.gif', class: 'credit-card-image'
|
||||
.clear
|
||||
@@ -0,0 +1,33 @@
|
||||
%fieldset
|
||||
%legend{:align => "center"}= Spree.t(:credit_card)
|
||||
.row
|
||||
.alpha.six.columns
|
||||
%dl
|
||||
%dt
|
||||
= Spree.t(:card_number)
|
||||
\:
|
||||
%dd= payment.source.display_number
|
||||
%dt
|
||||
= Spree.t(:expiration)
|
||||
\:
|
||||
%dd
|
||||
= payment.source.month
|
||||
\/
|
||||
= payment.source.year
|
||||
%dt
|
||||
= Spree.t(:card_code)
|
||||
\:
|
||||
%dd= payment.source.verification_value
|
||||
.omega.six.columns
|
||||
%dl
|
||||
%dt
|
||||
= t(:maestro_or_solo_cards)
|
||||
\:
|
||||
%dd= payment.source.issue_number
|
||||
%dt
|
||||
= Spree.t(:start_date)
|
||||
\:
|
||||
%dd
|
||||
= payment.source.start_month
|
||||
\/
|
||||
= payment.source.start_year
|
||||
@@ -16,16 +16,13 @@
|
||||
</ul>
|
||||
<ul class='variant-data'>
|
||||
<li class='variant-sku'><strong><%= t('admin.sku') %>:</strong> {{variant.sku}}</li>
|
||||
<li class='variant-on_hand'><strong><%= t('on_hand') %>:</strong> {{variant.on_hand}}</li>
|
||||
{{#if variant.on_demand }}
|
||||
<li class='variant-on_demand'><strong><%= t('on_demand') %></strong></li>
|
||||
{{ else }}
|
||||
<li class='variant-on_hand'><strong><%= t('on_hand') %>:</strong> {{variant.on_hand}}</li>
|
||||
{{/if}}
|
||||
<li class='variant-options_text'><strong><%= t('.unit') %>:</strong> {{variant.options_text}}</li>
|
||||
</ul>
|
||||
|
||||
{{#if variant.option_values}}
|
||||
<ul class='variant-options'>
|
||||
{{#each variant.option_values}}
|
||||
<li><strong>{{this.option_type.presentation}}:</strong> {{this.presentation}}</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
@@ -45,7 +42,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
{{#if variant.[in_stock?]}}
|
||||
{{#if variant.in_stock}}
|
||||
{{#if variant.on_demand}}
|
||||
<td><%= Spree.t(:on_demand) %></td>
|
||||
{{else}}
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
#
|
||||
# overriding spree/core/app/views/spree/admin/variants/search.rabl
|
||||
#
|
||||
collection @variants
|
||||
attributes :sku, :options_text, :in_stock?, :on_demand, :on_hand, :id, :cost_price
|
||||
|
||||
node(:name) do |v|
|
||||
# TODO: when products must have a unit, full_name will always be present
|
||||
variant_specific = v.full_name
|
||||
if variant_specific.present?
|
||||
"#{v.name} - #{v.full_name}"
|
||||
else
|
||||
v.name
|
||||
end
|
||||
end
|
||||
|
||||
node(:full_name, &:full_name)
|
||||
|
||||
node(:producer_name) do |v|
|
||||
v.product.supplier.name
|
||||
end
|
||||
|
||||
node(:stock_location_id) do |v|
|
||||
v.stock_items.first.stock_location.id
|
||||
end
|
||||
|
||||
node(:stock_location_name) do |v|
|
||||
v.stock_items.first.stock_location.name
|
||||
end
|
||||
|
||||
child(images: :images) do
|
||||
attributes :mini_url
|
||||
end
|
||||
|
||||
child(option_values: :option_values) do
|
||||
child(option_type: :option_type) do
|
||||
attributes :name, :presentation
|
||||
end
|
||||
attributes :name, :presentation
|
||||
end
|
||||
@@ -1,13 +1,16 @@
|
||||
%table.order-summary{:width => "100%"}
|
||||
%thead
|
||||
%tr
|
||||
%th{:align => "left"}
|
||||
%th{align: "left"}
|
||||
%h4
|
||||
= t :email_order_summary_item
|
||||
%th{:align => "right", :width => "25%"}
|
||||
%th{align: "left"}
|
||||
%h4
|
||||
= t :email_order_summary_sku
|
||||
%th{align: "right"}
|
||||
%h4
|
||||
= t :email_order_summary_quantity
|
||||
%th{:align => "right", :width => "25%"}
|
||||
%th{align: "right", width: "25%"}
|
||||
%h4
|
||||
= t :email_order_summary_price
|
||||
%tbody
|
||||
@@ -18,37 +21,42 @@
|
||||
%br
|
||||
%small
|
||||
%em= raw(item.variant.product.supplier.name)
|
||||
%td{:align => "right"}
|
||||
%td
|
||||
- if item.variant.sku.blank?
|
||||
\-
|
||||
- else
|
||||
= item.variant.sku
|
||||
%td{align: "right"}
|
||||
- if @changes && @changes[item.id].present?
|
||||
%del.quantity_was= @changes[item.id]
|
||||
= item.quantity
|
||||
-# Report changes made to subscriptions
|
||||
|
||||
%td{:align => "right"}
|
||||
%td{align: "right"}
|
||||
= item.display_amount_with_adjustments
|
||||
%tfoot
|
||||
%tr
|
||||
%td{:align => "right", :colspan => "2"}
|
||||
%td{align: "right", colspan: "3"}
|
||||
= t :email_order_summary_subtotal
|
||||
%td{:align => "right"}
|
||||
%td{align: "right"}
|
||||
= display_checkout_subtotal(@order)
|
||||
- checkout_adjustments_for(@order, exclude: [:line_item]).reject{ |a| a.amount == 0 }.reverse_each do |adjustment|
|
||||
%tr
|
||||
%td{:align => "right", :colspan => "2"}
|
||||
%td{align: "right", colspan: "3"}
|
||||
= "#{raw(adjustment.label)}:"
|
||||
%td{:align => "right"}
|
||||
%td{align: "right"}
|
||||
= adjustment.display_amount
|
||||
%tr
|
||||
%td{:align => "right", :colspan => "2"}
|
||||
%td{align: "right", colspan: "3"}
|
||||
%strong
|
||||
= t :email_order_summary_total
|
||||
%td{:align => "right"}
|
||||
%td{align: "right"}
|
||||
%strong= @order.display_total
|
||||
|
||||
- if @order.total_tax > 0
|
||||
%tr
|
||||
%td{:align => "right", :colspan => "2"}
|
||||
%td{align: "right", colspan: "3"}
|
||||
= t :email_order_summary_includes_tax
|
||||
%td{:align => "right"}
|
||||
%td{align: "right"}
|
||||
= display_checkout_tax_total(@order)
|
||||
%p
|
||||
|
||||
6
config/initializers/datadog.rb
Normal file
6
config/initializers/datadog.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
if ENV['DATADOG_RAILS_APM']
|
||||
Datadog.configure do |c|
|
||||
c.use :rails, service_name: 'rails'
|
||||
c.use :delayed_job, service_name: 'delayed_job'
|
||||
end
|
||||
end
|
||||
@@ -1003,6 +1003,10 @@ ca:
|
||||
Els preus que es mostren són només una estimació i es calculen en el moment en què es canvia la subscripció.
|
||||
Si canvieu els preus o les comissions, les comandes s'actualitzaran, però la subscripció continuarà mostrant els valors anteriors.
|
||||
not_in_open_and_upcoming_order_cycles_warning: "No hi ha cicles de comandes oberts o futurs per a aquest producte."
|
||||
autocomplete:
|
||||
name_or_sku: "NOM O CODI"
|
||||
quantity: "Quantitat"
|
||||
add: "Afegeix"
|
||||
details:
|
||||
details: Detalls
|
||||
invalid_error: Oops! Si us plau ompliu tots els camps obligatoris ...
|
||||
@@ -1025,15 +1029,18 @@ ca:
|
||||
saving: "DESANT"
|
||||
saved: "DESAT"
|
||||
product_already_in_order: Aquest producte ja s'ha afegit a la comanda. Editeu-ne la quantitat directament.
|
||||
stock:
|
||||
insufficient_stock: "Estoc disponible insuficient"
|
||||
out_of_stock: "Fora d'existència"
|
||||
orders:
|
||||
number: Número
|
||||
confirm_edit: Estàs segur que voleu editar aquesta comanda? Si ho fas és més difícil que es sincronitzin automàticament els canvis a la subscripció en el futur.
|
||||
confirm_cancel_msg: Estàs segur que vols cancel·lar aquesta subscripció? Aquesta acció no es pot desfer.
|
||||
cancel_failure_msg: 'Ho sentim, la cancel·lació ha fallat!'
|
||||
confirm_pause_msg: Estàs segur que vols pausar aquesta subscripció?
|
||||
pause_failure_msg: 'Ho sentim, la pausa ha fallat!'
|
||||
confirm_unpause_msg: Estàs segur que vols reprendre aquesta subscripció?
|
||||
unpause_failure_msg: 'Ho sentim, la represa ha fallat!'
|
||||
confirm_cancel_msg: "Estàs segur que vols cancel·lar aquesta subscripció? Aquesta acció no es pot desfer."
|
||||
cancel_failure_msg: "Ho sentim, la cancel·lació ha fallat!"
|
||||
confirm_pause_msg: "Estàs segur que vols pausar aquesta subscripció?"
|
||||
pause_failure_msg: "Ho sentim, la pausa ha fallat!"
|
||||
confirm_unpause_msg: "Si teniu un cicle de comanda obert a la programació d'aquesta subscripció, es crearà una comanda per a aquesta consumidora. Esteu segur que voleu anul·lar aquesta subscripció?"
|
||||
unpause_failure_msg: "Ho sentim, la represa ha fallat!"
|
||||
confirm_cancel_open_orders_msg: "Actualment hi ha algunes comandes obertes per a aquesta subscripció. Ja s'ha notificat a les consumidores que les comandes serà atesa. Voleu cancel·lar aquestes comandes o conservar-les?"
|
||||
resume_canceled_orders_msg: "Algunes comandes d'aquesta subscripció es poden reprendre ara mateix. Podeu reprendre-les des del menú desplegable de comandes."
|
||||
yes_cancel_them: Cancel·lar-les
|
||||
@@ -1395,6 +1402,7 @@ ca:
|
||||
email_confirm_shop_number_html: "Confirmació de la comanda <strong> # %{number}</strong>"
|
||||
email_order_summary_item: "Article"
|
||||
email_order_summary_quantity: "quant."
|
||||
email_order_summary_sku: "Número de referència (SKU)"
|
||||
email_order_summary_price: "Preu"
|
||||
email_order_summary_subtotal: "Subtotal:"
|
||||
email_order_summary_total: "Total:"
|
||||
@@ -2988,7 +2996,8 @@ ca:
|
||||
confirmation_pending: "La confirmació de correu electrònic està pendent. Hem enviat un correu electrònic de confirmació a %{address}."
|
||||
variants:
|
||||
autocomplete:
|
||||
producer_name: Productor
|
||||
producer_name: "Productor"
|
||||
unit: "Unitat"
|
||||
general_settings:
|
||||
edit:
|
||||
legal_settings: "Paràmetres legals"
|
||||
|
||||
@@ -1001,6 +1001,9 @@ de_DE:
|
||||
Die angezeigten Preise sind nur Schätzungen und werden zum Zeitpunkt der Änderung des Abonnements berechnet.
|
||||
Wenn Sie die Preise oder Gebühren ändern, werden die Bestellungen aktualisiert, aber das Abonnement zeigt weiterhin die alten Werte an.
|
||||
not_in_open_and_upcoming_order_cycles_warning: "Für dieses Produkt gibt es keine offenen oder bevorstehenden Bestellzyklen."
|
||||
autocomplete:
|
||||
quantity: "Menge"
|
||||
add: "Hinzufügen"
|
||||
details:
|
||||
details: Einzelheiten
|
||||
invalid_error: Hoppla! Bitte füllen Sie alle erforderlichen Felder aus ...
|
||||
@@ -1026,12 +1029,11 @@ de_DE:
|
||||
orders:
|
||||
number: Nummer
|
||||
confirm_edit: Sind Sie sicher, dass Sie diese Bestellung bearbeiten möchten? Dies kann die automatische Synchronisierung von Änderungen am Abonnement in Zukunft erschweren.
|
||||
confirm_cancel_msg: Sind Sie sicher, dass Sie dieses Abonnement kündigen möchten? Dieser Vorgang kann nicht rückgängig gemacht werden.
|
||||
cancel_failure_msg: 'Entschuldigung, Stornierung fehlgeschlagen!'
|
||||
confirm_pause_msg: Möchten Sie dieses Abonnement wirklich pausieren?
|
||||
pause_failure_msg: 'Entschuldigung, Pausieren fehlgeschlagen!'
|
||||
confirm_unpause_msg: Möchten Sie dieses Abonnement wirklich fortsetzen?
|
||||
unpause_failure_msg: 'Entschuldigung, Fortsetzung fehlgeschlagen!'
|
||||
confirm_cancel_msg: "Sind Sie sicher, dass Sie dieses Abonnement kündigen möchten? Dieser Vorgang kann nicht rückgängig gemacht werden."
|
||||
cancel_failure_msg: "Entschuldigung, Stornierung fehlgeschlagen!"
|
||||
confirm_pause_msg: "Möchten Sie dieses Abonnement wirklich pausieren?"
|
||||
pause_failure_msg: "Entschuldigung, Pausieren fehlgeschlagen!"
|
||||
unpause_failure_msg: "Entschuldigung, Fortsetzung fehlgeschlagen!"
|
||||
confirm_cancel_open_orders_msg: "Einige Bestellungen für dieses Abonnement sind derzeit offen. Der Kunde wurde bereits informiert, dass die Bestellung aufgegeben wird. Möchten Sie diese Bestellung(en) stornieren oder erhalten?"
|
||||
resume_canceled_orders_msg: "Manche Bestellungen für dieses Abonnement können jetzt fortgesetzt werden. Sie können sie aus dem Bestellungen-Dropdown-Menü wiederherstellen."
|
||||
yes_cancel_them: Stornieren
|
||||
@@ -1393,6 +1395,7 @@ de_DE:
|
||||
email_confirm_shop_number_html: "Bestellbestätigung <strong> # %{number} </ strong>"
|
||||
email_order_summary_item: "Artikel"
|
||||
email_order_summary_quantity: "Menge"
|
||||
email_order_summary_sku: "Artikelnummer"
|
||||
email_order_summary_price: "Preis"
|
||||
email_order_summary_subtotal: "Zwischensumme:"
|
||||
email_order_summary_total: "Gesamt:"
|
||||
@@ -2985,7 +2988,8 @@ de_DE:
|
||||
confirmation_pending: "E-Mail-Bestätigung steht aus. Wir haben eine Bestätigungs-E-Mail an %{address} gesendet."
|
||||
variants:
|
||||
autocomplete:
|
||||
producer_name: Produzent
|
||||
producer_name: "Produzent"
|
||||
unit: "Einheit"
|
||||
general_settings:
|
||||
edit:
|
||||
legal_settings: "Rechtliche Einstellungen"
|
||||
|
||||
@@ -275,6 +275,7 @@ en:
|
||||
reset_password_token: Reset password token
|
||||
expired: has expired, please request a new one
|
||||
back_to_payments_list: "Back to Payments List"
|
||||
maestro_or_solo_cards: "Maestro/Solo cards"
|
||||
|
||||
actions:
|
||||
create_and_add_another: "Create and Add Another"
|
||||
@@ -1060,6 +1061,10 @@ en:
|
||||
The displayed prices are only an estimate and calculated at the time the subscription is changed.
|
||||
If you change prices or fees, orders will be updated, but the subscription will still display the old values.
|
||||
not_in_open_and_upcoming_order_cycles_warning: "There are no open or upcoming order cycles for this product."
|
||||
autocomplete:
|
||||
name_or_sku: "NAME OR SKU"
|
||||
quantity: "Quantity"
|
||||
add: "Add"
|
||||
details:
|
||||
details: Details
|
||||
invalid_error: Oops! Please fill in all of the required fields...
|
||||
@@ -1082,15 +1087,18 @@ en:
|
||||
saving: "SAVING"
|
||||
saved: "SAVED"
|
||||
product_already_in_order: This product has already been added to the order. Please edit the quantity directly.
|
||||
stock:
|
||||
insufficient_stock: "Insufficient stock available"
|
||||
out_of_stock: "Out of Stock"
|
||||
orders:
|
||||
number: Number
|
||||
confirm_edit: Are you sure you want to edit this order? Doing so may make it more difficult to automatically sync changes to the subscription in the future.
|
||||
confirm_cancel_msg: Are you sure you want to cancel this subscription? This action cannot be undone.
|
||||
cancel_failure_msg: 'Sorry, cancellation failed!'
|
||||
confirm_pause_msg: Are you sure you want to pause this subscription?
|
||||
pause_failure_msg: 'Sorry, pausing failed!'
|
||||
confirm_unpause_msg: Are you sure you want to unpause this subscription?
|
||||
unpause_failure_msg: 'Sorry, unpausing failed!'
|
||||
confirm_cancel_msg: "Are you sure you want to cancel this subscription? This action cannot be undone."
|
||||
cancel_failure_msg: "Sorry, cancellation failed!"
|
||||
confirm_pause_msg: "Are you sure you want to pause this subscription?"
|
||||
pause_failure_msg: "Sorry, pausing failed!"
|
||||
confirm_unpause_msg: "If you have an open Order Cycle in this subscription's schedule, an order will be created for this customer. Are you sure you want to unpause this subscription?"
|
||||
unpause_failure_msg: "Sorry, unpausing failed!"
|
||||
confirm_cancel_open_orders_msg: "Some orders for this subscription are currently open. The customer has already been notified that the order will be placed. Would you like to cancel these order(s) or keep them?"
|
||||
resume_canceled_orders_msg: "Some orders for this subscription can be resumed right now. You can resume them from the orders dropdown."
|
||||
yes_cancel_them: Cancel them
|
||||
@@ -1496,6 +1504,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
email_confirm_shop_number_html: "Order confirmation <strong>#%{number}</strong>"
|
||||
email_order_summary_item: "Item"
|
||||
email_order_summary_quantity: "Qty"
|
||||
email_order_summary_sku: "SKU"
|
||||
email_order_summary_price: "Price"
|
||||
email_order_summary_subtotal: "Subtotal:"
|
||||
email_order_summary_total: "Total:"
|
||||
@@ -3146,7 +3155,8 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
confirmation_pending: "Email confirmation is pending. We've sent a confirmation email to %{address}."
|
||||
variants:
|
||||
autocomplete:
|
||||
producer_name: Producer
|
||||
producer_name: "Producer"
|
||||
unit: "Unit"
|
||||
general_settings:
|
||||
edit:
|
||||
legal_settings: "Legal Settings"
|
||||
|
||||
@@ -1000,6 +1000,10 @@ en_AU:
|
||||
The displayed prices are only an estimate and calculated at the time the subscription is changed.
|
||||
If you change prices or fees, orders will be updated, but the subscription will still display the old values.
|
||||
not_in_open_and_upcoming_order_cycles_warning: "There are no open or upcoming order cycles for this product."
|
||||
autocomplete:
|
||||
name_or_sku: "NAME OR SKU"
|
||||
quantity: "Quantity"
|
||||
add: "Add"
|
||||
details:
|
||||
details: Details
|
||||
invalid_error: Oops! Please fill in all of the required fields...
|
||||
@@ -1022,15 +1026,16 @@ en_AU:
|
||||
saving: "SAVING"
|
||||
saved: "SAVED"
|
||||
product_already_in_order: This product has already been added to the order. Please edit the quantity directly.
|
||||
stock:
|
||||
out_of_stock: "Out of Stock"
|
||||
orders:
|
||||
number: Number
|
||||
confirm_edit: Are you sure you want to edit this order? Doing so may make it more difficult to automatically sync changes to the subscription in the future.
|
||||
confirm_cancel_msg: Are you sure you want to cancel this subscription? This action cannot be undone.
|
||||
cancel_failure_msg: 'Sorry, cancellation failed!'
|
||||
confirm_pause_msg: Are you sure you want to pause this subscription?
|
||||
pause_failure_msg: 'Sorry, pausing failed!'
|
||||
confirm_unpause_msg: Are you sure you want to unpause this subscription?
|
||||
unpause_failure_msg: 'Sorry, unpausing failed!'
|
||||
confirm_cancel_msg: "Are you sure you want to cancel this subscription? This action cannot be undone."
|
||||
cancel_failure_msg: "Sorry, cancellation failed!"
|
||||
confirm_pause_msg: "Are you sure you want to pause this subscription?"
|
||||
pause_failure_msg: "Sorry, pausing failed!"
|
||||
unpause_failure_msg: "Sorry, unpausing failed!"
|
||||
confirm_cancel_open_orders_msg: "Some orders for this subscription are currently open. The customer has already been notified that the order will be placed. Would you like to cancel these order(s) or keep them?"
|
||||
resume_canceled_orders_msg: "Some orders for this subscription can be resumed right now. You can resume them from the orders dropdown."
|
||||
yes_cancel_them: Cancel them
|
||||
@@ -1392,6 +1397,7 @@ en_AU:
|
||||
email_confirm_shop_number_html: "Order confirmation <strong>#%{number}</strong>"
|
||||
email_order_summary_item: "Item"
|
||||
email_order_summary_quantity: "Qty"
|
||||
email_order_summary_sku: "SKU"
|
||||
email_order_summary_price: "Price"
|
||||
email_order_summary_subtotal: "Subtotal:"
|
||||
email_order_summary_total: "Total:"
|
||||
@@ -2981,7 +2987,8 @@ en_AU:
|
||||
confirmation_pending: "Email confirmation is pending. We've sent a confirmation email to %{address}."
|
||||
variants:
|
||||
autocomplete:
|
||||
producer_name: Producer
|
||||
producer_name: "Producer"
|
||||
unit: "Unit"
|
||||
general_settings:
|
||||
edit:
|
||||
legal_settings: "Legal Settings"
|
||||
|
||||
@@ -1000,6 +1000,10 @@ en_BE:
|
||||
The displayed prices are only an estimate and calculated at the time the subscription is changed.
|
||||
If you change prices or fees, orders will be updated, but the subscription will still display the old values.
|
||||
not_in_open_and_upcoming_order_cycles_warning: "There are no open or upcoming order cycles for this product."
|
||||
autocomplete:
|
||||
name_or_sku: "NAME OR SKU"
|
||||
quantity: "Quantity"
|
||||
add: "Add"
|
||||
details:
|
||||
details: Details
|
||||
invalid_error: Oops! Please fill in all of the required fields...
|
||||
@@ -1022,15 +1026,16 @@ en_BE:
|
||||
saving: "SAVING"
|
||||
saved: "SAVED"
|
||||
product_already_in_order: This product has already been added to the order. Please edit the quantity directly.
|
||||
stock:
|
||||
out_of_stock: "Out of Stock"
|
||||
orders:
|
||||
number: Number
|
||||
confirm_edit: Are you sure you want to edit this order? Doing so may make it more difficult to automatically sync changes to the subscription in the future.
|
||||
confirm_cancel_msg: Are you sure you want to cancel this subscription? This action cannot be undone.
|
||||
cancel_failure_msg: 'Sorry, cancellation failed!'
|
||||
confirm_pause_msg: Are you sure you want to pause this subscription?
|
||||
pause_failure_msg: 'Sorry, pausing failed!'
|
||||
confirm_unpause_msg: Are you sure you want to unpause this subscription?
|
||||
unpause_failure_msg: 'Sorry, unpausing failed!'
|
||||
confirm_cancel_msg: "Are you sure you want to cancel this subscription? This action cannot be undone."
|
||||
cancel_failure_msg: "Sorry, cancellation failed!"
|
||||
confirm_pause_msg: "Are you sure you want to pause this subscription?"
|
||||
pause_failure_msg: "Sorry, pausing failed!"
|
||||
unpause_failure_msg: "Sorry, unpausing failed!"
|
||||
confirm_cancel_open_orders_msg: "Some orders for this subscription are currently open. The customer has already been notified that the order will be placed. Would you like to cancel these order(s) or keep them?"
|
||||
resume_canceled_orders_msg: "Some orders for this subscription can be resumed right now. You can resume them from the orders dropdown."
|
||||
yes_cancel_them: Cancel them
|
||||
@@ -1392,6 +1397,7 @@ en_BE:
|
||||
email_confirm_shop_number_html: "Order confirmation <strong>#%{number}</strong>"
|
||||
email_order_summary_item: "Item"
|
||||
email_order_summary_quantity: "Qty"
|
||||
email_order_summary_sku: "SKU"
|
||||
email_order_summary_price: "Price"
|
||||
email_order_summary_subtotal: "Subtotal:"
|
||||
email_order_summary_total: "Total:"
|
||||
@@ -2981,7 +2987,8 @@ en_BE:
|
||||
confirmation_pending: "Email confirmation is pending. We've sent a confirmation email to %{address}."
|
||||
variants:
|
||||
autocomplete:
|
||||
producer_name: Producer
|
||||
producer_name: "Producer"
|
||||
unit: "Unit"
|
||||
general_settings:
|
||||
edit:
|
||||
legal_settings: "Legal Settings"
|
||||
|
||||
@@ -1000,6 +1000,10 @@ en_CA:
|
||||
The displayed prices are only an estimate and calculated at the time the subscription is changed.
|
||||
If you change prices or fees, orders will be updated, but the subscription will still display the old values.
|
||||
not_in_open_and_upcoming_order_cycles_warning: "There are no open or upcoming order cycles for this product."
|
||||
autocomplete:
|
||||
name_or_sku: "NAME OR SKU"
|
||||
quantity: "Quantity"
|
||||
add: "Add"
|
||||
details:
|
||||
details: Details
|
||||
invalid_error: Oops! Please fill in all of the required fields...
|
||||
@@ -1022,15 +1026,16 @@ en_CA:
|
||||
saving: "SAVING"
|
||||
saved: "SAVED"
|
||||
product_already_in_order: This product has already been added to the order. Please edit the quantity directly.
|
||||
stock:
|
||||
out_of_stock: "Out of Stock"
|
||||
orders:
|
||||
number: Number
|
||||
confirm_edit: Are you sure you want to edit this order? Doing so may make it more difficult to automatically sync changes to the subscription in the future.
|
||||
confirm_cancel_msg: Are you sure you want to cancel this subscription? This action cannot be undone.
|
||||
cancel_failure_msg: 'Sorry, cancellation failed!'
|
||||
confirm_pause_msg: Are you sure you want to pause this subscription?
|
||||
pause_failure_msg: 'Sorry, pausing failed!'
|
||||
confirm_unpause_msg: Are you sure you want to unpause this subscription?
|
||||
unpause_failure_msg: 'Sorry, unpausing failed!'
|
||||
confirm_cancel_msg: "Are you sure you want to cancel this subscription? This action cannot be undone."
|
||||
cancel_failure_msg: "Sorry, cancellation failed!"
|
||||
confirm_pause_msg: "Are you sure you want to pause this subscription?"
|
||||
pause_failure_msg: "Sorry, pausing failed!"
|
||||
unpause_failure_msg: "Sorry, unpausing failed!"
|
||||
confirm_cancel_open_orders_msg: "Some orders for this subscription are currently open. The customer has already been notified that the order will be placed. Would you like to cancel these order(s) or keep them?"
|
||||
resume_canceled_orders_msg: "Some orders for this subscription can be resumed right now. You can resume them from the orders dropdown."
|
||||
yes_cancel_them: Cancel them
|
||||
@@ -1392,6 +1397,7 @@ en_CA:
|
||||
email_confirm_shop_number_html: "Order confirmation <strong>#%{number}</strong>"
|
||||
email_order_summary_item: "Item"
|
||||
email_order_summary_quantity: "Qty"
|
||||
email_order_summary_sku: "SKU"
|
||||
email_order_summary_price: "Price"
|
||||
email_order_summary_subtotal: "Subtotal:"
|
||||
email_order_summary_total: "Total:"
|
||||
@@ -2978,7 +2984,8 @@ en_CA:
|
||||
confirmation_pending: "Email confirmation is pending. We've sent a confirmation email to %{address}."
|
||||
variants:
|
||||
autocomplete:
|
||||
producer_name: Producer
|
||||
producer_name: "Producer"
|
||||
unit: "Unit"
|
||||
general_settings:
|
||||
edit:
|
||||
legal_settings: "Legal Settings"
|
||||
|
||||
@@ -94,6 +94,7 @@ en_GB:
|
||||
user_passwords:
|
||||
spree_user:
|
||||
updated_not_active: "Your password has been reset, but your email has not been confirmed yet."
|
||||
updated: "Your password was changed successfully. You are now signed in."
|
||||
send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
|
||||
models:
|
||||
order_cycle:
|
||||
@@ -1000,6 +1001,10 @@ en_GB:
|
||||
The displayed prices are only an estimate and calculated at the time the subscription is changed.
|
||||
If you change prices or fees, orders will be updated, but the subscription will still display the old values.
|
||||
not_in_open_and_upcoming_order_cycles_warning: "There are no open or upcoming order cycles for this product."
|
||||
autocomplete:
|
||||
name_or_sku: "NAME OR SKU"
|
||||
quantity: "Quantity"
|
||||
add: "Add"
|
||||
details:
|
||||
details: Details
|
||||
invalid_error: Oops! Please fill in all of the required fields...
|
||||
@@ -1022,15 +1027,16 @@ en_GB:
|
||||
saving: "SAVING"
|
||||
saved: "SAVED"
|
||||
product_already_in_order: This product has already been added to the order. Please edit the quantity directly.
|
||||
stock:
|
||||
out_of_stock: "Out of Stock"
|
||||
orders:
|
||||
number: Number
|
||||
confirm_edit: Are you sure you want to edit this order? Doing so may make it more difficult to automatically sync changes to the subscription in the future.
|
||||
confirm_cancel_msg: Are you sure you want to cancel this subscription? This action cannot be undone.
|
||||
cancel_failure_msg: 'Sorry, cancellation failed!'
|
||||
confirm_pause_msg: Are you sure you want to pause this subscription?
|
||||
pause_failure_msg: 'Sorry, pausing failed!'
|
||||
confirm_unpause_msg: Are you sure you want to unpause this subscription?
|
||||
unpause_failure_msg: 'Sorry, unpausing failed!'
|
||||
confirm_cancel_msg: "Are you sure you want to cancel this subscription? This action cannot be undone."
|
||||
cancel_failure_msg: "Sorry, cancellation failed!"
|
||||
confirm_pause_msg: "Are you sure you want to pause this subscription?"
|
||||
pause_failure_msg: "Sorry, pausing failed!"
|
||||
unpause_failure_msg: "Sorry, unpausing failed!"
|
||||
confirm_cancel_open_orders_msg: "Some orders for this subscription are currently open. The customer has already been notified that the order will be placed. Would you like to cancel these order(s) or keep them?"
|
||||
resume_canceled_orders_msg: "Some orders for this subscription can be resumed right now. You can resume them from the orders dropdown."
|
||||
yes_cancel_them: Cancel them
|
||||
@@ -1392,6 +1398,7 @@ en_GB:
|
||||
email_confirm_shop_number_html: "Order confirmation <strong>#%{number}</strong>"
|
||||
email_order_summary_item: "Item"
|
||||
email_order_summary_quantity: "Qty"
|
||||
email_order_summary_sku: "Product Code"
|
||||
email_order_summary_price: "Price"
|
||||
email_order_summary_subtotal: "Subtotal:"
|
||||
email_order_summary_total: "Total:"
|
||||
@@ -2779,6 +2786,7 @@ en_GB:
|
||||
inventory: Inventory
|
||||
zipcode: Postcode
|
||||
weight: Weight (per kg)
|
||||
error_user_destroy_with_orders: "Users with completed orders may not be deleted"
|
||||
actions:
|
||||
update: "Update"
|
||||
errors:
|
||||
@@ -2987,7 +2995,8 @@ en_GB:
|
||||
confirmation_pending: "Email confirmation is pending. We've sent a confirmation email to %{address}."
|
||||
variants:
|
||||
autocomplete:
|
||||
producer_name: Producer
|
||||
producer_name: "Producer"
|
||||
unit: "Unit"
|
||||
general_settings:
|
||||
edit:
|
||||
legal_settings: "Legal Settings"
|
||||
|
||||
@@ -987,6 +987,10 @@ en_US:
|
||||
The displayed prices are only an estimate and calculated at the time the subscription is changed.
|
||||
If you change prices or fees, orders will be updated, but the subscription will still display the old values.
|
||||
not_in_open_and_upcoming_order_cycles_warning: "There are no open or upcoming order cycles for this product."
|
||||
autocomplete:
|
||||
name_or_sku: "NAME OR SKU"
|
||||
quantity: "Quantity"
|
||||
add: "Add"
|
||||
details:
|
||||
details: Details
|
||||
invalid_error: Oops! Please fill in all of the required fields...
|
||||
@@ -1007,15 +1011,16 @@ en_US:
|
||||
saving: "SAVING"
|
||||
saved: "SAVED"
|
||||
product_already_in_order: This product has already been added to the order. Please edit the quantity directly.
|
||||
stock:
|
||||
out_of_stock: "Out of Stock"
|
||||
orders:
|
||||
number: Number
|
||||
confirm_edit: Are you sure you want to edit this order? Doing so may make it more difficult to automatically sync changes to the subscription in the future.
|
||||
confirm_cancel_msg: Are you sure you want to cancel this subscription? This action cannot be undone.
|
||||
cancel_failure_msg: 'Sorry, cancellation failed!'
|
||||
confirm_pause_msg: Are you sure you want to pause this subscription?
|
||||
pause_failure_msg: 'Sorry, pausing failed!'
|
||||
confirm_unpause_msg: Are you sure you want to unpause this subscription?
|
||||
unpause_failure_msg: 'Sorry, unpausing failed!'
|
||||
confirm_cancel_msg: "Are you sure you want to cancel this subscription? This action cannot be undone."
|
||||
cancel_failure_msg: "Sorry, cancellation failed!"
|
||||
confirm_pause_msg: "Are you sure you want to pause this subscription?"
|
||||
pause_failure_msg: "Sorry, pausing failed!"
|
||||
unpause_failure_msg: "Sorry, unpausing failed!"
|
||||
confirm_cancel_open_orders_msg: "Some orders for this subscription are currently open. The customer has already been notified that the order will be placed. Would you like to cancel these order(s) or keep them?"
|
||||
resume_canceled_orders_msg: "Some orders for this subscription can be resumed right now. You can resume them from the orders dropdown."
|
||||
yes_cancel_them: Cancel them
|
||||
@@ -1369,6 +1374,7 @@ en_US:
|
||||
email_confirm_shop_number_html: "Order confirmation <strong>#%{number}</strong>"
|
||||
email_order_summary_item: "Item"
|
||||
email_order_summary_quantity: "Qty"
|
||||
email_order_summary_sku: "SKU"
|
||||
email_order_summary_price: "Price"
|
||||
email_order_summary_subtotal: "Subtotal:"
|
||||
email_order_summary_total: "Total:"
|
||||
@@ -2934,7 +2940,8 @@ en_US:
|
||||
confirmation_pending: "Email confirmation is pending. We've sent a confirmation email to %{address}."
|
||||
variants:
|
||||
autocomplete:
|
||||
producer_name: Producer
|
||||
producer_name: "Producer"
|
||||
unit: "Unit"
|
||||
general_settings:
|
||||
edit:
|
||||
legal_settings: "Legal Settings"
|
||||
|
||||
@@ -1000,6 +1000,10 @@ en_ZA:
|
||||
The displayed prices are only an estimate and calculated at the time the subscription is changed.
|
||||
If you change prices or fees, orders will be updated, but the subscription will still display the old values.
|
||||
not_in_open_and_upcoming_order_cycles_warning: "There are no open or upcoming order cycles for this product."
|
||||
autocomplete:
|
||||
name_or_sku: "NAME OR SKU"
|
||||
quantity: "Quantity"
|
||||
add: "Add"
|
||||
details:
|
||||
details: Details
|
||||
invalid_error: Oops! Please fill in all of the required fields...
|
||||
@@ -1022,15 +1026,16 @@ en_ZA:
|
||||
saving: "SAVING"
|
||||
saved: "SAVED"
|
||||
product_already_in_order: This product has already been added to the order. Please edit the quantity directly.
|
||||
stock:
|
||||
out_of_stock: "Out of Stock"
|
||||
orders:
|
||||
number: Number
|
||||
confirm_edit: Are you sure you want to edit this order? Doing so may make it more difficult to automatically sync changes to the subscription in the future.
|
||||
confirm_cancel_msg: Are you sure you want to cancel this subscription? This action cannot be undone.
|
||||
cancel_failure_msg: 'Sorry, cancellation failed!'
|
||||
confirm_pause_msg: Are you sure you want to pause this subscription?
|
||||
pause_failure_msg: 'Sorry, pausing failed!'
|
||||
confirm_unpause_msg: Are you sure you want to unpause this subscription?
|
||||
unpause_failure_msg: 'Sorry, unpausing failed!'
|
||||
confirm_cancel_msg: "Are you sure you want to cancel this subscription? This action cannot be undone."
|
||||
cancel_failure_msg: "Sorry, cancellation failed!"
|
||||
confirm_pause_msg: "Are you sure you want to pause this subscription?"
|
||||
pause_failure_msg: "Sorry, pausing failed!"
|
||||
unpause_failure_msg: "Sorry, unpausing failed!"
|
||||
confirm_cancel_open_orders_msg: "Some orders for this subscription are currently open. The customer has already been notified that the order will be placed. Would you like to cancel these order(s) or keep them?"
|
||||
resume_canceled_orders_msg: "Some orders for this subscription can be resumed right now. You can resume them from the orders dropdown."
|
||||
yes_cancel_them: Cancel them
|
||||
@@ -1392,6 +1397,7 @@ en_ZA:
|
||||
email_confirm_shop_number_html: "Order confirmation <strong>#%{number}</strong>"
|
||||
email_order_summary_item: "Item"
|
||||
email_order_summary_quantity: "Qty"
|
||||
email_order_summary_sku: "SKU"
|
||||
email_order_summary_price: "Price"
|
||||
email_order_summary_subtotal: "Subtotal:"
|
||||
email_order_summary_total: "Total:"
|
||||
@@ -2988,7 +2994,8 @@ en_ZA:
|
||||
confirmation_pending: "Email confirmation is pending. We've sent a confirmation email to %{address}."
|
||||
variants:
|
||||
autocomplete:
|
||||
producer_name: Producer
|
||||
producer_name: "Producer"
|
||||
unit: "Unit"
|
||||
general_settings:
|
||||
edit:
|
||||
legal_settings: "Legal Settings"
|
||||
|
||||
@@ -1003,6 +1003,10 @@ es:
|
||||
Los precios mostrados son solo una estimación y se calculan en el momento en que se cambia la suscripción.
|
||||
Si cambias precios o comisiones, los pedidos se actualizarán pero la suscripción seguirá mostrando los valores anteriores.
|
||||
not_in_open_and_upcoming_order_cycles_warning: "No hay ciclos de pedidos abiertos o próximos para este producto."
|
||||
autocomplete:
|
||||
name_or_sku: "NOMBRE O CÓDIGO SKU"
|
||||
quantity: "Cantidad"
|
||||
add: "Añadir"
|
||||
details:
|
||||
details: Detalles
|
||||
invalid_error: Ups! Por favor complete todos los campos requeridos ...
|
||||
@@ -1025,15 +1029,18 @@ es:
|
||||
saving: "GUARDANDO"
|
||||
saved: "GUARDADO"
|
||||
product_already_in_order: Este producto ya ha sido agregado a la orden. Por favor edite la cantidad directamente.
|
||||
stock:
|
||||
insufficient_stock: "Stock disponible insuficiente"
|
||||
out_of_stock: "Agotado"
|
||||
orders:
|
||||
number: Número
|
||||
confirm_edit: ¿Seguro que quieres editar esta orden? Si lo hace, puede ser más difícil sincronizar automáticamente los cambios a la suscripción en el futuro.
|
||||
confirm_cancel_msg: ¿Seguro que quieres cancelar esta suscripción? Esta acción no se puede deshacer.
|
||||
cancel_failure_msg: 'Lo sentimos, ¡la cancelación falló!'
|
||||
confirm_pause_msg: ¿Seguro que quieres pausar esta suscripción?
|
||||
pause_failure_msg: 'Lo sentimos, pausar falló!'
|
||||
confirm_unpause_msg: ¿Seguro que quieres reanudar esta suscripción?
|
||||
unpause_failure_msg: 'Lo sentimos, ¡no se pudo reanudar!'
|
||||
confirm_cancel_msg: "¿Seguro que quieres cancelar esta suscripción? Esta acción no se puede deshacer."
|
||||
cancel_failure_msg: "Lo sentimos, ¡la cancelación falló!"
|
||||
confirm_pause_msg: "¿Seguro que quieres pausar esta suscripción?"
|
||||
pause_failure_msg: "Lo sentimos, pausar falló!"
|
||||
confirm_unpause_msg: "Si tiene un ciclo de pedido abierto en la programación de esta suscripción, se creará un pedido para esta consumidora. ¿Estás seguro de que deseas anular la pausa de esta suscripción?"
|
||||
unpause_failure_msg: "Lo sentimos, ¡no se pudo reanudar!"
|
||||
confirm_cancel_open_orders_msg: "Algunas órdenes para esta suscripción están actualmente abiertas. El cliente ya ha sido notificado de que se realizará el pedido. ¿Desea cancelar estos pedidos o conservarlos?"
|
||||
resume_canceled_orders_msg: "Algunos pedidos de esta suscripción se pueden reanudar en este momento. Puede reanudarlos desde el menú desplegable de pedidos."
|
||||
yes_cancel_them: Cancelarlos
|
||||
@@ -1395,6 +1402,7 @@ es:
|
||||
email_confirm_shop_number_html: "Confirmación del pedido <strong>#%{number}</strong>"
|
||||
email_order_summary_item: "Artículo"
|
||||
email_order_summary_quantity: "Cantidad"
|
||||
email_order_summary_sku: "SKU"
|
||||
email_order_summary_price: "Precio"
|
||||
email_order_summary_subtotal: "Subtotal:"
|
||||
email_order_summary_total: "Total:"
|
||||
@@ -2989,7 +2997,8 @@ es:
|
||||
confirmation_pending: "La confirmación por correo electrónico está pendiente. Hemos enviado un correo electrónico de confirmación a %{address}."
|
||||
variants:
|
||||
autocomplete:
|
||||
producer_name: Productora
|
||||
producer_name: "Productora"
|
||||
unit: "Unidad"
|
||||
general_settings:
|
||||
edit:
|
||||
legal_settings: "Configuraciones legales"
|
||||
|
||||
@@ -1002,6 +1002,10 @@ fr:
|
||||
Les prix affichés ne sont qu'une estimation calculée au moment de la dernière modification de l'abonnement.
|
||||
Si vous modifiez les prix ou marges et commissions appliquées, les commandes seront mises à jour, mais l'abonnement affichera toujours les anciennes valeurs.
|
||||
not_in_open_and_upcoming_order_cycles_warning: "Il n'y a pas de cycle de vente ouvert ou à venir pour ce produit."
|
||||
autocomplete:
|
||||
name_or_sku: "NOM OU REF PRODUIT"
|
||||
quantity: "Quantité"
|
||||
add: "Ajouter"
|
||||
details:
|
||||
details: Informations
|
||||
invalid_error: Oups! Veuillez remplir tous les champs obligatoires...
|
||||
@@ -1024,15 +1028,18 @@ fr:
|
||||
saving: "En cours d'enregistrement"
|
||||
saved: "Enregistré"
|
||||
product_already_in_order: Ce produit a déjà été ajouté à la commande. Veuillez directement modifier la quantité.
|
||||
stock:
|
||||
insufficient_stock: "Stock disponible insuffisant"
|
||||
out_of_stock: "En rupture de stock"
|
||||
orders:
|
||||
number: Nombre
|
||||
confirm_edit: Voulez-vous vraiment modifier cette commande? Si vous poursuivez, la synchronisation automatique des modifications de l'abonnement pourrait être plus difficile à l'avenir.
|
||||
confirm_cancel_msg: Voulez-vous vraiment annuler cet abonnement? Cette action sera irréversible.
|
||||
cancel_failure_msg: 'Désolé, l''annulation a échoué!'
|
||||
confirm_pause_msg: Voulez-vous vraiment mettre en pause cet abonnement?
|
||||
pause_failure_msg: 'Désolé, la mise en pause a échoué!'
|
||||
confirm_unpause_msg: Voulez-vous vraiment annuler la mise en pause de cet abonnement?
|
||||
unpause_failure_msg: 'Désolé, l''annulation de la mise en pause a échoué!'
|
||||
confirm_cancel_msg: "Voulez-vous vraiment annuler cet abonnement? Cette action sera irréversible."
|
||||
cancel_failure_msg: "Désolé, l'annulation a échoué!"
|
||||
confirm_pause_msg: "Voulez-vous vraiment mettre en pause cet abonnement?"
|
||||
pause_failure_msg: "Désolé, la mise en pause a échoué!"
|
||||
confirm_unpause_msg: "Si vous avez un cycle de vente ouvert pour ce rythme d'abonnement, une commande sera créée pour cet acheteur. Êtes-vous sûr de vouloir relancer cet abonnement ?"
|
||||
unpause_failure_msg: "Désolé, l'annulation de la mise en pause a échoué!"
|
||||
confirm_cancel_open_orders_msg: "Cet abonnement a des commandes ouvertes. Les acheteurs ont été notifiés que leur commande allait être passée. Voulez-vous annulez ces commandes ou les conserver?"
|
||||
resume_canceled_orders_msg: "Certaines commandes pour cet abonnement peuvent être réouvertes dès maintenant. Vous pouvez les réouvrir depuis la liste des commandes."
|
||||
yes_cancel_them: Les annuler
|
||||
@@ -1394,6 +1401,7 @@ fr:
|
||||
email_confirm_shop_number_html: "Confirmation de commande <strong>#%{number}</strong>"
|
||||
email_order_summary_item: "Produit"
|
||||
email_order_summary_quantity: "Qté"
|
||||
email_order_summary_sku: "Référence Produit"
|
||||
email_order_summary_price: "Prix"
|
||||
email_order_summary_subtotal: "Sous-total:"
|
||||
email_order_summary_total: "Total:"
|
||||
@@ -2995,7 +3003,8 @@ fr:
|
||||
confirmation_pending: "L'email de confirmation n'a pas encore été validé. Il a été envoyé à %{address}."
|
||||
variants:
|
||||
autocomplete:
|
||||
producer_name: Producteur
|
||||
producer_name: "Producteur"
|
||||
unit: "Unité"
|
||||
general_settings:
|
||||
edit:
|
||||
legal_settings: "Configuration légales"
|
||||
|
||||
@@ -1001,6 +1001,10 @@ fr_BE:
|
||||
Les prix affichés ne sont qu'une estimation calculée au moment de la dernière modification de l'abonnement.
|
||||
Si vous modifiez les prix ou marges et commissions appliquées, les commandes seront mises à jour, mais l'abonnement affichera toujours les anciennes valeurs.
|
||||
not_in_open_and_upcoming_order_cycles_warning: "Aucun cycle de vente actif ou futur pour ce produit."
|
||||
autocomplete:
|
||||
name_or_sku: "NOM OU NUMÉRO D'ARTICLE "
|
||||
quantity: "Nb commandé"
|
||||
add: "Ajouter"
|
||||
details:
|
||||
details: Informations
|
||||
invalid_error: Oups! Veuillez remplir tous les champs obligatoires...
|
||||
@@ -1023,15 +1027,16 @@ fr_BE:
|
||||
saving: "En cours d'enregistrement"
|
||||
saved: "Enregistré"
|
||||
product_already_in_order: Ce produit a déjà été ajouté à la commande. Veuillez directement modifier la quantité.
|
||||
stock:
|
||||
out_of_stock: "Pas en stock"
|
||||
orders:
|
||||
number: Nombre
|
||||
confirm_edit: Voulez-vous vraiment modifier cette commande? Si vous poursuivez, la synchronisation automatique des modifications de l'abonnement pourrait être plus difficile à l'avenir.
|
||||
confirm_cancel_msg: Voulez-vous vraiment annuler cet abonnement? Cette action sera irréversible.
|
||||
cancel_failure_msg: 'Désolé, l''annulation a échoué!'
|
||||
confirm_pause_msg: Voulez-vous vraiment mettre en pause cet abonnement?
|
||||
pause_failure_msg: 'Désolé, la mise en pause a échoué!'
|
||||
confirm_unpause_msg: Voulez-vous vraiment annuler la mise en pause de cet abonnement?
|
||||
unpause_failure_msg: 'Désolé, l''annulation de la mise en pause a échoué!'
|
||||
confirm_cancel_msg: "Voulez-vous vraiment annuler cet abonnement? Cette action sera irréversible."
|
||||
cancel_failure_msg: "Désolé, l'annulation a échoué!"
|
||||
confirm_pause_msg: "Voulez-vous vraiment mettre en pause cet abonnement?"
|
||||
pause_failure_msg: "Désolé, la mise en pause a échoué!"
|
||||
unpause_failure_msg: "Désolé, l'annulation de la mise en pause a échoué!"
|
||||
confirm_cancel_open_orders_msg: "Cet abonnement a des commandes ouvertes. Les acheteurs ont été notifiés que leur commande allait être passée. Voulez-vous annulez ces commandes ou les conserver?"
|
||||
resume_canceled_orders_msg: "Certaines commandes pour cet abonnement peuvent être réouvertes dès maintenant. Vous pouvez les réouvrir depuis la liste des commandes."
|
||||
yes_cancel_them: Les annuler
|
||||
@@ -1393,6 +1398,7 @@ fr_BE:
|
||||
email_confirm_shop_number_html: "Confirmation de commande <strong>#%{number}</strong>"
|
||||
email_order_summary_item: "Produit"
|
||||
email_order_summary_quantity: "Qté"
|
||||
email_order_summary_sku: "Référence produit"
|
||||
email_order_summary_price: "Prix"
|
||||
email_order_summary_subtotal: "Sous-total:"
|
||||
email_order_summary_total: "Total:"
|
||||
@@ -2995,7 +3001,8 @@ fr_BE:
|
||||
confirmation_pending: "L'email de confirmation n'a pas encore été validé. Il a été envoyé à %{address}."
|
||||
variants:
|
||||
autocomplete:
|
||||
producer_name: Producteur
|
||||
producer_name: "Producteur"
|
||||
unit: "Unité"
|
||||
general_settings:
|
||||
edit:
|
||||
legal_settings: "Configuration légales"
|
||||
|
||||
@@ -982,6 +982,10 @@ fr_CA:
|
||||
this_is_an_estimate: |
|
||||
Les prix affichés ne sont qu'une estimation calculée au moment de la dernière modification de l'abonnement.Si vous modifiez les prix ou marges et commissions appliquées, les commandes seront mises à jour, mais l'abonnement affichera toujours les anciennes valeurs.
|
||||
not_in_open_and_upcoming_order_cycles_warning: "Il n'y a pas de cycle de vente ouvert ou à venir pour ce produit."
|
||||
autocomplete:
|
||||
name_or_sku: "NOM OU REF PRODUIT"
|
||||
quantity: "Quantité"
|
||||
add: "Ajouter"
|
||||
details:
|
||||
details: Informations
|
||||
invalid_error: Oups! Veuillez remplir tous les champs obligatoires...
|
||||
@@ -1002,15 +1006,16 @@ fr_CA:
|
||||
saving: "En cours d'enregistrement"
|
||||
saved: "Enregistré"
|
||||
product_already_in_order: Ce produit a déjà été ajouté à la commande. Veuillez directement modifier la quantité.
|
||||
stock:
|
||||
out_of_stock: "En rupture de stock"
|
||||
orders:
|
||||
number: Nombre
|
||||
confirm_edit: Voulez-vous vraiment modifier cette commande? Si vous poursuivez, la synchronisation automatique des modifications de l'abonnement pourrait être plus difficile à l'avenir.
|
||||
confirm_cancel_msg: Voulez-vous vraiment annuler cet abonnement? Cette action sera irréversible.
|
||||
cancel_failure_msg: 'Désolé, l''annulation a échoué!'
|
||||
confirm_pause_msg: Voulez-vous vraiment mettre en pause cet abonnement?
|
||||
pause_failure_msg: 'Désolé, la mise en pause a échoué!'
|
||||
confirm_unpause_msg: Voulez-vous vraiment annuler la mise en pause de cet abonnement?
|
||||
unpause_failure_msg: 'Désolé, l''annulation de la mise en pause a échoué!'
|
||||
confirm_cancel_msg: "Voulez-vous vraiment annuler cet abonnement? Cette action sera irréversible."
|
||||
cancel_failure_msg: "Désolé, l'annulation a échoué!"
|
||||
confirm_pause_msg: "Voulez-vous vraiment mettre en pause cet abonnement?"
|
||||
pause_failure_msg: "Désolé, la mise en pause a échoué!"
|
||||
unpause_failure_msg: "Désolé, l'annulation de la mise en pause a échoué!"
|
||||
confirm_cancel_open_orders_msg: "Cet abonnement a des commandes ouvertes. Les acheteurs ont été notifiés que leur commande allait être passée. Voulez-vous annulez ces commandes ou les conserver?"
|
||||
resume_canceled_orders_msg: "Certaines commandes pour cet abonnement peuvent être réouvertes dès maintenant. Vous pouvez les réouvrir depuis la liste des commandes."
|
||||
yes_cancel_them: Les annuler
|
||||
@@ -1363,6 +1368,7 @@ fr_CA:
|
||||
email_confirm_shop_number_html: "Confirmation de commande <strong>#%{number}</strong>"
|
||||
email_order_summary_item: "Produit"
|
||||
email_order_summary_quantity: "Qté"
|
||||
email_order_summary_sku: "Référence Produit"
|
||||
email_order_summary_price: "Prix"
|
||||
email_order_summary_subtotal: "Sous-total:"
|
||||
email_order_summary_total: "Total:"
|
||||
@@ -2919,7 +2925,8 @@ fr_CA:
|
||||
confirmation_pending: "L'email de confirmation n'a pas encore été validé. Il a été envoyé à %{address}."
|
||||
variants:
|
||||
autocomplete:
|
||||
producer_name: Producteur
|
||||
producer_name: "Producteur"
|
||||
unit: "Unité"
|
||||
general_settings:
|
||||
edit:
|
||||
legal_settings: "Configuration légales"
|
||||
|
||||
@@ -983,6 +983,10 @@ it:
|
||||
I prezzi visualizzati sono solo una stima e saranno calcolati nel momento in cui l'abbonamento verrà cambiato.
|
||||
Se cambi i prezzi o le tariffe, le gentili richieste saranno aggiornate, ma l'abbonamento visualizzerà ancora i valori precedenti
|
||||
not_in_open_and_upcoming_order_cycles_warning: "Non ci sono cicli di richieste aperte o in apertura per questo prodotto."
|
||||
autocomplete:
|
||||
name_or_sku: "NOME O SKU"
|
||||
quantity: "Quantità"
|
||||
add: "Aggiungi"
|
||||
details:
|
||||
details: Dettagli
|
||||
invalid_error: Oops! Per favore compila i campi obbligatori...
|
||||
@@ -1003,15 +1007,16 @@ it:
|
||||
saving: "SALVATAGGIO"
|
||||
saved: "SALVATO"
|
||||
product_already_in_order: Questo prodotto è già stato aggiunto alla gentile richiesta. Per favore modifica direttamente la quantità.
|
||||
stock:
|
||||
out_of_stock: "Esaurito"
|
||||
orders:
|
||||
number: Numero
|
||||
confirm_edit: Sei sicura/o di voler modificare questa gentile richiesta? Facendolo potrebbe essere più difficile in futuro sincronizzare le modifiche all'abbonamento
|
||||
confirm_cancel_msg: Sei sicura/o di voler eliminare questo abbonamento? Quest'azione non potrà essere annullata.
|
||||
cancel_failure_msg: 'Ci dispiace, eliminazione non riuscita!'
|
||||
confirm_pause_msg: Sei sicura/o di voler mettere in pausa questo abbonamento?
|
||||
pause_failure_msg: 'Spiacente, pausa fallita!'
|
||||
confirm_unpause_msg: Sei sicura/o di voler riprendere questo abbonamento?
|
||||
unpause_failure_msg: 'Ci dispiace, ripresa non riuscita!'
|
||||
confirm_cancel_msg: "Sei sicura/o di voler eliminare questo abbonamento? Quest'azione non potrà essere annullata."
|
||||
cancel_failure_msg: "Ci dispiace, eliminazione non riuscita!"
|
||||
confirm_pause_msg: "Sei sicura/o di voler mettere in pausa questo abbonamento?"
|
||||
pause_failure_msg: "Spiacente, pausa fallita!"
|
||||
unpause_failure_msg: "Ci dispiace, ripresa non riuscita!"
|
||||
confirm_cancel_open_orders_msg: "Alcune di queste richieste sono attualmente attive. I consumatori sono già stati avvisati che le richieste verranno soddisfatte. Vuoi eliminare questa/e richiesta/e o mantenerla?"
|
||||
resume_canceled_orders_msg: "Alcuni ordini per questo abbonamento possono essere ripresi in questo momento. Puoi riprenderli dal menu a discesa degli ordini."
|
||||
yes_cancel_them: Cancella l'articolo
|
||||
@@ -1364,6 +1369,7 @@ it:
|
||||
email_confirm_shop_number_html: "Conferma dell'Ordine <strong>#%{number}</strong>"
|
||||
email_order_summary_item: "Articolo"
|
||||
email_order_summary_quantity: "Qtà."
|
||||
email_order_summary_sku: "SKU"
|
||||
email_order_summary_price: "Prezzo"
|
||||
email_order_summary_subtotal: "Subtotale:"
|
||||
email_order_summary_total: "Totale:"
|
||||
@@ -2914,7 +2920,8 @@ it:
|
||||
confirmation_pending: "Email di conferma in sospeso. Abbiamo inviato una mail di conferma a %{address}."
|
||||
variants:
|
||||
autocomplete:
|
||||
producer_name: Produttore
|
||||
producer_name: "Produttore"
|
||||
unit: "Unità"
|
||||
general_settings:
|
||||
edit:
|
||||
legal_settings: "Impostazioni Legali"
|
||||
|
||||
@@ -14,7 +14,9 @@ nb:
|
||||
spree/product:
|
||||
primary_taxon: "Produktkategori"
|
||||
supplier: "Leverandør"
|
||||
shipping_category_id: "Leveringskategori"
|
||||
variant_unit: "Variant Enhet"
|
||||
variant_unit_name: "Enhetsnavn Variant"
|
||||
order_cycle:
|
||||
orders_close_at: Lukkedato
|
||||
errors:
|
||||
@@ -75,6 +77,8 @@ nb:
|
||||
user_confirmations:
|
||||
spree_user:
|
||||
send_instructions: "Du vil motta en epost med instruksjoner om hvordan du bekrefter kontoen din om noen få minutter."
|
||||
confirmation_sent: "Epostbekreftelse sendt"
|
||||
confirmation_not_sent: "Feil ved sending av bekreftelses-epost"
|
||||
user_registrations:
|
||||
spree_user:
|
||||
signed_up_but_unconfirmed: "En melding med en bekreftelseslink er sendt til epostadressen din. Vennligst åpne lenken for å aktivere kontoen din."
|
||||
@@ -85,9 +89,12 @@ nb:
|
||||
Var du gjest forrige gang? Kanskje du må opprette en konto eller nullstille passordet.
|
||||
unconfirmed: "Du må bekrefte kontoen din før du fortsetter."
|
||||
already_registered: "Denne epostadressen er allerede registrert. Vennligst logg inn for å fortsette, eller gå tilbake og bruk en annen epostadresse."
|
||||
success:
|
||||
logged_in_succesfully: "Innlogging vellykket"
|
||||
user_passwords:
|
||||
spree_user:
|
||||
updated_not_active: "Ditt passord har blitt tilbakestilt, men epostadressen din er ikke bekreftet enda."
|
||||
updated: "Passordendringen var vellykket. Du er nå pålogget."
|
||||
send_instructions: "Du vil motta en epost med instruksjoner om hvordan du bekrefter kontoen din om noen få minutter."
|
||||
models:
|
||||
order_cycle:
|
||||
@@ -321,6 +328,7 @@ nb:
|
||||
invoice_settings:
|
||||
edit:
|
||||
title: "Fakturainnstillinger"
|
||||
enable_invoices?: "Aktivér Fakturaer?"
|
||||
invoice_style2?: "Bruk den alternative fakturamodellen som inkluderer total avgiftsoppdeling pr rate og avgiftsrateinfo pr vare (passer ikke for land som viser priser ekskludert avgift)"
|
||||
enable_receipt_printing?: "Vis valg for utskrift av kvitteringer ved bruk av kvitteringsprinter i nedtrekksmeny for bestillinger? "
|
||||
stripe_connect_settings:
|
||||
@@ -648,6 +656,8 @@ nb:
|
||||
permalink_tip: "Denne permalinken brukes til å opprette url-en til din butikk: %{link}din-butikks-navn/shop"
|
||||
link_to_front: Lenke til butikkvindu
|
||||
link_to_front_tip: En direktelenke til ditt butikkvindu på Open Food Network.
|
||||
ofn_uid: OFN UID
|
||||
ofn_uid_tip: Den unike ID-en som brukes til å identifisere bedriften på Open Food Network.
|
||||
shipping_methods:
|
||||
name: Navn
|
||||
applies: Gjelder?
|
||||
@@ -829,6 +839,7 @@ nb:
|
||||
add_distributor: 'Legg til distributør'
|
||||
advanced_settings:
|
||||
title: Avanserte Innstillinger
|
||||
choose_product_tip: Du kan begrense innkommende og utgående produkter til kun %{inventory}s lagerbeholdning.
|
||||
preferred_product_selection_from_coordinator_inventory_only_here: Kun Koordinators varelager
|
||||
preferred_product_selection_from_coordinator_inventory_only_all: Alle tilgjengelige produkter
|
||||
save_reload: Lagre og last siden på nytt
|
||||
@@ -964,6 +975,8 @@ nb:
|
||||
pause_subscription: Pause abonnement
|
||||
unpause_subscription: Fortsett abonnement
|
||||
cancel_subscription: Avbryt abonnement
|
||||
filters:
|
||||
query_placeholder: "Søk på epost..."
|
||||
setup_explanation:
|
||||
just_a_few_more_steps: 'Bare noen få skritt før du kan begynne:'
|
||||
enable_subscriptions: "Aktiver abonnementer for minst en av butikkene dine"
|
||||
@@ -988,6 +1001,10 @@ nb:
|
||||
De viste prisene er bare et estimat og beregnet på det tidspunktet abonnementet endres.
|
||||
Hvis du endrer priser eller avgifter, vil ordrer bli oppdatert, men abonnementet vil fortsatt vise de gamle verdiene.
|
||||
not_in_open_and_upcoming_order_cycles_warning: "Det er ingen åpne eller kommende bestillingsrunder for dette produktet."
|
||||
autocomplete:
|
||||
name_or_sku: "NAME eller SKU"
|
||||
quantity: "Mengde"
|
||||
add: "Legg til"
|
||||
details:
|
||||
details: Detaljer
|
||||
invalid_error: Oops! Vennligst fyll inn alle obligatoriske felter...
|
||||
@@ -996,6 +1013,8 @@ nb:
|
||||
charges_not_allowed: Korttrekk er ikke tillatt av denne kunden
|
||||
no_default_card: Kunden har ingen kort tilgjengelig for å trekke
|
||||
card_ok: Kunden har et kort tilgjengelig for å trekke
|
||||
begins_at_placeholder: "Velg en dato"
|
||||
ends_at_placeholder: "Valgfri"
|
||||
loading_flash:
|
||||
loading: LASTER ABONNEMENT
|
||||
review:
|
||||
@@ -1008,15 +1027,18 @@ nb:
|
||||
saving: "LAGRER"
|
||||
saved: "LAGRET"
|
||||
product_already_in_order: Dette produktet er allerede lagt til i bestillingen. Vennligst rediger mengden direkte.
|
||||
stock:
|
||||
insufficient_stock: "Utilstrekkelig lager tilgjengelig"
|
||||
out_of_stock: "Ikke på Lager"
|
||||
orders:
|
||||
number: Antall
|
||||
confirm_edit: Er du sikker på at du vil redigere denne bestillingen? Å gjøre det kan gjøre det vanskeligere å automatisk synkronisere endringer i abonnementet i fremtiden.
|
||||
confirm_cancel_msg: Er du sikker på at du vil avbryte dette abonnementet? Denne handlingen kan ikke angres.
|
||||
cancel_failure_msg: 'Beklager, avbryting mislyktes!'
|
||||
confirm_pause_msg: Er du sikker på at du vil pause dette abonnementet?
|
||||
pause_failure_msg: 'Beklager, pause mislyktes!'
|
||||
confirm_unpause_msg: Er du sikker på at du vil fortsette dette abonnementet?
|
||||
unpause_failure_msg: 'Beklager, fortsettelse mislyktes!'
|
||||
confirm_cancel_msg: "Er du sikker på at du vil avbryte dette abonnementet? Denne handlingen kan ikke angres."
|
||||
cancel_failure_msg: "Beklager, avbryting mislyktes!"
|
||||
confirm_pause_msg: "Er du sikker på at du vil pause dette abonnementet?"
|
||||
pause_failure_msg: "Beklager, pause mislyktes!"
|
||||
confirm_unpause_msg: "Hvis du har en åpen bestillingsrundei for dette abonnementets tidsplan opprettes en bestilling for denne kunden. Er du sikker på at du vil sette i gang abonnementet?"
|
||||
unpause_failure_msg: "Beklager, fortsettelse mislyktes!"
|
||||
confirm_cancel_open_orders_msg: "Noen bestillinger for dette abonnementet er for øyeblikket åpne. Kunden har allerede blitt varslet om at bestillingen vil bli lagt inn. Vil du avbryte disse bestillingene eller beholde dem?"
|
||||
resume_canceled_orders_msg: "Noen bestillinger for dette abonnementet kan gjenopptas akkurat nå. Du kan gjenoppta dem fra nedtrekksmenyen for bestillinger."
|
||||
yes_cancel_them: Avbryt dem
|
||||
@@ -1095,7 +1117,11 @@ nb:
|
||||
shop:
|
||||
messages:
|
||||
login: "innlogging"
|
||||
signup: "melde deg på"
|
||||
contact: "kontakt"
|
||||
require_customer_login: "Kun godkjente kunder kan få tilgang til denne butikken."
|
||||
require_login_html: "Hvis du allerede er en godkjent kunde, kan du fortsette %{login} eller %{signup}. Vil du begynne å handle her? Vennligst %{contact} %{enterprise} og spør om å bli med."
|
||||
require_customer_html: "Hvis du vil begynne å handle her, vennligst %{contact} %{enterprise} for å spørre om å bli med."
|
||||
card_could_not_be_updated: Kortet kunne ikke oppdateres
|
||||
card_could_not_be_saved: kort kunne ikke lagres
|
||||
spree_gateway_error_flash_for_checkout: "Det oppstod et problem med betalingsinformasjonen din: %{error}"
|
||||
@@ -1374,6 +1400,7 @@ nb:
|
||||
email_confirm_shop_number_html: "Ordrebekreftelse <strong>#%{number}</strong>"
|
||||
email_order_summary_item: "Vare"
|
||||
email_order_summary_quantity: "Stk"
|
||||
email_order_summary_sku: "SKU"
|
||||
email_order_summary_price: "Pris"
|
||||
email_order_summary_subtotal: "Delsum:"
|
||||
email_order_summary_total: "Sum:"
|
||||
@@ -1684,6 +1711,7 @@ nb:
|
||||
introduction:
|
||||
registration_greeting: "Hei der!"
|
||||
registration_intro: "Du kan nå opprette en profil for din Produsent eller Hub"
|
||||
registration_checklist: "Hva trenger jeg?"
|
||||
registration_time: "5-10 minutter"
|
||||
registration_enterprise_address: "Bedriftsadresse"
|
||||
registration_contact_details: "Kontaktdetaljer"
|
||||
@@ -1938,6 +1966,7 @@ nb:
|
||||
spree_admin_supplier: Leverandør
|
||||
spree_admin_product_category: Produktkategori
|
||||
spree_admin_variant_unit_name: Variant enhetsnavn
|
||||
unit_name: "Enhetsnavn"
|
||||
change_package: "Endre Pakke"
|
||||
spree_admin_single_enterprise_hint: "Hint: For å hjelpe folk til å finne deg, skru på din synlighet under"
|
||||
spree_admin_eg_pickup_from_school: "f.eks. 'Henting ved Sammfunnshuset'"
|
||||
@@ -2173,6 +2202,7 @@ nb:
|
||||
payment_methods: "Betalingsmetoder"
|
||||
payment_method_fee: "Transaksjongebyr"
|
||||
payment_processing_failed: "Betalingen kunne ikke behandles, vennligst sjekk detaljene du skrev inn"
|
||||
payment_method_not_supported: "Den betalingsmåten støttes ikke. Velg en annen."
|
||||
payment_updated: "Betaling Oppdatert"
|
||||
inventory_settings: "Beholdningsinnstillinger"
|
||||
tag_rules: "Regler merkelapper"
|
||||
@@ -2751,6 +2781,7 @@ nb:
|
||||
inventory: Varelager
|
||||
zipcode: Postnummer
|
||||
weight: Vekt (per kg)
|
||||
error_user_destroy_with_orders: "Brukere med fullførte ordrer kan ikke slettes"
|
||||
actions:
|
||||
update: "Oppdater"
|
||||
errors:
|
||||
@@ -2889,6 +2920,7 @@ nb:
|
||||
error_saving_payment: Feil ved lagring av betaling
|
||||
submitting_payment: Sender inn betaling...
|
||||
products:
|
||||
image_upload_error: "Produktbildet ble ikke gjenkjent. Last opp et bilde i PNG- eller JPG-format."
|
||||
new:
|
||||
title: 'Nytt produkt'
|
||||
unit_name_placeholder: 'f.eks. bunter'
|
||||
@@ -2958,7 +2990,8 @@ nb:
|
||||
confirmation_pending: "Epostbekreftelse venter. Vi har sendt en bekreftelses-epost til %{address}."
|
||||
variants:
|
||||
autocomplete:
|
||||
producer_name: Produsent
|
||||
producer_name: "Produsent"
|
||||
unit: "Enhet"
|
||||
general_settings:
|
||||
edit:
|
||||
legal_settings: "Juridiske innstillinger"
|
||||
|
||||
@@ -1003,6 +1003,10 @@ nl_BE:
|
||||
De afgebeelde prijzen zijn slechts een schatting en worden berekend op het moment dat het abonnement is veranderd.
|
||||
Als je de prijzen of kosten verandert, zullen de bestellingen worden geüpdatet, maar het abonnement zal nog steeds de oude waarden weergeven.
|
||||
not_in_open_and_upcoming_order_cycles_warning: "Er zijn geen openstaande of naderende bestellingscycli voor dit product."
|
||||
autocomplete:
|
||||
name_or_sku: "BESCHRIJVING OF ARTKELNUMMER"
|
||||
quantity: "Kwantiteit"
|
||||
add: "Voeg toe"
|
||||
details:
|
||||
details: Details
|
||||
invalid_error: Oops! Gelieve al de gevraagde velden in te vullen...
|
||||
@@ -1025,15 +1029,16 @@ nl_BE:
|
||||
saving: "Aan het opslaan"
|
||||
saved: "Opgeslaan"
|
||||
product_already_in_order: Dit product is al eens toegevoegd aan de bestelling. Gelieve rechtstreeks de hoeveelheid aan te passen.
|
||||
stock:
|
||||
out_of_stock: "Geen voorraad"
|
||||
orders:
|
||||
number: Nummer
|
||||
confirm_edit: Ben je zeker dat je deze bestelling wil aanpassen? Indien je hiermee wenst verder te gaan is het mogelijk dat in de toekomst het moeilijker wordt om automatisch de veranderingen in het abonnement te synchroniseren.
|
||||
confirm_cancel_msg: Ben je zeker dat je dit abonnement wil annuleren? Deze actie kan niet ongedaan worden gemaakt.
|
||||
cancel_failure_msg: 'Sorry, de annulatie is mislukt!'
|
||||
confirm_pause_msg: Ben je zeker dat je dit abonnement wil pauseren?
|
||||
pause_failure_msg: 'Sorry, pauseren mislukt!'
|
||||
confirm_unpause_msg: Ben je zeker dat je dit abonnement wil hervatten?
|
||||
unpause_failure_msg: 'Sorry, hervatten mislukt!'
|
||||
confirm_cancel_msg: "Ben je zeker dat je dit abonnement wil annuleren? Deze actie kan niet ongedaan worden gemaakt."
|
||||
cancel_failure_msg: "Sorry, de annulatie is mislukt!"
|
||||
confirm_pause_msg: "Ben je zeker dat je dit abonnement wil pauseren?"
|
||||
pause_failure_msg: "Sorry, pauseren mislukt!"
|
||||
unpause_failure_msg: "Sorry, hervatten mislukt!"
|
||||
confirm_cancel_open_orders_msg: "Sommige bestellingen voor deze abonnementen zijn nog niet afgerond. De klant werd al op de hoogte gebracht dat deze bestelling geplaatst zullen worden. Wil je graag dat deze bestelling(en) geannuleerd worden of wil je ze behouden?"
|
||||
resume_canceled_orders_msg: "Sommige bestellingen voor de abonnementen kunnen nu hervat worden. Je kan verdergaan vanuit het dropdownmenu bij bestellingen."
|
||||
yes_cancel_them: 'Annuleer ze '
|
||||
@@ -1395,6 +1400,7 @@ nl_BE:
|
||||
email_confirm_shop_number_html: "Bestellingsbevestiging <strong>#%{number}</strong>"
|
||||
email_order_summary_item: "Artikel"
|
||||
email_order_summary_quantity: "Aantal"
|
||||
email_order_summary_sku: "SKU"
|
||||
email_order_summary_price: "Prijs"
|
||||
email_order_summary_subtotal: "Tussentotaal:"
|
||||
email_order_summary_total: "Totaal:"
|
||||
@@ -2990,7 +2996,8 @@ nl_BE:
|
||||
confirmation_pending: "De validatie van de bevestigins e-mail naar %{address} toegestuurd is nog niet toegekomen."
|
||||
variants:
|
||||
autocomplete:
|
||||
producer_name: Producent
|
||||
producer_name: "Producent"
|
||||
unit: "Unit"
|
||||
general_settings:
|
||||
edit:
|
||||
legal_settings: "De legale instelling"
|
||||
|
||||
@@ -988,6 +988,10 @@ pt:
|
||||
Os preços mostrados são apenas estimativas e são calculados no momento em que a subscrição é mudada.
|
||||
Se mudar preços ou taxas, as encomendas serão atualizadas, mas a subscrição ainda mostrará os preços anteriores.
|
||||
not_in_open_and_upcoming_order_cycles_warning: "Não há ciclos de encomenda abertos ou que estejam para abrir para este produto."
|
||||
autocomplete:
|
||||
name_or_sku: "NOME OU CÓDIGO"
|
||||
quantity: "Quantidade"
|
||||
add: "Adicionar"
|
||||
details:
|
||||
details: Detalhes
|
||||
invalid_error: Ooops! Por favor preencha todos os campos obrigatórios...
|
||||
@@ -1008,15 +1012,16 @@ pt:
|
||||
saving: "A GUARDAR"
|
||||
saved: "GUARDADO"
|
||||
product_already_in_order: Este produto já foi adicionado à encomenda. Por favor edite a quantidade directamente.
|
||||
stock:
|
||||
out_of_stock: "Sem Stock"
|
||||
orders:
|
||||
number: Número
|
||||
confirm_edit: Tem a certeza que quer editar esta encomenda? Ao fazê-lo pode tornar-se mais difícil sincronizar alterações automaticamente com a subscrição no futuro.
|
||||
confirm_cancel_msg: Tem a certeza que pretende cancelar esta subscrição? Esta acção não pode ser desfeita.
|
||||
cancel_failure_msg: 'Desculpe, o cancelamento falhou!'
|
||||
confirm_pause_msg: Tem a certeza que deseja pausar esta subscrição?
|
||||
pause_failure_msg: 'Desculpe, a pausa falhou!'
|
||||
confirm_unpause_msg: Tem a certeza que pretende parar a pausa desta subscrição?
|
||||
unpause_failure_msg: 'Desculpe, não foi possível parar a pausa!'
|
||||
confirm_cancel_msg: "Tem a certeza que pretende cancelar esta subscrição? Esta acção não pode ser desfeita."
|
||||
cancel_failure_msg: "Desculpe, o cancelamento falhou!"
|
||||
confirm_pause_msg: "Tem a certeza que deseja pausar esta subscrição?"
|
||||
pause_failure_msg: "Desculpe, a pausa falhou!"
|
||||
unpause_failure_msg: "Desculpe, não foi possível parar a pausa!"
|
||||
confirm_cancel_open_orders_msg: "Algumas encomendas para esta subscrição estão actualmente abertas. O/a consumidor/a foi notificado que a encomenda será processada. Quer cancelar esta(s) encomenda(s) ou mantê-las?"
|
||||
resume_canceled_orders_msg: "Algumas encomendas desta subscrição podem ser retomadas neste momento. Para retomá-las, selecione no menu dropdown de encomendas."
|
||||
yes_cancel_them: Cancelá-las
|
||||
@@ -1370,6 +1375,7 @@ pt:
|
||||
email_confirm_shop_number_html: "Confirmação de encomenda <strong>#%{number}</strong>"
|
||||
email_order_summary_item: "Item"
|
||||
email_order_summary_quantity: "Qtd"
|
||||
email_order_summary_sku: "SKU"
|
||||
email_order_summary_price: "Preço"
|
||||
email_order_summary_subtotal: "Subtotal:"
|
||||
email_order_summary_total: "Total:"
|
||||
@@ -2923,7 +2929,8 @@ pt:
|
||||
confirmation_pending: "A confirmação de email está pendente. Enviamos um email de confirmação para %{address}"
|
||||
variants:
|
||||
autocomplete:
|
||||
producer_name: Produtor
|
||||
producer_name: "Produtor"
|
||||
unit: "Unidade"
|
||||
general_settings:
|
||||
edit:
|
||||
legal_settings: "Configurações Legais"
|
||||
|
||||
@@ -593,6 +593,9 @@ sv:
|
||||
packing:
|
||||
name: Förpackningsrapporter
|
||||
subscriptions:
|
||||
autocomplete:
|
||||
quantity: "Antal"
|
||||
add: "Tillägga"
|
||||
review:
|
||||
address: Adress
|
||||
products: Produkter
|
||||
@@ -848,6 +851,7 @@ sv:
|
||||
email_confirm_shop_number_html: "Orderbekräftelse <strong>#%{number}</strong>"
|
||||
email_order_summary_item: "Artikel"
|
||||
email_order_summary_quantity: "Antal"
|
||||
email_order_summary_sku: "SKU"
|
||||
email_order_summary_price: "Pris"
|
||||
email_order_summary_subtotal: "Delsumma:"
|
||||
email_order_summary_total: "Total:"
|
||||
@@ -2021,7 +2025,8 @@ sv:
|
||||
password: "Lösenord"
|
||||
variants:
|
||||
autocomplete:
|
||||
producer_name: Producent
|
||||
producer_name: "Producent"
|
||||
unit: "Enhet"
|
||||
general_settings:
|
||||
edit:
|
||||
enterprises_require_tos: "Företag måste acceptera servicevillkoren"
|
||||
|
||||
@@ -34,9 +34,9 @@ def prompt_for_admin_email
|
||||
end
|
||||
|
||||
def create_admin_user
|
||||
if ENV['AUTO_ACCEPT']
|
||||
password = 'spree123'
|
||||
email = 'spree@example.com'
|
||||
if ENV.fetch("AUTO_ACCEPT", true)
|
||||
password = ENV.fetch("ADMIN_PASSWORD", "spree123").dup
|
||||
email = ENV.fetch("ADMIN_EMAIL", "spree@example.com").dup
|
||||
else
|
||||
puts 'Create the admin user (press enter for defaults).'
|
||||
#name = prompt_for_admin_name unless name
|
||||
@@ -56,6 +56,8 @@ def create_admin_user
|
||||
say "\nWARNING: There is already a user with the email: #{email}, so no account changes were made. If you wish to create an additional admin user, please run rake spree_auth:admin:create again with a different email.\n\n"
|
||||
else
|
||||
admin = Spree::User.new(attributes)
|
||||
admin.skip_confirmation!
|
||||
admin.skip_confirmation_notification!
|
||||
if admin.save
|
||||
role = Spree::Role.find_or_create_by_name 'admin'
|
||||
admin.spree_roles << role
|
||||
@@ -70,13 +72,4 @@ def create_admin_user
|
||||
end
|
||||
end
|
||||
|
||||
if Spree::User.admin.empty?
|
||||
create_admin_user
|
||||
else
|
||||
puts 'Admin user has already been previously created.'
|
||||
if agree('Would you like to create a new admin user? (yes/no)')
|
||||
create_admin_user
|
||||
else
|
||||
puts 'No admin user created.'
|
||||
end
|
||||
end
|
||||
create_admin_user if Spree::User.admin.empty?
|
||||
|
||||
@@ -48,7 +48,7 @@ states.each do |state|
|
||||
end
|
||||
end
|
||||
|
||||
spree_user = Spree::User.first
|
||||
spree_user && spree_user.confirm!
|
||||
# Create users:
|
||||
require File.join(File.dirname(__FILE__), 'default', 'users')
|
||||
|
||||
DefaultStockLocation.find_or_create
|
||||
|
||||
@@ -11,7 +11,8 @@ module OpenFoodNetwork
|
||||
when ActiveRecord::Relation
|
||||
@subscriptions = subscriptions.not_ended.not_canceled
|
||||
else
|
||||
raise "ProxyOrderSyncer must be initialized with an instance of Subscription or ActiveRecord::Relation"
|
||||
raise "ProxyOrderSyncer must be initialized with " \
|
||||
"an instance of Subscription or ActiveRecord::Relation"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -74,7 +75,9 @@ module OpenFoodNetwork
|
||||
end
|
||||
|
||||
def in_range_order_cycles
|
||||
order_cycles.where('orders_close_at >= ? AND orders_close_at <= ?', begins_at, ends_at || 100.years.from_now)
|
||||
order_cycles.where("orders_close_at >= ? AND orders_close_at <= ?",
|
||||
begins_at,
|
||||
ends_at || 100.years.from_now)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -41,7 +41,11 @@ module OpenFoodNetwork
|
||||
# - updates variant_override.count_on_hand
|
||||
# - does not create stock_movement
|
||||
# - does not update stock_item.count_on_hand
|
||||
# If it is a variant override with on_demand:
|
||||
# - don't change stock or call super (super would change the variant's stock)
|
||||
def move(quantity, originator = nil)
|
||||
return if @variant_override.andand.on_demand
|
||||
|
||||
if @variant_override.andand.stock_overridden?
|
||||
@variant_override.move_stock! quantity
|
||||
else
|
||||
|
||||
@@ -583,7 +583,7 @@ describe Admin::SubscriptionsController, type: :controller do
|
||||
end
|
||||
|
||||
context 'json' do
|
||||
let(:params) { { format: :json, id: subscription.id } }
|
||||
let(:params) { { format: :json, id: subscription.id, subscription: {} } }
|
||||
|
||||
context 'as a regular user' do
|
||||
it 'redirects to unauthorized' do
|
||||
@@ -664,6 +664,15 @@ describe Admin::SubscriptionsController, type: :controller do
|
||||
expect(json_response['id']).to eq subscription.id
|
||||
expect(subscription.reload.paused_at).to be nil
|
||||
end
|
||||
|
||||
context "when there is an open OC and no associated orders exist yet for it (OC was opened when the subscription was paused)" do
|
||||
it "creates an associated order" do
|
||||
spree_put :unpause, params
|
||||
|
||||
expect(subscription.reload.paused_at).to be nil
|
||||
expect(subscription.proxy_orders.size).to be 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -742,7 +742,7 @@ feature '
|
||||
end
|
||||
end
|
||||
|
||||
describe "Updating product image with new upload interface" do
|
||||
describe "Updating product image" do
|
||||
let!(:product) { create(:simple_product, name: "Carrots") }
|
||||
|
||||
it "displays product images and image upload modal" do
|
||||
@@ -755,6 +755,7 @@ feature '
|
||||
|
||||
# Shows default image when no image set
|
||||
expect(page).to have_css "img[src='/assets/noimage/mini.png']"
|
||||
@old_thumb_src = page.find("a.image-modal img")['src']
|
||||
|
||||
# Click image
|
||||
page.find("a.image-modal").click
|
||||
@@ -780,7 +781,7 @@ feature '
|
||||
within "table#listing_products tr#p_#{product.id}" do
|
||||
# New thumbnail is shown in image column
|
||||
@new_thumb_src = page.find("a.image-modal img")['src']
|
||||
expect(@old_thumb_src) != @new_thumb_src
|
||||
expect(@old_thumb_src).not_to eq @new_thumb_src
|
||||
|
||||
page.find("a.image-modal").click
|
||||
end
|
||||
|
||||
@@ -223,25 +223,25 @@ feature '
|
||||
let!(:different_shipping_method_for_distributor1) { create(:shipping_method, name: "Different", distributors: [distributor1]) }
|
||||
let!(:shipping_method_for_distributor2) { create(:shipping_method, name: "Other", distributors: [distributor2]) }
|
||||
|
||||
let!(:order) do
|
||||
create(:order_with_taxes, distributor: distributor1, ship_address: create(:address),
|
||||
product_price: 110, tax_rate_amount: 0.1,
|
||||
tax_rate_name: "Tax 1").tap do |record|
|
||||
Spree::TaxRate.adjust(record)
|
||||
record.update_shipping_fees!
|
||||
end
|
||||
end
|
||||
|
||||
background do
|
||||
Spree::Config[:enable_receipt_printing?] = true
|
||||
|
||||
distributor1.update_attribute(:abn, '12345678')
|
||||
@order = create(:order_with_taxes,
|
||||
distributor: distributor1,
|
||||
ship_address: create(:address),
|
||||
product_price: 110,
|
||||
tax_rate_amount: 0.1,
|
||||
tax_rate_name: "Tax 1")
|
||||
Spree::TaxRate.adjust(@order)
|
||||
@order.update_shipping_fees!
|
||||
|
||||
visit spree.edit_admin_order_path(@order)
|
||||
visit spree.edit_admin_order_path(order)
|
||||
end
|
||||
|
||||
scenario "shows a list of line_items" do
|
||||
within('table.index tbody', match: :first) do
|
||||
@order.line_items.each do |item|
|
||||
order.line_items.each do |item|
|
||||
expect(page).to have_selector "td", match: :first, text: item.full_name
|
||||
expect(page).to have_selector "td.item-price", text: item.single_display_amount
|
||||
expect(page).to have_selector "input#quantity[value='#{item.quantity}']", visible: false
|
||||
@@ -252,13 +252,13 @@ feature '
|
||||
|
||||
scenario "shows the order items total" do
|
||||
within('fieldset#order-total') do
|
||||
expect(page).to have_selector "span.order-total", text: @order.display_item_total
|
||||
expect(page).to have_selector "span.order-total", text: order.display_item_total
|
||||
end
|
||||
end
|
||||
|
||||
scenario "shows the order non-tax adjustments" do
|
||||
within('table.index tbody') do
|
||||
@order.adjustments.eligible.each do |adjustment|
|
||||
order.adjustments.eligible.each do |adjustment|
|
||||
expect(page).to have_selector "td", match: :first, text: adjustment.label
|
||||
expect(page).to have_selector "td.total", text: adjustment.display_amount
|
||||
end
|
||||
@@ -266,7 +266,7 @@ feature '
|
||||
end
|
||||
|
||||
scenario "shows the order total" do
|
||||
expect(page).to have_selector "fieldset#order-total", text: @order.display_total
|
||||
expect(page).to have_selector "fieldset#order-total", text: order.display_total
|
||||
end
|
||||
|
||||
scenario "shows the order tax adjustments" do
|
||||
@@ -279,10 +279,10 @@ feature '
|
||||
scenario "shows the dropdown menu" do
|
||||
find("#links-dropdown .ofn-drop-down").click
|
||||
within "#links-dropdown" do
|
||||
expect(page).to have_link "Resend Confirmation", href: spree.resend_admin_order_path(@order)
|
||||
expect(page).to have_link "Send Invoice", href: spree.invoice_admin_order_path(@order)
|
||||
expect(page).to have_link "Print Invoice", href: spree.print_admin_order_path(@order)
|
||||
expect(page).to have_link "Cancel Order", href: spree.fire_admin_order_path(@order, e: 'cancel')
|
||||
expect(page).to have_link "Resend Confirmation", href: spree.resend_admin_order_path(order)
|
||||
expect(page).to have_link "Send Invoice", href: spree.invoice_admin_order_path(order)
|
||||
expect(page).to have_link "Print Invoice", href: spree.print_admin_order_path(order)
|
||||
expect(page).to have_link "Cancel Order", href: spree.fire_admin_order_path(order, e: 'cancel')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -327,27 +327,27 @@ feature '
|
||||
print_data = page.evaluate_script('printData');
|
||||
elements_in_print_data =
|
||||
[
|
||||
@order.distributor.name,
|
||||
@order.distributor.address.address_part1,
|
||||
@order.distributor.address.address_part2,
|
||||
@order.distributor.contact.email,
|
||||
@order.number,
|
||||
@order.line_items.map { |line_item|
|
||||
order.distributor.name,
|
||||
order.distributor.address.address_part1,
|
||||
order.distributor.address.address_part2,
|
||||
order.distributor.contact.email,
|
||||
order.number,
|
||||
order.line_items.map { |line_item|
|
||||
[line_item.quantity.to_s,
|
||||
line_item.product.name,
|
||||
line_item.single_display_amount_with_adjustments.format(symbol: false, with_currency: false),
|
||||
line_item.display_amount_with_adjustments.format(symbol: false, with_currency: false)]
|
||||
},
|
||||
checkout_adjustments_for(@order, exclude: [:line_item]).reject { |a| a.amount == 0 }.map { |adjustment|
|
||||
checkout_adjustments_for(order, exclude: [:line_item]).reject { |a| a.amount == 0 }.map { |adjustment|
|
||||
[raw(adjustment.label),
|
||||
display_adjustment_amount(adjustment).format(symbol: false, with_currency: false)]
|
||||
},
|
||||
@order.display_total.format(with_currency: false),
|
||||
display_checkout_taxes_hash(@order).map { |tax_rate, tax_value|
|
||||
order.display_total.format(with_currency: false),
|
||||
display_checkout_taxes_hash(order).map { |tax_rate, tax_value|
|
||||
[tax_rate,
|
||||
tax_value.format(with_currency: false)]
|
||||
},
|
||||
display_checkout_total_less_tax(@order).format(with_currency: false)
|
||||
display_checkout_total_less_tax(order).format(with_currency: false)
|
||||
]
|
||||
expect(print_data.join).to include(*elements_in_print_data.flatten)
|
||||
end
|
||||
@@ -363,6 +363,20 @@ feature '
|
||||
|
||||
expect(page.find("td.amount")).to have_content "$5.00"
|
||||
end
|
||||
|
||||
context "when an included variant has been deleted" do
|
||||
let!(:deleted_variant) do
|
||||
order.line_items.first.variant.tap do |record|
|
||||
record.delete
|
||||
end
|
||||
end
|
||||
|
||||
it "still lists the variant in the order page" do
|
||||
within ".stock-contents" do
|
||||
expect(page).to have_content deleted_variant.product_and_full_name
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
scenario "creating an order with distributor and order cycle" do
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
require 'spec_helper'
|
||||
|
||||
feature 'External services' do
|
||||
include AuthenticationWorkflow
|
||||
include WebHelper
|
||||
|
||||
describe "bugherd" do
|
||||
describe "limiting inclusion by environment" do
|
||||
before { Spree::Config.bugherd_api_key = 'abc123' }
|
||||
|
||||
it "is not included in test" do
|
||||
visit root_path
|
||||
expect(script_content(with: 'bugherd')).to be_nil
|
||||
end
|
||||
|
||||
it "is not included in dev" do
|
||||
allow(Rails.env).to receive(:development?) { true }
|
||||
visit root_path
|
||||
expect(script_content(with: 'bugherd')).to be_nil
|
||||
end
|
||||
|
||||
it "is included in staging" do
|
||||
allow(Rails.env).to receive(:staging?) { true }
|
||||
visit root_path
|
||||
expect(script_content(with: 'bugherd')).not_to be_nil
|
||||
end
|
||||
|
||||
it "is included in production" do
|
||||
allow(Rails.env).to receive(:production?) { true }
|
||||
visit root_path
|
||||
expect(script_content(with: 'bugherd')).not_to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
context "in an environment where BugHerd is displayed" do
|
||||
before { allow(Rails.env).to receive(:staging?) { true } }
|
||||
|
||||
context "when there is no API key set" do
|
||||
before { Spree::Config.bugherd_api_key = nil }
|
||||
|
||||
it "does not include the BugHerd script" do
|
||||
visit root_path
|
||||
expect(script_content(with: 'bugherd')).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
context "when an API key is set" do
|
||||
before { Spree::Config.bugherd_api_key = 'abc123' }
|
||||
|
||||
it "includes the BugHerd script, with the correct API key" do
|
||||
visit root_path
|
||||
expect(script_content(with: 'bugherd')).to include 'abc123'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -112,6 +112,7 @@ feature "As a consumer I want to shop with a distributor", js: true do
|
||||
# that we are not filling in the quantity on the outgoing row
|
||||
page.should_not have_selector "tr.product-cart"
|
||||
within('product:not(.ng-leave)') { fill_in "variants[#{variant.id}]", with: 1 }
|
||||
show_cart
|
||||
within("li.cart") { page.should have_content with_currency(19.99) }
|
||||
end
|
||||
|
||||
|
||||
@@ -16,12 +16,14 @@ feature "shopping with variant overrides defined", js: true do
|
||||
let(:product1) { create(:simple_product, supplier: producer) }
|
||||
let(:product2) { create(:simple_product, supplier: producer) }
|
||||
let(:product3) { create(:simple_product, supplier: producer, on_demand: true) }
|
||||
let(:product4) { create(:simple_product, supplier: producer) }
|
||||
let(:product1_variant1) { create(:variant, product: product1, price: 11.11, unit_value: 1) }
|
||||
let(:product1_variant2) { create(:variant, product: product1, price: 22.22, unit_value: 2) }
|
||||
let(:product2_variant1) { create(:variant, product: product2, price: 33.33, unit_value: 3) }
|
||||
let(:product1_variant3) { create(:variant, product: product1, price: 44.44, unit_value: 4) }
|
||||
let(:product3_variant1) { create(:variant, product: product3, price: 55.55, unit_value: 5, on_demand: true) }
|
||||
let(:product3_variant2) { create(:variant, product: product3, price: 66.66, unit_value: 6, on_demand: true) }
|
||||
let(:product4_variant1) { create(:variant, product: product4, price: 77.77, unit_value: 7) }
|
||||
let!(:product1_variant1_override) { create(:variant_override, :use_producer_stock_settings, hub: hub, variant: product1_variant1, price: 55.55, count_on_hand: nil, default_stock: nil, resettable: false) }
|
||||
let!(:product1_variant2_override) { create(:variant_override, hub: hub, variant: product1_variant2, count_on_hand: 0, default_stock: nil, resettable: false) }
|
||||
let!(:product2_variant1_override) { create(:variant_override, hub: hub, variant: product2_variant1, count_on_hand: 0, default_stock: nil, resettable: false) }
|
||||
@@ -29,9 +31,10 @@ feature "shopping with variant overrides defined", js: true do
|
||||
let!(:product3_variant1_override) { create(:variant_override, hub: hub, variant: product3_variant1, count_on_hand: 0, default_stock: nil, resettable: false) }
|
||||
let!(:product3_variant2_override) { create(:variant_override, hub: hub, variant: product3_variant2, count_on_hand: 6, default_stock: nil, resettable: false) }
|
||||
let(:enterprise_fee) { create(:enterprise_fee, enterprise: hub, fee_type: 'packing', calculator: Calculator::FlatPercentPerItem.new(preferred_flat_percent: 10)) }
|
||||
let!(:product4_variant1_override) { create(:variant_override, hub: hub, variant: product4_variant1, count_on_hand: nil, on_demand: true, default_stock: nil, resettable: false) }
|
||||
|
||||
before do
|
||||
outgoing_exchange.variants = [product1_variant1, product1_variant2, product2_variant1, product1_variant3, product3_variant1, product3_variant2]
|
||||
outgoing_exchange.variants = [product1_variant1, product1_variant2, product2_variant1, product1_variant3, product3_variant1, product3_variant2, product4_variant1]
|
||||
outgoing_exchange.enterprise_fees << enterprise_fee
|
||||
sm.calculator.preferred_amount = 0
|
||||
visit shops_path
|
||||
@@ -146,6 +149,15 @@ feature "shopping with variant overrides defined", js: true do
|
||||
product1_variant1_override.reload.count_on_hand.should be_nil
|
||||
end
|
||||
|
||||
it "does not subtract stock from variants where the override has on_demand: true" do
|
||||
fill_in "variants[#{product4_variant1.id}]", with: "2"
|
||||
click_checkout
|
||||
expect do
|
||||
complete_checkout
|
||||
end.to change { product4_variant1.reload.on_hand }.by(0)
|
||||
expect(product4_variant1_override.reload.count_on_hand).to be_nil
|
||||
end
|
||||
|
||||
it "does not show out of stock flags on order confirmation page" do
|
||||
product1_variant3.on_hand = 0
|
||||
fill_in "variants[#{product1_variant3.id}]", with: "2"
|
||||
|
||||
@@ -49,6 +49,18 @@ describe InjectionHelper, type: :helper do
|
||||
expect(helper.inject_current_order).to match order.id.to_s
|
||||
end
|
||||
|
||||
describe "injects current order cycle" do
|
||||
it "injects empty json object (not nil) when current OC is null" do
|
||||
allow(helper).to receive(:current_order_cycle).and_return nil
|
||||
expect(helper.inject_current_order_cycle).to match "{}"
|
||||
end
|
||||
|
||||
it "injects current OC when OC not null" do
|
||||
allow(helper).to receive(:current_order_cycle).and_return order_cycle = create(:simple_order_cycle)
|
||||
expect(helper.inject_current_order_cycle).to match order_cycle.id.to_s
|
||||
end
|
||||
end
|
||||
|
||||
it "injects taxons" do
|
||||
taxon = create(:taxon)
|
||||
expect(helper.inject_taxons).to match taxon.name
|
||||
|
||||
@@ -5,7 +5,11 @@ module OpenFoodNetwork
|
||||
describe ScopeVariantToHub do
|
||||
let(:hub) { create(:distributor_enterprise) }
|
||||
let(:v) { create(:variant, price: 11.11, on_hand: 1, on_demand: true, sku: "VARIANTSKU") }
|
||||
let(:v2) { create(:variant, price: 22.22, on_hand: 5) }
|
||||
let(:v3) { create(:variant, price: 33.33, on_hand: 6) }
|
||||
let(:vo) { create(:variant_override, hub: hub, variant: v, price: 22.22, count_on_hand: 2, on_demand: false, sku: "VOSKU") }
|
||||
let(:vo2) { create(:variant_override, hub: hub, variant: v2, price: 33.33, count_on_hand: nil, on_demand: true) }
|
||||
let(:vo3) { create(:variant_override, hub: hub, variant: v3, price: 44.44, count_on_hand: 16) }
|
||||
let(:vo_price_only) { create(:variant_override, :use_producer_stock_settings, hub: hub, variant: v, price: 22.22) }
|
||||
let(:scoper) { ScopeVariantToHub.new(hub) }
|
||||
|
||||
@@ -160,6 +164,37 @@ module OpenFoodNetwork
|
||||
end
|
||||
end
|
||||
|
||||
describe "overriding #move" do
|
||||
context "when override is on_demand" do
|
||||
before do
|
||||
vo2
|
||||
scoper.scope v2
|
||||
end
|
||||
|
||||
it "doesn't reduce variant's stock" do
|
||||
v2.move(-2)
|
||||
expect(Spree::Variant.find(v2.id).on_hand).to eq 5
|
||||
end
|
||||
end
|
||||
|
||||
context "when stock is overridden" do
|
||||
before do
|
||||
vo3
|
||||
scoper.scope v3
|
||||
end
|
||||
|
||||
it "reduces the override's stock" do
|
||||
v3.move(-2)
|
||||
expect(vo3.reload.count_on_hand).to eq 14
|
||||
end
|
||||
|
||||
it "doesn't reduce the variant's stock" do
|
||||
v3.move(-2)
|
||||
expect(Spree::Variant.find(v3.id).on_hand).to eq 6
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "overriding sku" do
|
||||
context "when an override exists" do
|
||||
before { vo }
|
||||
|
||||
@@ -4,6 +4,16 @@ describe Spree::OrderMailer do
|
||||
include OpenFoodNetwork::EmailHelper
|
||||
|
||||
describe "order confimation" do
|
||||
let(:bill_address) { create(:address) }
|
||||
let(:distributor_address) { create(:address, address1: "distributor address", city: 'The Shire', zipcode: "1234") }
|
||||
let(:distributor) { create(:distributor_enterprise, address: distributor_address) }
|
||||
let(:shipping_instructions) { "pick up on thursday please!" }
|
||||
let(:ship_address) { create(:address, address1: "distributor address", city: 'The Shire', zipcode: "1234") }
|
||||
let(:order) {
|
||||
create(:order_with_line_items, distributor: distributor, bill_address: bill_address, ship_address: ship_address,
|
||||
special_instructions: shipping_instructions)
|
||||
}
|
||||
|
||||
after do
|
||||
ActionMailer::Base.deliveries.clear
|
||||
end
|
||||
@@ -13,41 +23,39 @@ describe Spree::OrderMailer do
|
||||
ActionMailer::Base.delivery_method = :test
|
||||
ActionMailer::Base.perform_deliveries = true
|
||||
ActionMailer::Base.deliveries = []
|
||||
|
||||
@bill_address = create(:address)
|
||||
@distributor_address = create(:address, address1: "distributor address", city: 'The Shire', zipcode: "1234")
|
||||
@distributor = create(:distributor_enterprise, address: @distributor_address)
|
||||
product = create(:product)
|
||||
@shipping_instructions = "pick up on thursday please!"
|
||||
ship_address = create(:address, address1: "distributor address", city: 'The Shire', zipcode: "1234")
|
||||
@order1 = create(:order, distributor: @distributor, bill_address: @bill_address, ship_address: ship_address, special_instructions: @shipping_instructions)
|
||||
ActionMailer::Base.deliveries = []
|
||||
end
|
||||
|
||||
describe "for customers" do
|
||||
it "should send an email to the customer when given an order" do
|
||||
Spree::OrderMailer.confirm_email_for_customer(@order1.id).deliver
|
||||
Spree::OrderMailer.confirm_email_for_customer(order.id).deliver
|
||||
expect(ActionMailer::Base.deliveries.count).to eq(1)
|
||||
expect(ActionMailer::Base.deliveries.first.to).to eq([@order1.email])
|
||||
expect(ActionMailer::Base.deliveries.first.to).to eq([order.email])
|
||||
end
|
||||
|
||||
it "should include SKUs" do
|
||||
mail = Spree::OrderMailer.confirm_email_for_customer(order.id)
|
||||
|
||||
expect(mail.body.encoded).to include "SKU"
|
||||
expect(mail.body.encoded).to include order.line_items.first.variant.sku
|
||||
end
|
||||
|
||||
it "sets a reply-to of the enterprise email" do
|
||||
Spree::OrderMailer.confirm_email_for_customer(@order1.id).deliver
|
||||
expect(ActionMailer::Base.deliveries.first.reply_to).to eq([@distributor.contact.email])
|
||||
Spree::OrderMailer.confirm_email_for_customer(order.id).deliver
|
||||
expect(ActionMailer::Base.deliveries.first.reply_to).to eq([distributor.contact.email])
|
||||
end
|
||||
end
|
||||
|
||||
describe "for shops" do
|
||||
it "sends an email to the shop owner when given an order" do
|
||||
Spree::OrderMailer.confirm_email_for_shop(@order1.id).deliver
|
||||
Spree::OrderMailer.confirm_email_for_shop(order.id).deliver
|
||||
expect(ActionMailer::Base.deliveries.count).to eq(1)
|
||||
expect(ActionMailer::Base.deliveries.first.to).to eq([@distributor.contact.email])
|
||||
expect(ActionMailer::Base.deliveries.first.to).to eq([distributor.contact.email])
|
||||
end
|
||||
|
||||
it "sends an email even if a footer_email is given" do
|
||||
# Testing bug introduced by a9c37c162e1956028704fbdf74ce1c56c5b3ce7d
|
||||
ContentConfig.footer_email = "email@example.com"
|
||||
Spree::OrderMailer.confirm_email_for_shop(@order1.id).deliver
|
||||
Spree::OrderMailer.confirm_email_for_shop(order.id).deliver
|
||||
expect(ActionMailer::Base.deliveries.count).to eq(1)
|
||||
end
|
||||
end
|
||||
|
||||
33
spec/models/spree/shipment_spec.rb
Normal file
33
spec/models/spree/shipment_spec.rb
Normal file
@@ -0,0 +1,33 @@
|
||||
require "spec_helper"
|
||||
|
||||
describe Spree::Shipment do
|
||||
describe "manifest" do
|
||||
let!(:product) { create(:product) }
|
||||
let!(:order) { create(:order, distributor: product.supplier) }
|
||||
let!(:deleted_variant) { create(:variant, product: product) }
|
||||
let!(:other_variant) { create(:variant, product: product) }
|
||||
let!(:line_item_for_deleted) { create(:line_item, order: order, variant: deleted_variant) }
|
||||
let!(:line_item_for_other) { create(:line_item, order: order, variant: other_variant) }
|
||||
let!(:shipment) { create(:shipment_with, :shipping_method, order: order) }
|
||||
|
||||
context "when the variant is soft-deleted" do
|
||||
before { deleted_variant.delete }
|
||||
|
||||
it "can still access the variant" do
|
||||
shipment.reload
|
||||
variants = shipment.manifest.map(&:variant).uniq
|
||||
expect(variants.sort_by(&:id)).to eq([deleted_variant, other_variant].sort_by(&:id))
|
||||
end
|
||||
end
|
||||
|
||||
context "when the product is soft-deleted" do
|
||||
before { deleted_variant.product.delete }
|
||||
|
||||
it "can still access the variant" do
|
||||
shipment.reload
|
||||
variants = shipment.manifest.map(&:variant)
|
||||
expect(variants.sort_by(&:id)).to eq([deleted_variant, other_variant].sort_by(&:id))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -7,7 +7,8 @@ module OpenFoodNetwork
|
||||
|
||||
let!(:order_cycles) do
|
||||
Array.new(10) do |i|
|
||||
create(:simple_order_cycle, orders_open_at: start + i.days, orders_close_at: start + (i + 1).days )
|
||||
create(:simple_order_cycle, orders_open_at: start + i.days,
|
||||
orders_close_at: start + (i + 1).days )
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -7,9 +7,23 @@ describe "checking out an order with a paypal express payment method", type: :re
|
||||
let!(:shop) { create(:enterprise) }
|
||||
let!(:shipping_method) { create(:shipping_method_with, :distributor, distributor: shop) }
|
||||
let!(:shipment) { create(:shipment_with, :shipping_method, shipping_method: shipping_method) }
|
||||
let!(:order) { create(:order, distributor: shop, shipments: [shipment], ship_address: address.dup, bill_address: address.dup) }
|
||||
let!(:order) do
|
||||
create(
|
||||
:order,
|
||||
distributor: shop,
|
||||
shipments: [shipment],
|
||||
ship_address: address.dup,
|
||||
bill_address: address.dup
|
||||
)
|
||||
end
|
||||
let!(:line_item) { create(:line_item, order: order, quantity: 3, price: 5.00) }
|
||||
let!(:payment_method) { Spree::Gateway::PayPalExpress.create!(name: "PayPalExpress", distributor_ids: [create(:distributor_enterprise).id], environment: Rails.env) }
|
||||
let!(:payment_method) do
|
||||
Spree::Gateway::PayPalExpress.create!(
|
||||
name: "PayPalExpress",
|
||||
distributor_ids: [create(:distributor_enterprise).id],
|
||||
environment: Rails.env
|
||||
)
|
||||
end
|
||||
let(:params) { { token: 'lalalala', PayerID: 'payer1', payment_method_id: payment_method.id } }
|
||||
let(:mocked_xml_response) {
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
|
||||
|
||||
30
spec/serializers/api/admin/variant_serializer_spec.rb
Normal file
30
spec/serializers/api/admin/variant_serializer_spec.rb
Normal file
@@ -0,0 +1,30 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Api::Admin::VariantSerializer do
|
||||
|
||||
let(:variant) { create(:variant) }
|
||||
|
||||
it "serializes the variant name" do
|
||||
serializer = Api::Admin::VariantSerializer.new variant
|
||||
|
||||
expect(serializer.to_json).to match variant.name
|
||||
end
|
||||
|
||||
it "serializes the variant options" do
|
||||
serializer = Api::Admin::VariantSerializer.new variant
|
||||
|
||||
expect(serializer.to_json).to match variant.options_text
|
||||
end
|
||||
|
||||
it "serializes the variant full name" do
|
||||
serializer = Api::Admin::VariantSerializer.new variant
|
||||
|
||||
expect(serializer.to_json).to match variant.full_name
|
||||
end
|
||||
|
||||
it "serializes the variant stock location id" do
|
||||
serializer = Api::Admin::VariantSerializer.new variant
|
||||
|
||||
expect(serializer.to_json).to match variant.stock_items.first.stock_location.id.to_s
|
||||
end
|
||||
end
|
||||
@@ -32,17 +32,17 @@ describe Api::EnterpriseShopfrontSerializer do
|
||||
expect(serializer.serializable_hash[:delivery]).to eq true
|
||||
end
|
||||
|
||||
it "serialises an array of hubs" do
|
||||
it "serializes an array of hubs" do
|
||||
expect(serializer.serializable_hash[:hubs]).to be_a ActiveModel::ArraySerializer
|
||||
expect(serializer.serializable_hash[:hubs].to_json).to match hub.name
|
||||
end
|
||||
|
||||
it "serialises an array of producers" do
|
||||
it "serializes an array of producers" do
|
||||
expect(serializer.serializable_hash[:producers]).to be_a ActiveModel::ArraySerializer
|
||||
expect(serializer.serializable_hash[:producers].to_json).to match producer.name
|
||||
end
|
||||
|
||||
it "serialises taxons" do
|
||||
it "serializes taxons" do
|
||||
expect(serializer.serializable_hash[:taxons]).to be_a ActiveModel::ArraySerializer
|
||||
expect(serializer.serializable_hash[:taxons].to_json).to match 'Meat'
|
||||
expect(serializer.serializable_hash[:taxons].to_json).to match 'Veg'
|
||||
|
||||
@@ -18,7 +18,7 @@ describe Api::GroupListSerializer do
|
||||
expect(serializer.serializable_hash[:state]).to eq group.address.state.abbr
|
||||
end
|
||||
|
||||
it "serialises an array of enterprises" do
|
||||
it "serializes an array of enterprises" do
|
||||
expect(serializer.serializable_hash[:enterprises]).to be_a ActiveModel::ArraySerializer
|
||||
expect(serializer.serializable_hash[:enterprises].to_json).to match producer.name
|
||||
end
|
||||
|
||||
16
spec/serializers/api/order_cycle_serializer_spec.rb
Normal file
16
spec/serializers/api/order_cycle_serializer_spec.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Api::OrderCycleSerializer do
|
||||
let(:order_cycle) { create(:simple_order_cycle) }
|
||||
let(:serializer) { Api::OrderCycleSerializer.new(order_cycle).to_json }
|
||||
|
||||
it "serializes the OC id as order_cycle_id" do
|
||||
expect(serializer).to match "order_cycle_id"
|
||||
expect(serializer).to match order_cycle.id.to_s
|
||||
end
|
||||
|
||||
it "includes orders_close_at" do
|
||||
expect(serializer).to match "orders_close_at"
|
||||
expect(serializer).to match order_cycle.orders_close_at.to_date.to_s
|
||||
end
|
||||
end
|
||||
@@ -1,7 +0,0 @@
|
||||
describe Api::Admin::VariantSerializer do
|
||||
let(:variant) { create(:variant) }
|
||||
it "serializes a variant" do
|
||||
serializer = Api::Admin::VariantSerializer.new variant
|
||||
expect(serializer.to_json).to match variant.options_text
|
||||
end
|
||||
end
|
||||
@@ -391,13 +391,44 @@ describe OrderSyncer do
|
||||
let(:params) { { subscription_line_items_attributes: [{ id: sli.id, quantity: 3 }] } }
|
||||
let(:syncer) { OrderSyncer.new(subscription) }
|
||||
|
||||
it "updates the line_item quantities and totals on all orders" do
|
||||
before do
|
||||
expect(order.reload.total.to_f).to eq 59.97
|
||||
subscription.assign_attributes(params)
|
||||
expect(syncer.sync!).to be true
|
||||
line_items = Spree::LineItem.where(order_id: subscription.orders, variant_id: sli.variant_id)
|
||||
expect(line_items.map(&:quantity)).to eq [3]
|
||||
expect(order.reload.total.to_f).to eq 99.95
|
||||
end
|
||||
|
||||
context "when order is not complete" do
|
||||
it "updates the line_item quantities and totals on all orders" do
|
||||
expect(syncer.sync!).to be true
|
||||
|
||||
line_items = Spree::LineItem.where(order_id: subscription.orders, variant_id: sli.variant_id)
|
||||
expect(line_items.map(&:quantity)).to eq [3]
|
||||
expect(order.reload.total.to_f).to eq 99.95
|
||||
end
|
||||
end
|
||||
|
||||
context "when order is complete" do
|
||||
it "does not update the line_item quantities and adds the order to order_update_issues with insufficient stock" do
|
||||
AdvanceOrderService.new(order).call
|
||||
|
||||
expect(syncer.sync!).to be true
|
||||
|
||||
line_items = Spree::LineItem.where(order_id: subscription.orders, variant_id: sli.variant_id)
|
||||
expect(line_items.map(&:quantity)).to eq [1]
|
||||
expect(order.reload.total.to_f).to eq 59.97
|
||||
line_item = order.line_items.find_by_variant_id(sli.variant_id)
|
||||
expect(syncer.order_update_issues[order.id]).to include "#{line_item.product.name} - #{line_item.variant.full_name} - Insufficient stock available"
|
||||
end
|
||||
|
||||
it "does not update the line_item quantities and adds the order to order_update_issues with out of stock" do
|
||||
# this single item available is used when the order is completed below, making the item out of stock
|
||||
variant.update_attribute(:on_hand, 1)
|
||||
AdvanceOrderService.new(order).call
|
||||
|
||||
expect(syncer.sync!).to be true
|
||||
|
||||
line_item = order.line_items.find_by_variant_id(sli.variant_id)
|
||||
expect(syncer.order_update_issues[order.id]).to include "#{line_item.product.name} - #{line_item.variant.full_name} - Out of Stock"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -426,11 +457,13 @@ describe OrderSyncer do
|
||||
|
||||
it "does not change the quantity, and adds the order to order_update_issues" do
|
||||
expect(order.reload.total.to_f).to eq 79.96
|
||||
|
||||
subscription.assign_attributes(params)
|
||||
expect(syncer.sync!).to be true
|
||||
|
||||
expect(changed_line_item.reload.quantity).to eq 2
|
||||
expect(order.reload.total.to_f).to eq 79.96
|
||||
expect(syncer.order_update_issues[order.id]).to include "#{changed_line_item.product.name} - #{changed_line_item.full_name}"
|
||||
expect(syncer.order_update_issues[order.id]).to include "#{changed_line_item.product.name} - #{changed_line_item.variant.full_name}"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -440,16 +473,68 @@ describe OrderSyncer do
|
||||
let(:subscription) { create(:subscription, with_items: true, with_proxy_orders: true) }
|
||||
let(:order) { subscription.proxy_orders.first.initialise_order! }
|
||||
let(:variant) { create(:variant) }
|
||||
let(:params) { { subscription_line_items_attributes: [{ id: nil, variant_id: variant.id, quantity: 1 }] } }
|
||||
let(:syncer) { OrderSyncer.new(subscription) }
|
||||
|
||||
it "adds the line item and updates the total on all orders" do
|
||||
before do
|
||||
expect(order.reload.total.to_f).to eq 59.97
|
||||
subscription.assign_attributes(params)
|
||||
expect(syncer.sync!).to be true
|
||||
line_items = Spree::LineItem.where(order_id: subscription.orders, variant_id: variant.id)
|
||||
expect(line_items.map(&:quantity)).to eq [1]
|
||||
expect(order.reload.total.to_f).to eq 79.96
|
||||
end
|
||||
|
||||
context "when quantity is within available stock" do
|
||||
let(:params) { { subscription_line_items_attributes: [{ id: nil, variant_id: variant.id, quantity: 1 }] } }
|
||||
|
||||
it "adds the line item and updates the total on all orders" do
|
||||
expect(syncer.sync!).to be true
|
||||
|
||||
line_items = Spree::LineItem.where(order_id: subscription.orders, variant_id: variant.id)
|
||||
expect(line_items.map(&:quantity)).to eq [1]
|
||||
expect(order.reload.total.to_f).to eq 79.96
|
||||
end
|
||||
end
|
||||
|
||||
context "when quantity is greater than available stock" do
|
||||
let(:params) { { subscription_line_items_attributes: [{ id: nil, variant_id: variant.id, quantity: 7 }] } }
|
||||
|
||||
context "when order is not complete" do
|
||||
it "adds the line_item and updates totals on all orders" do
|
||||
expect(syncer.sync!).to be true
|
||||
|
||||
line_items = Spree::LineItem.where(order_id: subscription.orders, variant_id: variant.id)
|
||||
expect(line_items.map(&:quantity)).to eq [7]
|
||||
expect(order.reload.total.to_f).to eq 199.9
|
||||
end
|
||||
end
|
||||
|
||||
context "when order is complete" do
|
||||
before { AdvanceOrderService.new(order).call }
|
||||
|
||||
it "does not add line_item and adds the order to order_update_issues" do
|
||||
expect(syncer.sync!).to be true
|
||||
|
||||
line_items = Spree::LineItem.where(order_id: subscription.orders, variant_id: variant.id)
|
||||
expect(line_items.map(&:quantity)).to eq []
|
||||
expect(order.reload.total.to_f).to eq 59.97
|
||||
expect(syncer.order_update_issues[order.id]).to include "#{variant.product.name} - #{variant.full_name} - Insufficient stock available"
|
||||
end
|
||||
|
||||
context "and then updating the quantity of that subscription line item that was not added to the completed order" do
|
||||
it "does nothing to the order and adds the order to order_update_issues" do
|
||||
expect(syncer.sync!).to be true
|
||||
|
||||
line_items = Spree::LineItem.where(order_id: subscription.orders, variant_id: variant.id)
|
||||
expect(line_items.map(&:quantity)).to eq []
|
||||
|
||||
subscription.save # this is necessary to get an id on the subscription_line_items
|
||||
params = { subscription_line_items_attributes: [{ id: subscription.subscription_line_items.last.id, quantity: 2 }] }
|
||||
subscription.assign_attributes(params)
|
||||
expect(syncer.sync!).to be true
|
||||
|
||||
line_items = Spree::LineItem.where(order_id: subscription.orders, variant_id: variant.id)
|
||||
expect(line_items.map(&:quantity)).to eq []
|
||||
expect(syncer.order_update_issues[order.id]).to include "#{variant.product.name} - #{variant.full_name}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user