Invoice sorting and filename fixes