Advance receipt template

The template has a strictly defined but extensible structure. The receipt template is described in JSON format and contains required variables.