shoppe 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/shoppe/order/billing.rb +8 -2
- data/lib/shoppe/version.rb +1 -1
- metadata +22 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 752b9615632da0d234db4ce429f3ce320ee2042c
|
4
|
+
data.tar.gz: 1ef71710c0b97b62b5b964da53e655f596206b38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a482542a767728e88f99a8ef1ffe56e550e9f38854d07056132d0229264e9d66fc2f32fd09b3009e7fad9591a757cbda61856712210991ab3033e7b97102690
|
7
|
+
data.tar.gz: 41a7a43caa70822b11602bc66fb8224bfbe7cb2e37162899c3385aa3cf0489232648ad5f8fe7509775df13138db64a1f56173bc687cd96ec18f318a6b1ee0343
|
@@ -41,13 +41,19 @@ module Shoppe
|
|
41
41
|
def profit
|
42
42
|
total_before_tax - total_cost
|
43
43
|
end
|
44
|
+
|
45
|
+
# The total price of all items in the basket excluding delivery
|
46
|
+
#
|
47
|
+
# @return [BigDecimal]
|
48
|
+
def items_sub_total
|
49
|
+
order_items.inject(BigDecimal(0)) { |t, i| t + i.sub_total }
|
50
|
+
end
|
44
51
|
|
45
52
|
# The total price of the order before tax
|
46
53
|
#
|
47
54
|
# @return [BigDecimal]
|
48
55
|
def total_before_tax
|
49
|
-
self.delivery_price +
|
50
|
-
order_items.inject(BigDecimal(0)) { |t, i| t + i.sub_total }
|
56
|
+
self.delivery_price + self.items_sub_total
|
51
57
|
end
|
52
58
|
|
53
59
|
# The total amount of tax due on this order
|
data/lib/shoppe/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shoppe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -184,16 +184,22 @@ dependencies:
|
|
184
184
|
name: nifty-key-value-store
|
185
185
|
requirement: !ruby/object:Gem::Requirement
|
186
186
|
requirements:
|
187
|
-
- - "
|
187
|
+
- - ">="
|
188
188
|
- !ruby/object:Gem::Version
|
189
|
-
version:
|
189
|
+
version: 1.0.1
|
190
|
+
- - "<"
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: 2.0.0
|
190
193
|
type: :runtime
|
191
194
|
prerelease: false
|
192
195
|
version_requirements: !ruby/object:Gem::Requirement
|
193
196
|
requirements:
|
194
|
-
- - "
|
197
|
+
- - ">="
|
195
198
|
- !ruby/object:Gem::Version
|
196
|
-
version:
|
199
|
+
version: 1.0.1
|
200
|
+
- - "<"
|
201
|
+
- !ruby/object:Gem::Version
|
202
|
+
version: 2.0.0
|
197
203
|
- !ruby/object:Gem::Dependency
|
198
204
|
name: nifty-utils
|
199
205
|
requirement: !ruby/object:Gem::Requirement
|
@@ -212,16 +218,22 @@ dependencies:
|
|
212
218
|
name: nifty-attachments
|
213
219
|
requirement: !ruby/object:Gem::Requirement
|
214
220
|
requirements:
|
215
|
-
- - "
|
221
|
+
- - ">="
|
216
222
|
- !ruby/object:Gem::Version
|
217
|
-
version:
|
223
|
+
version: 1.0.1
|
224
|
+
- - "<"
|
225
|
+
- !ruby/object:Gem::Version
|
226
|
+
version: 2.0.0
|
218
227
|
type: :runtime
|
219
228
|
prerelease: false
|
220
229
|
version_requirements: !ruby/object:Gem::Requirement
|
221
230
|
requirements:
|
222
|
-
- - "
|
231
|
+
- - ">="
|
223
232
|
- !ruby/object:Gem::Version
|
224
|
-
version:
|
233
|
+
version: 1.0.1
|
234
|
+
- - "<"
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: 2.0.0
|
225
237
|
- !ruby/object:Gem::Dependency
|
226
238
|
name: nifty-dialog
|
227
239
|
requirement: !ruby/object:Gem::Requirement
|