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

module Printers
  module Sale
    class SalePrinterBase < PrinterBase
      attr_reader :sale

      def initialize(sale:, t
    
      def build_vat_totals
        dataset = []
        sale.items.group_by(&:tax).each do |tax, items|
          h = {}
          h[:tax_name] = tax.name
          h[:tax_rate] = tax.amount
          h[:tax_base_pretax_amount] = items.pluck(:pretax_amount).compact.sum.round_l
          h[:tax_amount] = (items.pluck(:amount).compact.sum - items.pluck(:pretax_amount).compact.sum).round_l
          dataset << h
        end
        dataset
      end