excid3 / receipts

Easy receipts and invoices for your Ruby on Rails applications
MIT License
614 stars 77 forks source link

receipts/base.rb:47:in `header': no implicit conversion of Symbol into Integer (TypeError) #33

Closed anthonypwinning closed 6 months ago

anthonypwinning commented 7 months ago

I'm using version 2.2.0 of the gemfile, and was trying to generate a PDF with the following:

      receipt = Receipts::Receipt.new(
        page_size: "A4",
        logo_height: 60,
        title: I18n.t('receipts.receipt'),
        details: [
          [ I18n.t('receipts.payment_number'), "PMT20240126-10000" ],
          [ I18n.t('receipts.issue_date'), Time.now.strftime("%a %d-%b-%Y") ]
        ],
        company: [
          name: company_name,
          address: address,
          phone: phone,
          email: support_email,
          logo: File.expand_path('app/assets/images/logo_for_pdfs.png')
        ],
        recipient: [
        ],
        line_items: [
        ],
        footer: "Footer info..."
      )

However I get:

receipts/base.rb:47:in header: no implicit conversion of Symbol into Integer (TypeError)

Any suggestions for where I am going wrong would be greatly appreciated.

Thank you!

anthonypwinning commented 7 months ago

Oh whoops.. I caught the error. We needed:

company: { } I'll leave this in-case it helps anyone else.