anchor.diff:             ,{<<"doc_date_json">>, onbill_util:date_json(EYear, EMonth, EDay)}
              ,{<<"period_start">>, onbill_util:date_json(SYear, SMonth, SDay)}
              ,{<<"period_end">>, onbill_util:date_json(EYear, EMonth, EDay)}
  -           ,{<<"carrier_vars">>, kz_json:set_values([{Key, kz_json:get_value(Key, CarrierDoc)}
  -                                                     || Key <- kz_json:get_keys(CarrierDoc), filter_vars(Key)
  -                                                    ]
  -                                                   ,kz_json:new()
  -                                                   )
  -            }
  -           ,{<<"account_vars">>, kz_json:set_values([{Key, kz_json:get_value(Key, AccountOnbillDoc)}
  -                                                     || Key <- kz_json:get_keys(AccountOnbillDoc), filter_vars(Key)
  -                                                    ]
  -                                                   ,kz_json:new()
  -                                                   )
  -            }
  -           ] 
  +           ,{<<"carrier_vars">>, pack_vars(CarrierDoc)}
  +           ,{<<"account_vars">>, pack_vars(AccountOnbillDoc)}
  +           ], 
       %%  delete next two lines after adopting templates to carrier_vars and account_vars
  -           ++ [{Key, kz_json:get_value(Key, CarrierDoc)} || Key <- kz_json:get_keys(CarrierDoc), filter_vars(Key)]
  -           ++ [{Key, kz_json:get_value(Key, AccountOnbillDoc)} || Key <- kz_json:get_keys(AccountOnbillDoc), filter_vars(Key)],
  +    %%       ++ [{Key, kz_json:get_value(Key, CarrierDoc)} || Key <- kz_json:get_keys(CarrierDoc), filter_vars(Key)]
  +    %%       ++ [{Key, kz_json:get_value(Key, AccountOnbillDoc)} || Key <- kz_json:get_keys(AccountOnbillDoc), filter_vars(Key)],
       _ = [save_pdf(Vars
                       ++ [{<<"onbill_doc_type">>, DocType}]
                       ++ [{<<"doc_number">>, onbill_docs_numbering:get_binary_number(AccountId, Carrier, DocType, Year, Month)}]
  
positive.code:     ,unicode:characters_to_binary(amount_into_words:render(TotalRem), unicode, utf8)
      }.
  
  filter_vars(<<"_", _/binary>>) -> 'false';
  filter_vars(<<_/binary>>) -> 'true'.
  
  
negative.code:            ,{<<"period_end">>, onbill_util:date_json(EYear, EMonth, EDay)}
             ,{<<"currency_short">>, kz_json:get_value(<<"currency_short">>, OnbillResellerVars)}
             ,{<<"currency_sign">>, kz_json:get_value(<<"currency_sign">>, OnbillResellerVars)}
             ,{<<"carrier_vars">>, pack_vars(MainCarrierDoc)}
             ,{<<"account_vars">>, pack_vars(AccountOnbillDoc)}
             ]
             ++ VatifiedAmount,
      save_pdf(Vars, DocType, MainCarrier, AccountId, Year, Month).
  