Skip to content

Commit da15c4b

Browse files
refactor: displays the name of the hospital in the pdf
1 parent b751de1 commit da15c4b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

app/pdfs/event_procedures_report_pdf.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ def start_new_page_if_needed
5656
def add_item_details(item)
5757
add_item_line(truncate_text(item.patient.name), item_paid?(item))
5858
add_item_line(truncate_text(item.procedure.name), item.total_amount.format)
59-
add_item_line(truncate_text(item.health_insurance.name), item_date(item))
59+
add_item_line(
60+
"#{truncate_text(item.hospital.name)} - #{truncate_text(item.health_insurance.name)}",
61+
item_date(item)
62+
)
6063
end
6164

6265
def add_item_line(left_text, right_text)

spec/pdfs/event_procedures_report_pdf_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
event_procedure.procedure.name,
2121
event_procedure.procedure.amount.format,
2222
event_procedure.patient.name,
23-
event_procedure.health_insurance.name,
23+
"#{event_procedure.hospital.name} - #{event_procedure.health_insurance.name}",
2424
event_procedure.date.strftime("%d/%m/%Y")
2525
)
2626
end

0 commit comments

Comments
 (0)