caboose-cms 0.7.47 → 0.7.48
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/caboose/order.rb +7 -0
- data/app/models/caboose/order_pdf.rb +27 -18
- data/app/models/caboose/pending_orders_pdf.rb +26 -16
- data/lib/caboose/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e90aa603ad21be1a2b9d3e2abe38a8ecd809610e
|
4
|
+
data.tar.gz: 87b0b0d31dccb25263087ed7dd4b46ff3ea3d3ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 803d27ab5a34e4671cc653eabb084126aef317a74d8b52b7feac67af24b776af3a29e10fa9c616f53b98da6d2e89259efa82e46466f46b180ac8102fa0499bac
|
7
|
+
data.tar.gz: 2f2c7df6b1eae40ee8fc80079907b5b6024061595d7b0e31790e7e4ab31287d00d634d8cfcdabbc91927608c74d01cd44d5472000155d25778694b306c02e8d6
|
data/app/models/caboose/order.rb
CHANGED
@@ -115,15 +115,19 @@ module Caboose
|
|
115
115
|
|
116
116
|
def order_table
|
117
117
|
|
118
|
+
hide_prices = order.hide_prices_for_any_line_item?
|
119
|
+
|
118
120
|
tbl = []
|
119
121
|
tbl << [
|
120
122
|
{ :content => "Package" , :align => :left , :valign => :bottom },
|
121
123
|
{ :content => "Product" , :align => :left , :valign => :bottom, :colspan => 2 },
|
122
124
|
{ :content => "Attributes" , :align => :left , :valign => :bottom },
|
123
|
-
{ :content => "Quantity" , :align => :right , :valign => :bottom }
|
124
|
-
{ :content => "Price" , :align => :right , :valign => :bottom },
|
125
|
-
{ :content => "Amount" , :align => :right , :valign => :bottom }
|
125
|
+
{ :content => "Quantity" , :align => :right , :valign => :bottom }
|
126
126
|
]
|
127
|
+
if !hide_prices
|
128
|
+
tbl << { :content => "Price" , :align => :right , :valign => :bottom }
|
129
|
+
tbl << { :content => "Amount" , :align => :right , :valign => :bottom }
|
130
|
+
end
|
127
131
|
|
128
132
|
order.calculate
|
129
133
|
|
@@ -155,10 +159,12 @@ module Caboose
|
|
155
159
|
end
|
156
160
|
arr << { :content => "#{li.variant.product.title}\n#{li.variant.sku}\n#{self.gift_options(li)}", :borders => [:top, :right, :bottom], :width => 100 }
|
157
161
|
arr << { :content => options }
|
158
|
-
arr << { :content => "#{li.quantity}"
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
+
arr << { :content => "#{li.quantity}", :align => :right }
|
163
|
+
if !hide_prices
|
164
|
+
arr << { :content => "$" + sprintf("%.2f", li.unit_price) , :align => :right }
|
165
|
+
arr << { :content => "$" + sprintf("%.2f", li.subtotal) , :align => :right }
|
166
|
+
end
|
167
|
+
|
162
168
|
tbl << arr
|
163
169
|
|
164
170
|
end
|
@@ -187,20 +193,23 @@ module Caboose
|
|
187
193
|
arr << { :content => "#{li.variant.product.title}\n#{li.variant.sku}\n#{self.gift_options(li)}", :borders => [:top, :right, :bottom], :width => 100 }
|
188
194
|
arr << { :content => options }
|
189
195
|
arr << { :content => "#{li.quantity}" , :align => :right }
|
190
|
-
if
|
191
|
-
|
192
|
-
|
193
|
-
|
196
|
+
if !hide_prices
|
197
|
+
if li.unit_price
|
198
|
+
arr << { :content => "$" + sprintf("%.2f", li.unit_price) , :align => :right }
|
199
|
+
else
|
200
|
+
arr << { :content => "" }
|
201
|
+
end
|
202
|
+
arr << { :content => "$" + sprintf("%.2f", li.subtotal) , :align => :right }
|
194
203
|
end
|
195
|
-
arr << { :content => "$" + sprintf("%.2f", li.subtotal) , :align => :right }
|
196
204
|
tbl << arr
|
197
205
|
end
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
206
|
+
if !hide_prices
|
207
|
+
tbl << [{ :content => "Subtotal" , :colspan => 6, :align => :right }, { :content => "$" + sprintf("%.2f", order.subtotal ) , :align => :right }]
|
208
|
+
tbl << [{ :content => "Discount" , :colspan => 6, :align => :right }, { :content => "(-) $" + sprintf("%.2f", order.discount ? order.discount : 0.0 ) , :align => :right }]
|
209
|
+
tbl << [{ :content => "Shipping and Handling Charges" , :colspan => 6, :align => :right }, { :content => "(+) $" + sprintf("%.2f", order.shipping_and_handling ) , :align => :right }]
|
210
|
+
tbl << [{ :content => "Sales Tax" , :colspan => 6, :align => :right }, { :content => "(+) $" + sprintf("%.2f", order.tax ? order.tax : 0.0 ) , :align => :right }]
|
211
|
+
tbl << [{ :content => "Grand Total" , :colspan => 6, :align => :right, :font_style => :bold }, { :content => "$" + sprintf("%.2f", order.total ) , :align => :right, :font_style => :bold }]
|
212
|
+
end
|
204
213
|
|
205
214
|
table tbl , :position => 7, :width => 530
|
206
215
|
end
|
@@ -114,16 +114,20 @@ module Caboose
|
|
114
114
|
|
115
115
|
def order_table(order)
|
116
116
|
|
117
|
+
hide_prices = order.hide_prices_for_any_line_item?
|
118
|
+
|
117
119
|
tbl = []
|
118
120
|
tbl << [
|
119
121
|
{ :content => "Package" , :align => :left , :valign => :bottom },
|
120
122
|
{ :content => "Product" , :align => :left , :valign => :bottom , :colspan => 2 },
|
121
123
|
{ :content => "Attributes" , :align => :left , :valign => :bottom },
|
122
|
-
{ :content => "Quantity" , :align => :right , :valign => :bottom }
|
123
|
-
{ :content => "Price" , :align => :right , :valign => :bottom },
|
124
|
-
{ :content => "Amount" , :align => :right , :valign => :bottom }
|
124
|
+
{ :content => "Quantity" , :align => :right , :valign => :bottom }
|
125
125
|
]
|
126
|
-
|
126
|
+
if !hide_prices
|
127
|
+
tbl << { :content => "Price" , :align => :right , :valign => :bottom }
|
128
|
+
tbl << { :content => "Amount" , :align => :right , :valign => :bottom }
|
129
|
+
end
|
130
|
+
|
127
131
|
#order.calculate
|
128
132
|
|
129
133
|
order.order_packages.all.each do |pk|
|
@@ -157,8 +161,10 @@ module Caboose
|
|
157
161
|
arr << { :content => "#{li.variant.product.title}\n#{li.variant.sku}\n#{self.gift_options(li)}", :borders => [:top, :right, :bottom], :width => 100 }
|
158
162
|
arr << { :content => options }
|
159
163
|
arr << { :content => "#{li.quantity}" , :align => :right }
|
160
|
-
|
161
|
-
|
164
|
+
if !hide_prices
|
165
|
+
arr << { :content => "$" + sprintf("%.2f", li.unit_price) , :align => :right }
|
166
|
+
arr << { :content => "$" + sprintf("%.2f", li.subtotal) , :align => :right }
|
167
|
+
end
|
162
168
|
|
163
169
|
tbl << arr
|
164
170
|
|
@@ -190,20 +196,24 @@ module Caboose
|
|
190
196
|
arr << { :content => "#{li.variant.product.title}\n#{li.variant.sku}\n#{self.gift_options(li)}", :borders => [:top, :right, :bottom], :width => 100 }
|
191
197
|
arr << { :content => options }
|
192
198
|
arr << { :content => "#{li.quantity}" , :align => :right }
|
193
|
-
if
|
194
|
-
|
195
|
-
|
196
|
-
|
199
|
+
if !hide_prices
|
200
|
+
if li.unit_price
|
201
|
+
arr << { :content => "$" + sprintf("%.2f", li.unit_price) , :align => :right }
|
202
|
+
else
|
203
|
+
arr << { :content => "" }
|
204
|
+
end
|
205
|
+
arr << { :content => "$" + sprintf("%.2f", li.subtotal) , :align => :right }
|
197
206
|
end
|
198
|
-
arr << { :content => "$" + sprintf("%.2f", li.subtotal) , :align => :right }
|
199
207
|
tbl << arr
|
200
208
|
end
|
201
209
|
order.calculate
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
210
|
+
if !hide_prices
|
211
|
+
tbl << [{ :content => "Subtotal" , :colspan => 6, :align => :right }, { :content => "$" + sprintf("%.2f", order.subtotal ) , :align => :right }]
|
212
|
+
tbl << [{ :content => "Discount" , :colspan => 6, :align => :right }, { :content => "(-) $" + sprintf("%.2f", order.discount ? order.discount : 0.0 ) , :align => :right }]
|
213
|
+
tbl << [{ :content => "Shipping and Handling Charges" , :colspan => 6, :align => :right }, { :content => "(+) $" + sprintf("%.2f", order.shipping_and_handling ) , :align => :right }]
|
214
|
+
tbl << [{ :content => "Sales Tax" , :colspan => 6, :align => :right }, { :content => "(+) $" + sprintf("%.2f", order.tax ? order.tax : 0.0 ) , :align => :right }]
|
215
|
+
tbl << [{ :content => "Grand Total" , :colspan => 6, :align => :right, :font_style => :bold }, { :content => "$" + sprintf("%.2f", order.total ) , :align => :right, :font_style => :bold }]
|
216
|
+
end
|
207
217
|
|
208
218
|
table tbl , :position => 7, :width => 530
|
209
219
|
end
|
data/lib/caboose/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.48
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|