anchor.diff:      ,unicode:characters_to_binary(amount_into_words:render(TotalRem), unicode, utf8)
       }.
   
  +pack_vars(Doc) ->
  +    kz_json:set_values([{Key, kz_json:get_value(Key, Doc)}
  +                        || Key <- kz_json:get_keys(Doc), filter_vars(Key)]
  +                      ,kz_json:new()).
  +
   filter_vars(<<"_", _/binary>>) -> 'false';
   filter_vars(<<_/binary>>) -> 'true'.
   
  
positive.code:            ,{<<"total_brutto_rem">>, TotalBruttoRem}
             ,{<<"onbill_doc_type">>, DocType}
             ,{<<"doc_number">>, onbill_docs_numbering:get_binary_number(AccountId, MainCarrier, DocType, Year, Month)}
             ]
             ++ [{Key, kz_json:get_value(Key, MainCarrierDoc)} || Key <- kz_json:get_keys(MainCarrierDoc), filter_vars(Key)]
             ++ [{Key, kz_json:get_value(Key, AccountOnbillDoc)} || Key <- kz_json:get_keys(AccountOnbillDoc), filter_vars(Key)],
      save_pdf(Vars, DocType, MainCarrier, AccountId, Year, Month).
  
  aggregate_data(AccountId, Year, Month, Day, Carrier, {AggrVars, TotalNetto, TotalVAT, TotalBrutto}) ->
  
negative.code:            ,{<<"agrm_num">>, kz_json:get_value([<<"agrm">>, Carrier, <<"number">>], AccountOnbillDoc)}
             ,{<<"agrm_date">>, kz_json:get_value([<<"agrm">>, Carrier, <<"date">>], AccountOnbillDoc)}
             ,{<<"onbill_doc_type">>, DocType}
             ,{<<"carrier_vars">>, pack_vars(CarrierDoc)}
             ,{<<"account_vars">>, pack_vars(AccountOnbillDoc)}
             ]
             ++ onbill_fees:vatify_amount(<<"total">>, CallsTotalSumm, OnbillResellerVars),
      save_pdf(Vars, DocType, Carrier, AccountId, Year, Month);
  per_minute_report(_, _, _, _, _, _, _, _) ->
      'ok'.
  