order_optimizer 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/order_optimizer/version.rb +1 -1
- data/lib/order_optimizer.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: dc5f8c71f67ec7c63ccf96363c1653637f5f4ea50d866485cdd4f6238594522d
|
4
|
+
data.tar.gz: 13c69c75805106de2e1ae6a0031bb86639f05c435c49732aaae3124375458efb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0633497552abad8d67891a0f2952fafa9221ba4941709440c0e515f19f8241fb05bd30ccf4129b1c4a879686ef9203d75565c37556e78fdc0b73db0bca862085'
|
7
|
+
data.tar.gz: 03742d3da4bd0db3beb4b19c824f99cc17db427a84c63e27944bd0d20327eff779cfdb355fb0613ab6179c9950279b5427e247bc8802517955a326d523b992e1
|
data/CHANGELOG.md
CHANGED
data/lib/order_optimizer.rb
CHANGED
@@ -55,7 +55,7 @@ class OrderOptimizer
|
|
55
55
|
def count_and_remainder_for_sku(quantity, sku)
|
56
56
|
count, remainder = quantity.divmod(sku.quantity)
|
57
57
|
|
58
|
-
if sku.max_quantity && count * sku.quantity
|
58
|
+
if sku.max_quantity && count * sku.quantity >= sku.max_quantity
|
59
59
|
new_count = (sku.max_quantity / sku.quantity).ceil
|
60
60
|
remainder = (count - new_count) * sku.quantity
|
61
61
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: order_optimizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- crispymtn
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-11-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0'
|
103
103
|
requirements: []
|
104
|
-
rubygems_version: 3.2.
|
104
|
+
rubygems_version: 3.2.22
|
105
105
|
signing_key:
|
106
106
|
specification_version: 4
|
107
107
|
summary: Helps to optimize orders if the goods are offered in different pack sizes
|