anchor.diff:              end,
               kz_datamgr:put_attachment(?ONBILL_DB
                                        ,?CARRIER_DOC(Carrier)
  -                                     ,<<Carrier/binary, "_", TemplateId/binary, ".tpl">>
  +                                     ,<<(?DOC_NAME_FORMAT(Carrier, TemplateId))/binary, ".tpl">>
                                        ,Template
                                        ,[{'content_type', <<"text/html">>}]
                                       ),
  
positive.code:     end.
  
  prepare_tpl(Vars, TemplateId, Carrier) ->
      ErlyMod = erlang:binary_to_atom(<<Carrier/binary, "_", TemplateId/binary>>, 'latin1'),
      try erlydtl:compile_template(get_template(TemplateId, Carrier), ErlyMod, [{'out_dir', 'false'},'return']) of
          {ok, ErlyMod} -> render_tpl(ErlyMod, Vars);
          {ok, ErlyMod,[]} -> render_tpl(ErlyMod, Vars); 
  
negative.code: 
  create_pdf(Vars, TemplateId, Carrier, AccountId) ->
      Rand = kz_util:rand_hex_binary(5),
      Prefix = <<AccountId/binary, "-", (?DOC_NAME_FORMAT(Carrier, TemplateId))/binary, "-", Rand/binary>>,
      HTMLFile = filename:join([<<"/tmp">>, <<Prefix/binary, ".html">>]),
      PDFFile = filename:join([<<"/tmp">>, <<Prefix/binary, ".pdf">>]),
      HTMLTpl = prepare_tpl(Vars, TemplateId, Carrier),
  