add shop logo in receipt bill pdf

This commit is contained in:
Htoi San Aung
2025-01-23 10:01:34 +06:30
parent f368295dea
commit d02da668b8

View File

@@ -122,8 +122,21 @@ class ReceiptBillPdf < Prawn::Document
end
def header (shop_details)
###Testing for shop logo
if shop_details.logo.present?
logo_path = shop_details.logo.file.file
# Add shop logo to header
image logo_path, width: 80, height: 80, position: :center
move_down 10
end
###
text "#{shop_details.name}", :left_margin => -10, :size => self.header_font_size,:align => :center
move_down line_move
text "#{shop_details.address}", :size => self.item_font_size,:align => :center
# move_down self.item_height
move_down line_move