anchor.diff:  
   generate_docs(AccountId, Year, Month, Carrier) ->
       CarrierDoc = onbill_util:carrier_doc(Carrier),
  -    AccountOnbillDoc = onbill_util:account_doc(AccountId),
       OnbillGlobalVars = onbill_util:global_vars(),
       VatUpdatedFeesList = fees:shape_fees(AccountId, Year, Month, CarrierDoc, OnbillGlobalVars),
  -    {TotalNetto, TotalVAT, TotalBrutto} = lists:foldl(fun(X, {TN_Acc, VAT_Acc, TB_Acc}) ->
  +    Totals = lists:foldl(fun(X, {TN_Acc, VAT_Acc, TB_Acc}) ->
                                                           {TN_Acc + props:get_value(<<"cost_netto">>, X)
                                                            ,VAT_Acc + props:get_value(<<"vat_line_total">>, X)
                                                            ,TB_Acc + props:get_value(<<"cost_brutto">>, X)
  
positive.code: 
  maybe_aggregate_invoice(AccountId, Year, Month, Carriers) ->
      AccountOnbillDoc = onbill_util:account_doc(AccountId),
      case kz_json:get_value(<<"agregate_invoice">>, AccountOnbillDoc) of
          'true' -> aggregate_invoice(AccountId, Year, Month, Carriers);
          _ -> 'ok'
      end.
  
negative.code:            ++ [{Key, kz_json:get_value(Key, AccountOnbillDoc)} || Key <- kz_json:get_keys(AccountOnbillDoc), filter_vars(Key)],
      save_pdf(Vars ++ [{<<"this_document">>, Document}], Document, MainCarrier, AccountId, Year, Month).
  
  get_aggregated_vars(AccountId, Year, Month, Carrier) ->
      TemplateId = <<"invoice">>,
      Modb = kazoo_modb:get_modb(AccountId, Year, Month),
      case kz_datamgr:open_doc(Modb, ?DOC_NAME_FORMAT(Carrier, TemplateId)) of
          {ok, InvoiceDoc} -> [{Key, kz_json:get_value(Key, InvoiceDoc)} || Key <- kz_json:get_keys(InvoiceDoc), filter_vars(Key)];
          _ -> [] 
      end.
  