spree_boxnow 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/services/spree_boxnow/create_voucher.rb +8 -1
- data/lib/spree_boxnow/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f2d41407623bfa230792f076a2d78c6d96ef2e998788c70a77b07de658e16bbd
|
|
4
|
+
data.tar.gz: faa457db0331f12a0dd8d0dd0bafa68983780caeafeafe3a7510b9ae8684f6af
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 309dca79c54d03342f73cf22d3ae5d283703d9e0abd53c7e8a39f28caceda90d93f7e9bbc209b4826bc6d1603e68456cd86b45abe02783781e58d5683cd9f3ff
|
|
7
|
+
data.tar.gz: 0a19c635ffcd28d4f9abf7d1c22eae65c5b96d8b70fcd689d1efc8ddf09ed9b64b2da340ffb92326d87b5598462a037bfadd47cb9037f043089a850e8b918e7f
|
|
@@ -45,7 +45,7 @@ module SpreeBoxnow
|
|
|
45
45
|
name: 'voucher',
|
|
46
46
|
value: '0.00',
|
|
47
47
|
compartmentSize: parcel_size,
|
|
48
|
-
weight:
|
|
48
|
+
weight: shipment_weight.round
|
|
49
49
|
}]
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -64,6 +64,13 @@ module SpreeBoxnow
|
|
|
64
64
|
|
|
65
65
|
private
|
|
66
66
|
|
|
67
|
+
# Reads weight from the manifest's variant rather than Shipment#item_weight,
|
|
68
|
+
# which relies on inventory_unit.line_item and blows up when a line item was
|
|
69
|
+
# swapped out from under an already-fulfilled shipment (orphaned line_item_id).
|
|
70
|
+
def shipment_weight
|
|
71
|
+
shipment.manifest.sum { |item| item.variant.weight.to_f * item.quantity }
|
|
72
|
+
end
|
|
73
|
+
|
|
67
74
|
# Returns BoxNow compartment size: 1=small, 2=medium, 3=large
|
|
68
75
|
# Mirrors the height thresholds in BoxnowRate calculator
|
|
69
76
|
def parcel_size
|
data/lib/spree_boxnow/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spree_boxnow
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OlympusOne
|
|
@@ -182,10 +182,10 @@ licenses:
|
|
|
182
182
|
- MIT
|
|
183
183
|
metadata:
|
|
184
184
|
bug_tracker_uri: https://github.com/olympusone/spree_boxnow/issues
|
|
185
|
-
changelog_uri: https://github.com/olympusone/spree_boxnow/releases/tag/v1.2.
|
|
185
|
+
changelog_uri: https://github.com/olympusone/spree_boxnow/releases/tag/v1.2.1
|
|
186
186
|
documentation_uri: https://github.com/olympusone/spree_boxnow
|
|
187
187
|
homepage_uri: https://github.com/olympusone/spree_boxnow
|
|
188
|
-
source_code_uri: https://github.com/olympusone/spree_boxnow/tree/v1.2.
|
|
188
|
+
source_code_uri: https://github.com/olympusone/spree_boxnow/tree/v1.2.1
|
|
189
189
|
rdoc_options: []
|
|
190
190
|
require_paths:
|
|
191
191
|
- lib
|