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: invoice_data_generator.rb
    path of file: ./repos/openfoodnetwork/app/services
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class InvoiceDataGenerator
  attr_reader :order

  def initialize(order)
    @order = order
  end

  # Give the latest invoice's data and the cur
    
  def update_line_items
    new_data[:sorted_line_items].each do |new_line_item|
      old_line_item = old_data[:sorted_line_items].find { |li| li[:id] == new_line_item[:id] }
      next if old_line_item.nil?

      new_line_item[:variant] = old_line_item[:variant]
    end
  end