diff --git a/lib/invoice_printer/pdf_document.rb b/lib/invoice_printer/pdf_document.rb index 43c0b6d..7441a69 100644 --- a/lib/invoice_printer/pdf_document.rb +++ b/lib/invoice_printer/pdf_document.rb @@ -297,8 +297,10 @@ def build_provider_box # ------------------------------------------ # def build_purchaser_box + purchaser = [@document.purchaser_name, @document.purchaser_lines].join("\n") + @pdf.text_box( - @document.purchaser_name, + purchaser.lines.first, size: 15, at: [x(284), y(640) - @push_down], width: x(240) @@ -320,9 +322,9 @@ def build_purchaser_box ) end # Render purchaser_lines if present - if !@document.purchaser_lines.empty? + if purchaser.lines.size > 1 @pdf.text_box( - @document.purchaser_lines, + purchaser.lines(chomp: true)[1..].join("\n"), size: 10, at: [x(284), y(618) - @push_down], width: x(246),