<commit_before>module Generators::Reports  
  class IrsPdfReport < PdfReport
    include ActionView::Helpers::NumberHelper

    def initialize(notice)
      template = "#{Rails.root}/f1095a.pdf"
      super({:template => template, :margin => [30, 55]})
      font_size 11

      @notice = notice
      @margin = [30, 70]

      fill_envelope
      fill_subscriber_details
      fill_household_details
      fill_preimum_details
    end

    def fill_envelope
    end

    def fill_subscriber_details
      col1 = mm2pt(-2)
      col2 = mm2pt(51.50)
      col3 = mm2pt(102.50)
      col4 = mm2pt(145.50)
      y_pos = 790.86 - mm2pt(37.15) - 45

      bounding_box([col1, y_pos], :width => 100) do<commit_msg>Added coverletter for irs notices<commit_after>module Generators::Reports  
  class IrsPdfReport < PdfReport
    include ActionView::Helpers::NumberHelper

    def initialize(notice)
      template = "#{Rails.root}/f1095a.pdf"
      super({:template => template, :margin => [30, 55]})
      font_size 11

      @notice = notice
      @margin = [30, 70]

      fill_envelope
      fill_subscriber_details
      fill_household_details
      fill_preimum_details
    end

    def fill_envelope
      x_pos = mm2pt(21.83) - @margin[0]
      y_pos = 790.86 - mm2pt(57.15) - 65

      bounding_box([x_pos, y_pos], :width => 300) do
        fill_primary_address
      end
    end

    def fill_primary_address
      text @notice.primary_name
      text @address.street_1
      text @address.street_2 unless @address.street_2.blank?
      text "#{@address.city}, #{@address.state} #{@address.zip}"      
    end

    def fill_subscriber_details
      col1 = mm2pt(-2)
      col2 = mm2pt(51.50)
      col3 = mm2pt(102.50)
      col4 = mm2pt(145.50)
      y_pos = 790.86 - mm2pt(37.15) - 45

      bounding_box([col1, y_pos], :width => 100) do
{'fraction_non_alphanumeric': 0.10863661053775123, 'fraction_numerical': 0.0706137968495383, 'mean_word_length': 2.528735632183908, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5823135', 'n_tokens_mistral': 726, 'n_tokens_neox': 641, 'n_words': 132}