Skip to content

Commit

Permalink
Merge pull request #83 from voxik/mix-provider_name-and-provider_lines
Browse files Browse the repository at this point in the history
Combine purchaser_name together with purchaser_lines
  • Loading branch information
strzibny authored Aug 11, 2024
2 parents c0e2406 + 1599d4d commit d66ee5f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/invoice_printer/pdf_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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),
Expand Down

0 comments on commit d66ee5f

Please sign in to comment.