# sample, (note untested, i just type it in this email :)
# 
#   g.labels = Hash[*invoice.reject{|v| [v["Scandate"]. 

            ..... i think  this bracket ^ should be removed, sorry

# to_s.strip. empty?}. collect{|v| [v["Scandate"].to_s, "1"]}.flatten]
# 
# 
#