caboose-cms 0.9.3 → 0.9.4
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/models/caboose/invoice_pdf.rb +9 -2
- data/app/models/caboose/pending_invoices_pdf.rb +16 -16
- data/lib/caboose/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c32bec44530cdc5f76808682909fd88aaa01f77b
|
4
|
+
data.tar.gz: 0865c9c5f04a41f8e45dc6a2ace2e0bb3e3f99dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fda2258243f5930f898dac1e72fb26e2be80805912396d555ca198197f615b53a9f456671f1c657c0ab1862b929a0370c896fef4042afe2d3a84a2ca496d2697
|
7
|
+
data.tar.gz: fef9a611187d7874093887dc89779f0b7806bd96c7c92e6217d23db93b645144fdb6ee2c7f1ecb4576dccc91a42bbb5b028d4c79de80c0648cc8d88bdce02c09
|
@@ -106,9 +106,16 @@ module Caboose
|
|
106
106
|
]
|
107
107
|
|
108
108
|
sa = invoice.shipping_address
|
109
|
-
|
109
|
+
sa_name = sa && sa.first_name ? "#{sa.first_name} #{sa.last_name}" : "#{c.first_name} #{c.last_name}"
|
110
|
+
sa_address = sa ?
|
111
|
+
(sa.address1 && sa.address1.length > 0 ? "#{sa.address1}\n" : '') +
|
112
|
+
(sa.address2 && sa.address2.length > 0 ? "#{sa.address2}\n" : '') +
|
113
|
+
(sa.city && sa.city.length > 0 ? "#{sa.city}, " : '') +
|
114
|
+
(sa.state && sa.state.length > 0 ? "#{sa.state} " : '') +
|
115
|
+
(sa.zip && sa.zip.length > 0 ? sa.zip : '') : ''
|
116
|
+
|
110
117
|
shipped_to = [
|
111
|
-
[{ :content => "Name" , :border_width => 0, :width => 55 },{ :content =>
|
118
|
+
[{ :content => "Name" , :border_width => 0, :width => 55 },{ :content => sa_name , :border_width => 0, :width => 200 }],
|
112
119
|
[{ :content => "Address" , :border_width => 0, :width => 55 },{ :content => sa_address , :border_width => 0, :width => 200 }],
|
113
120
|
[{ :content => "Email" , :border_width => 0, :width => 55 },{ :content => "#{c.email}" , :border_width => 0, :width => 200 }],
|
114
121
|
[{ :content => "Phone" , :border_width => 0, :width => 55 },{ :content => "#{self.formatted_phone(c.phone)}" , :border_width => 0, :width => 200 }]
|
@@ -95,19 +95,19 @@ module Caboose
|
|
95
95
|
|
96
96
|
sa = invoice.shipping_address
|
97
97
|
shipped_to = []
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
98
|
+
shipped_to_name = sa && sa.first_name && sa.first_name.length > 0 ? "#{sa.first_name} #{sa.last_name}" : "#{c.first_name} #{c.last_name}"
|
99
|
+
shipped_to_address = sa ?
|
100
|
+
(sa.address1 && sa.address1.length > 0 ? "#{sa.address1}\n" : '') +
|
101
|
+
(sa.address2 && sa.address2.length > 0 ? "#{sa.address2}\n" : '') +
|
102
|
+
(sa.city && sa.city.length > 0 ? "#{sa.city}, " : '') +
|
103
|
+
(sa.state && sa.state.length > 0 ? "#{sa.state} " : '') +
|
104
|
+
(sa.zip && sa.zip.length > 0 ? sa.zip : '') : ''
|
105
|
+
|
106
|
+
shipped_to << [{ :content => "Name" , :border_width => 0, :width => 55 },{ :content => shipped_to_name , :border_width => 0, :width => 200 }]
|
107
|
+
shipped_to << [{ :content => "Address" , :border_width => 0, :width => 55 },{ :content => shipped_to_address , :border_width => 0, :width => 200 }]
|
108
|
+
shipped_to << [{ :content => "Email" , :border_width => 0, :width => 55 },{ :content => "#{c.email}" , :border_width => 0, :width => 200 }]
|
109
|
+
shipped_to << [{ :content => "Phone" , :border_width => 0, :width => 55 },{ :content => "#{self.formatted_phone(c.phone)}" , :border_width => 0, :width => 200 }]
|
110
|
+
|
111
111
|
tbl = []
|
112
112
|
tbl << [
|
113
113
|
{ :content => "Shipping Information" , :align => :left, :width => 255, :font_style => :bold },
|
@@ -142,9 +142,9 @@ module Caboose
|
|
142
142
|
|
143
143
|
invoice.invoice_packages.all.each do |pk|
|
144
144
|
|
145
|
-
carrier = pk.shipping_method
|
146
|
-
service = pk.shipping_method
|
147
|
-
package = pk.shipping_package ? pk.shipping_package.name
|
145
|
+
carrier = pk.shipping_method ? pk.shipping_method.carrier : ''
|
146
|
+
service = pk.shipping_method ? pk.shipping_method.service_name : ''
|
147
|
+
package = pk.shipping_package ? pk.shipping_package.name : ''
|
148
148
|
|
149
149
|
pk.line_items.each_with_index do |li, index|
|
150
150
|
options = ''
|
data/lib/caboose/version.rb
CHANGED