You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: saisigo_parser.rb
    path of file: ./repos/ekylibre/app/services/purchase_invoices
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module PurchaseInvoices
  class SaisigoParser

    VENDOR = 'saisigo'

    def initialize(document_id)
      @document = Document.find(document_id)
      @data = @document.klippa_metadata.deep_symbolize_keys
      if @data[:fields][:supplier_siren].present?
        @siren_or_siret_number = @data[:fields][:supplier_siren].delete(' ')
        if @siren_or_siret_number.length == 9
          @company_informa
    
    def build_lines(invoiced_at, supplier)
      items = []
      if @data[:items].any?
        @data[:items].each do |line|
          # :unit=>"PCE",
          # :quantity=>"3",
          # :description=>"ROBINET DEGUSTATEUR VIS 1/2 SIMPLE",
          # :gross_price=>"13.06",
          # :taxe_amount=>"20.00" or "20.00 %",
          # :supplier_ref=>"168931",
          # :total_amount=>"39.18",
          # :total_amount_ttc=>"39.18"
          qty = ( line[:quantity].present? ? clean_number(line[:quantity]) : 1.0 )
          unit_pretax_amount = (line[:net_price].present? ? clean_number(line[:net_price]) : nil)
          unit_pretax_amount ||= (line[:gross_price].present? ? clean_number(line[:gross_price]) : nil)
          pretax_amount = clean_number(line[:total_amount])
          line_tax_amount = ( line[:taxe_amount].present? ? clean_number(line[:taxe_amount]) : 0.0 )
          if pretax_amount.present?
            vat_percentage = detect_line_vat_rate(line_tax_amount, pretax_amount)
          end
          vat_percentage ||= ( line[:item_vat_code].present? ? clean_number(line[:item_vat_code]) : 0.0 )
          if detect_global_vat_rate && vat_percentage == 0.0
            vat_percentage = detect_global_vat_rate
          end