spree_core 3.2.2 → 3.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66565fccdd69ce5d3cff1387f60e07415b8f75bf
4
- data.tar.gz: f297def4dd1988664293040ac34de13334f5e806
3
+ metadata.gz: 144d7de948f95e01bbb75ffde51126bc6984b06b
4
+ data.tar.gz: 9e6d276d6f1c6200e20fb4756e5988fc8ad3053a
5
5
  SHA512:
6
- metadata.gz: cef8199f06109eecf6f2622ee1f0afa32f4012209fa57613b86c23fba23e29342b87014e54a2e33ceca67414cfa4c66aa7450826e83a2b2d1e58f1313f045b47
7
- data.tar.gz: 880a86398c03677d2c90f2ac5100e8761c5a98fe0fb4597c6e38abbaa2c5e93f3daf0307a1c895b62d2334368e8f32e708751f5a3ae0c028a409cdae841f6ec8
6
+ metadata.gz: a9b32122a06dd3ffb391b85540d7709ec07584818a861f56c7b06cdcb4f59b15497cf5d11219c27160c69bbb436c7be6e47cc6adb412d479431a08c10121c1b1
7
+ data.tar.gz: 736fe659b598549cdc0ad8ab88e23dd17a9508a9c26e4199e18b2fc7385312b0eca4ebd0c882e1fbcc96241d351829808a3fc1da2e21c5526fa424baeb20464b
@@ -9,7 +9,7 @@ module Spree
9
9
 
10
10
  protected
11
11
 
12
- def create_adjustment(order, adjustable, included = nil)
12
+ def create_adjustment(order, adjustable, included = false)
13
13
  amount = compute_amount(adjustable)
14
14
  return if amount == 0
15
15
  adjustments.new(order: order,
@@ -323,13 +323,10 @@ module Spree
323
323
  def outstanding_balance
324
324
  if canceled?
325
325
  -1 * payment_total
326
- elsif reimbursements.includes(:refunds).size > 0
327
- reimbursed = reimbursements.includes(:refunds).inject(0) do |sum, reimbursement|
328
- sum + reimbursement.refunds.sum(:amount)
329
- end
330
- # If reimbursement has happened add it back to total to prevent balance_due payment state
331
- # See: https://github.com/spree/spree/issues/6229
332
- total - (payment_total + reimbursed)
326
+ elsif refunds.exists?
327
+ # If refund has happened add it back to total to prevent balance_due payment state
328
+ # See: https://github.com/spree/spree/issues/6229 & https://github.com/spree/spree/issues/8136
329
+ total - (payment_total + refunds.sum(:amount))
333
330
  else
334
331
  total - payment_total
335
332
  end
@@ -52,7 +52,7 @@ module Spree
52
52
 
53
53
  payment.public_send(method)
54
54
 
55
- if payment.completed?
55
+ if payment.completed? && payment_total != total
56
56
  self.payment_total += payment.amount
57
57
  end
58
58
  end
@@ -9,8 +9,8 @@
9
9
  <%= item.variant.sku %> <%= raw(item.variant.product.name) %> <%= raw(item.variant.options_text) -%> (<%=item.quantity%>) <%= Spree.t('at_symbol') %> <%= item.single_money %> = <%= item.display_amount %>
10
10
  <% end %>
11
11
  ============================================================
12
- <%= Spree.t('order_mailer.cancel_email.subtotal') %> <%= @order.display_item_total %>
12
+ <%= Spree.t('order_mailer.subtotal') %> <%= @order.display_item_total %>
13
13
  <% @order.adjustments.eligible.each do |adjustment| %>
14
14
  <%= raw(adjustment.label) %> <%= adjustment.display_amount %>
15
15
  <% end %>
16
- <%= Spree.t('order_mailer.cancel_email.total') %> <%= @order.display_total %>
16
+ <%= Spree.t('order_mailer.total') %> <%= @order.display_total %>
@@ -9,7 +9,7 @@
9
9
  <%= item.variant.sku %> <%= raw(item.variant.product.name) %> <%= raw(item.variant.options_text) -%> (<%=item.quantity%>) <%= Spree.t('at_symbol') %> <%= item.single_money %> = <%= item.display_amount %>
10
10
  <% end %>
11
11
  ============================================================
12
- <%= Spree.t('order_mailer.confirm_email.subtotal') %> <%= @order.display_item_total %>
12
+ <%= Spree.t('order_mailer.subtotal') %> <%= @order.display_item_total %>
13
13
  <% if @order.line_item_adjustments.exists? %>
14
14
  <% if @order.all_adjustments.promotion.eligible.exists? %>
15
15
  <% @order.all_adjustments.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
@@ -33,6 +33,6 @@
33
33
  <%= adjustment.label %> <%= adjustment.display_amount %>
34
34
  <% end %>
35
35
  ============================================================
36
- <%= Spree.t('order_mailer.confirm_email.total') %> <%= @order.display_total %>
36
+ <%= Spree.t('order_mailer.total') %> <%= @order.display_total %>
37
37
 
38
38
  <%= Spree.t('order_mailer.confirm_email.thanks') %>
@@ -96,8 +96,10 @@ en:
96
96
  path: Path
97
97
  starts_at: Starts At
98
98
  usage_limit: Usage Limit
99
+ promotion_category: Promotion Category
99
100
  spree/promotion_category:
100
101
  name: Name
102
+ code: Code
101
103
  spree/property:
102
104
  name: Name
103
105
  presentation: Presentation
@@ -476,6 +478,8 @@ en:
476
478
  taxonomies: Taxonomies
477
479
  taxons: Taxons
478
480
  users: Users
481
+ return_authorizations: Return Authorizations
482
+ customer_returns: Customer Returns
479
483
  order:
480
484
  events:
481
485
  approve: approve
@@ -715,6 +719,7 @@ en:
715
719
  error: error
716
720
  errors:
717
721
  messages:
722
+ blank: can't be blank
718
723
  could_not_create_taxon: Could not create taxon
719
724
  no_shipping_methods_available: No shipping methods available for selected location, please change your address and try again.
720
725
  errors_prohibited_this_record_from_being_saved:
@@ -1027,6 +1032,7 @@ en:
1027
1032
  payment_processor_choose_banner_text: If you need help choosing a payment processor, please visit
1028
1033
  payment_processor_choose_link: our payments page
1029
1034
  payment_state: Payment State
1035
+ payment_identifier: Payment Identifier
1030
1036
  payment_states:
1031
1037
  balance_due: balance due
1032
1038
  checkout: checkout
@@ -1154,7 +1160,6 @@ en:
1154
1160
  reference: Reference
1155
1161
  reference_contains: Reference Contains
1156
1162
  refund: Refund
1157
- refund_amount_must_be_greater_than_zero: Refund amount must be greater than zero
1158
1163
  refund_reasons: Refund Reasons
1159
1164
  refunded_amount: Refunded Amount
1160
1165
  refunds: Refunds
@@ -1,5 +1,5 @@
1
1
  module Spree
2
2
  def self.version
3
- "3.2.2"
3
+ "3.2.3"
4
4
  end
5
5
  end
@@ -15,6 +15,9 @@ module Spree
15
15
  # then replace the locale-specific decimal separator with the standard separator if necessary
16
16
  number.gsub!(separator, '.') unless separator == '.'
17
17
 
18
+ # Returns 0 to avoid ArgumentError: invalid value for BigDecimal(): "" for empty string
19
+ return 0 unless number.present?
20
+
18
21
  number.to_d
19
22
  end
20
23
 
data/spree_core.gemspec CHANGED
@@ -38,7 +38,7 @@ Gem::Specification.new do |s|
38
38
  s.add_dependency 'rails', '~> 5.0.0'
39
39
  s.add_dependency 'ransack', '~> 1.8.0'
40
40
  s.add_dependency 'responders'
41
- s.add_dependency 'state_machines-activerecord', '~> 0.2'
41
+ s.add_dependency 'state_machines-activerecord', '~> 0.5'
42
42
  s.add_dependency 'stringex'
43
43
  s.add_dependency 'twitter_cldr', '~> 3.0'
44
44
  s.add_dependency 'sprockets-rails'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.2
4
+ version: 3.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-28 00:00:00.000000000 Z
11
+ date: 2017-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant
@@ -282,14 +282,14 @@ dependencies:
282
282
  requirements:
283
283
  - - "~>"
284
284
  - !ruby/object:Gem::Version
285
- version: '0.2'
285
+ version: '0.5'
286
286
  type: :runtime
287
287
  prerelease: false
288
288
  version_requirements: !ruby/object:Gem::Requirement
289
289
  requirements:
290
290
  - - "~>"
291
291
  - !ruby/object:Gem::Version
292
- version: '0.2'
292
+ version: '0.5'
293
293
  - !ruby/object:Gem::Dependency
294
294
  name: stringex
295
295
  requirement: !ruby/object:Gem::Requirement