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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/en16931/pdf/renderer.rb +16 -8
- data/lib/en16931/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 82694745f476c409a9426718145ecf0a20ea7df0b43887c15367a6fee0ddb1a6
|
|
4
|
+
data.tar.gz: 7f5e45615e2cceaa50ea3533cd57a78bf844f78995ffeb04e20f1c3c01a9a296
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
data/lib/en16931/pdf/renderer.rb
CHANGED
|
@@ -170,20 +170,28 @@ module EN16931
|
|
|
170
170
|
return if payment.nil?
|
|
171
171
|
|
|
172
172
|
code_bottom = giro_code(pdf)
|
|
173
|
-
|
|
174
|
-
pdf.
|
|
175
|
-
pdf.
|
|
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
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
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
|
data/lib/en16931/version.rb
CHANGED