def build_sale_data(sale_item)
        "".b.tap() do |data|
          price_units = (sale_item.price * 100).to_i # !FIXME
          price_bytes = "".b
          4.times{ |shift| price_bytes.insert 0, ((price_units >> shift*8) & 0xff).chr }
          data << price_bytes
          qty_units = ((sale_item.qty || 1) * 1000).to_i # !FIXME
          qty_bytes = "".b
          4.times{ |shift| qty_bytes.insert 0, ((qty_units >> shift*8) & 0xff).chr }
          data << qty_bytes
          data << "\x00".b #number len FIXME
          data << "\xAA\xAA\xAA\xAA\xAA\xAA".b #number FIXME
          text = sale_item.text1.truncate(20)
          data << text.length.chr
          data << text.ljust(20, " ").b
          data << (sale_item.tax_group || 2).chr
        end
      end
def build_sale_data(sale_item)
        "".b.tap() do |data|
          price_units = (sale_item.price * 100).to_i # !FIXME
          price_bytes = "".b
          4.times{ |shift| price_bytes.insert 0, ((price_units >> shift*8) & 0xff).chr }
          data << price_bytes
          qty_units = ((sale_item.qty || 1) * 1000).to_i # !FIXME
          qty_bytes = "".b
          4.times{ |shift| qty_bytes.insert 0, ((qty_units >> shift*8) & 0xff).chr }
          data << qty_bytes
          data << "\x00".b #number len FIXME
          data << "\xAA\xAA\xAA\xAA\xAA\xAA".b #number FIXME
          text = sale_item.text1.truncate(20)
          data << text.length.chr
          data << text.ljust(20, " ").b
          data << (sale_item.tax_group || 2).chr
        end
      end
def build_sale_data(price, text1 = "", text2 = nil, tax_group = 2, qty = 1, percent = nil, neto = nil, number = nil)