issue #21684: invoice bugfixes