MT#5879 Merge with Andreas version of Invoice Template APIs.