en16931 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57406f273a28162885c95acd171cd64ae23b4cee4e9cb556bf4f5a32e48ab14a
4
- data.tar.gz: 00e107bf9d7aa4ea5150f0a8a0d840214b1a378953b076fa307f4f1900c29a2a
3
+ metadata.gz: 82694745f476c409a9426718145ecf0a20ea7df0b43887c15367a6fee0ddb1a6
4
+ data.tar.gz: 7f5e45615e2cceaa50ea3533cd57a78bf844f78995ffeb04e20f1c3c01a9a296
5
5
  SHA512:
6
- metadata.gz: 9e2e0a4d371c0cba5477d0938ea457ed244eb6b21a183249666abc2b23c82dddf19e5d1a95899c345e8cf7cb591f250605fe8ae5dd2ad01d9419868bb0539f74
7
- data.tar.gz: f127a7cbfbf5020c7c743ed016e0012eb46b1c68adac06495a76ec66eccb6fdeb3fbb7130c9ef69925da601dc35e8535268d7c65dde69bad4c05dde799c6ac31
6
+ metadata.gz: 2b46c041335e5ceb2d1085c3c5f4ad38973ad04ac0867085a48a3b36777fcd26cd749dee7e90a893dbabfc8734cb7d8864307b85dd9b842a754069bf2d61b68f
7
+ data.tar.gz: e7bf88692a48caa4c9d55baaf3f2b48f61bacd5561b14b5791708eb821f2f268771c2544be6b8d7b6df01b57c8164929d1ddcec5227cac3de9fb4a81702d8b56
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.2] - 2026-10-21
4
+
5
+ - Long payment terms no longer run under the GiroCode; beside it the payment block is narrower.
6
+
3
7
  ## [0.1.1] - 2026-10-21
4
8
 
5
9
  - The reference layout speaks 18 languages: German and English plus Czech, Danish, Spanish, Estonian, Finnish, French, Italian, Latvian, Dutch, Polish, Portuguese, Romanian, Russian, Swedish, Turkish and Chinese, each with its own number and date format.
@@ -170,20 +170,28 @@ module EN16931
170
170
  return if payment.nil?
171
171
 
172
172
  code_bottom = giro_code(pdf)
173
- pdf.text t(:payment), style: :bold
174
- pdf.move_down 3
175
- pdf.text payment.terms, size: 9 if payment.terms
173
+ # Beside the GiroCode the text keeps clear of it.
174
+ width = code_bottom ? pdf.bounds.width - GIRO_CODE_SIZE - 12 : pdf.bounds.width
175
+ pdf.bounding_box([pdf.bounds.left, pdf.cursor], width: width) do
176
+ pdf.text t(:payment), style: :bold
177
+ pdf.move_down 3
178
+ pdf.text payment.terms, size: 9 if payment.terms
179
+ payment_details(pdf, payment)
180
+ end
181
+ pdf.move_cursor_to [pdf.cursor, code_bottom].min if code_bottom
182
+ end
183
+
184
+ def payment_details(pdf, payment)
176
185
  rows = []
177
186
  rows << [t(:holder), payment.holder] if payment.holder
178
187
  rows << [t(:iban), payment.iban.scan(/.{1,4}/).join(" ")] if payment.iban
179
188
  rows << [t(:bic), payment.bic] if payment.bic
180
189
  rows << [t(:reference_line), payment.reference] if payment.reference
181
- unless rows.empty?
182
- pdf.table(rows, cell_style: { borders: [], padding: [2, 0], size: 9.5 }, column_widths: [130, 280]) do
183
- column(0).text_color = "666666"
184
- end
190
+ return if rows.empty?
191
+
192
+ pdf.table(rows, cell_style: { borders: [], padding: [2, 0], size: 9.5 }, column_widths: [130, 280]) do
193
+ column(0).text_color = "666666"
185
194
  end
186
- pdf.move_cursor_to [pdf.cursor, code_bottom].min if code_bottom
187
195
  end
188
196
 
189
197
  # The GiroCode floats at the right of the payment details and reports
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EN16931
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: en16931
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Schwed