dorsale 2.4.1 → 2.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a08c491a05f970f39cc2c0a2c41e25aee69ae6e3
4
- data.tar.gz: dff69072c21dabbeb8c56c522aae407c05775d13
3
+ metadata.gz: dc6482c9e48b1a239d3db1ea019a441fc5751eba
4
+ data.tar.gz: b1dd5c07ba8aba8c9dedd9d2b8aa1089f0d33af5
5
5
  SHA512:
6
- metadata.gz: 00132ceee7216380b1544086e74389f7280bf5bd733d10fd9b6842ba3a5031995a6a8628cdaeb7f9ab98eac699661a5d54a47758437c5b97138f3216b2724eba
7
- data.tar.gz: f16f7989b12051331fa45316a00800c0270e9466224c4cb347322f765e0a9fdacd4f9144b250bb20b803707168a3dc106b70bcce845f644bb6731ba82c2c501c
6
+ metadata.gz: 4513e5b64c2a19938f4d29c8ba2ab8d82675220bbacfc821ab9a0be736be47052758972d42ca09d772dc24ad7e653ab4cf31afd8695898d0806cd034b1615210
7
+ data.tar.gz: 7e264cc5fa80580beb3cac6c25a8bfc9c3029f0a119ed64c63a3493f1fc01911a5b687dd7bb2c1475e4def6d715058d6b00a93790da4ef40f43acb2277b21c01
@@ -181,19 +181,25 @@ module Dorsale
181
181
  fill_color BLACK
182
182
  end
183
183
 
184
+ customer_text = []
185
+ customer_text << @main_document.customer.name
186
+ customer_text << @main_document.customer.address.street
187
+ customer_text << @main_document.customer.address.street_bis
188
+ customer_text << "#{@main_document.customer.address.zip} #{@main_document.customer.address.city}"
189
+ customer_text << @main_document.customer.address.country
190
+
191
+ if @main_document.customer.try(:european_union_vat_number).present?
192
+ customer_text << @main_document.customer.t(:european_union_vat_number)
193
+ customer_text << @main_document.customer.european_union_vat_number
194
+ end
195
+
196
+ customer_text = customer_text.select(&:present?).join("\n")
184
197
 
185
198
  bounding_box [bounds.left + padding, bounds.top - padding], height: bounds.height - padding, width: bounds.width - padding do
186
- if @main_document.customer.present?
187
- text @main_document.customer.name if @main_document.customer.name.present?
188
- text @main_document.customer.address.street if @main_document.customer.address.street.present?
189
- text @main_document.customer.address.street_bis if @main_document.customer.address.street_bis.present?
190
- text "#{@main_document.customer.address.zip} #{@main_document.customer.address.city}, #{@main_document.customer.address.country}" if @main_document.customer.address.zip.present? || @main_document.customer.address.city.present? || @main_document.customer.address.country.present?
191
- text "#{@main_document.customer.t :european_union_vat_number} :\n#{@main_document.customer.european_union_vat_number}" if @main_document.customer.try(:european_union_vat_number).present?
192
- end
199
+ text customer_text
193
200
  end
194
-
195
201
  end
196
- end
202
+ end # def build_customer
197
203
 
198
204
  def build_middle
199
205
  left = bounds.left
@@ -1,3 +1,3 @@
1
1
  module Dorsale
2
- VERSION = "2.4.1"
2
+ VERSION = "2.4.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dorsale
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.1
4
+ version: 2.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - agilidée
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-17 00:00:00.000000000 Z
11
+ date: 2016-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails