MT#5879 Template fixes.

Adapt template to empty [zones] data (almost all live generated invoces are
with empty data now).
Move code to macros in aux file to don't confuse users in svg template.
Fix some new uninitialized template warnings.
MT#5879 Fix for invoice generation.

Invoice generation script uses mock catalyst context object, so no real
looging should be called. Or logge object shpould be mocked too. (TODO).