Sha256: 918d0c706bca7c0d1fa18d48e615018d3270c12daa9c4fee319199795a5612dd

Contents?: true

Size: 994 Bytes

Versions: 15

Compression:

Stored size: 994 Bytes

Contents

module Dorsale
  module BillingMachine
    module QuotationPdfCommonMethods
      def build
        super
        build_attachments
      end

      def build_attachments
        main_document.attachments.each do |attachment|
          next unless File.extname(attachment.file.path) == ".pdf"

          file     = attachment.file.path
          nb_pages = ::CombinePDF.load(file).pages.count

          nb_pages.times do |i|
            start_new_page template: file, template_page: (i+1)
          end
        end
      end

      def build_bank_informations
      end

      def build_expiry
        return if main_document.expires_at.nil?

        top    = bounds.top - 11.5.cm
        height = 0.5.cm
        width  = 7.5.cm

        bounding_box [bounds.left, top], height: height, width: width do
          draw_bounds_debug
          text "<b>#{main_document.t(:expires_at)}</b> #{I18n.l(main_document.expires_at)}", inline_format: true, size: 9
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
dorsale-3.0.3 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-3.0.2 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-3.0.1 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-3.0.0 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.7.3 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.7.2 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.7.1 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.7.0 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.6.8 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.6.7 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.6.6 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.6.5 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.6.4 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.6.3 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.6.2 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb