Sha256: f3e08f60c5bffa1453a8e5887808360bab2788317f6eb77eaaa511e185c82be9

Contents?: true

Size: 1022 Bytes

Versions: 15

Compression:

Stored size: 1022 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
          font_size 9 do
            text "<b>#{I18n.t("pdfs.expires_at")}</b> #{I18n.l(@main_document.expires_at)}", inline_format: true
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
dorsale-2.4.3 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.4.2 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.4.1 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.4.0 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.3.5 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.3.4 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.3.3 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.3.2 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.3.1 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.3.0 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.2.16 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.2.15 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.2.14 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.2.13 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb
dorsale-2.2.12 app/pdfs/dorsale/billing_machine/quotation_pdf_common_methods.rb