anchor.diff:              lager:debug("IAM sync full service item ItemCost: ~p", [ItemCost]),
               lager:debug("IAM sync full service item SubTotal: ~p", [SubTotal]),
   
  -            sync(ServiceItems, AccountId, SubTotal, Items)
  +            sync(Timestamp, Year, Month, Day, ServiceItems, AccountId, SubTotal, Items)
       end.
   
   -spec is_good_standing(ne_binary()) -> boolean().
  
positive.code:     %% https://www.braintreepayments.com/docs/ruby/reference/processor_responses
      wh_util:to_integer(RespCode) < 2000.
  
  prepare_dailyfee_doc_name() ->
      {_, M, D} = erlang:date(),
      Month = wh_util:pad_month(M),
      Day = wh_util:pad_month(D),
      <<"dailyfee-", Month/binary, Day/binary>>.
  
  create_dailyfee_doc(Amount, Items, AccountId) ->
      Timestamp = wh_util:current_tstamp(),
      {Year, Month, _} = erlang:date(),
      create_dailyfee_doc(Timestamp, Year, Month, Amount, Items, AccountId).
  
  create_dailyfee_doc(Timestamp, Year, Month, Amount, Items, AccountId) ->
      Updates = [{<<"_id">>, prepare_dailyfee_doc_name()}
                 ,{<<"pvt_type">>, <<"debit">>}
                 ,{<<"description">>, <<"daily_fee ", (prepare_dailyfee_doc_name())/binary>>}
                 ,{<<"pvt_reason">>, <<"daily_fee">>}
                 ,{<<"pvt_amount">>, wht_util:dollars_to_units(Amount) div calendar:last_day_of_the_month(Year, Month)}
                 ,{[<<"pvt_metadata">>,<<"items_history">>,wh_util:to_binary(Timestamp),<<"monthly_amount">>], wht_util:dollars_to_units(Amount)}
  
negative.code: -export([charge_transactions/2]).
  -export([already_charged/2]).
  
  
  -export([populate_modb_day_with_fee/4
           ,populate_modb_with_fees/3
         ]).
  
  -include("onbill.hrl").
  -include_lib("/opt/kazoo/core/braintree/include/braintree.hrl").
  -include_lib("/opt/kazoo/core/whistle/include/wh_databases.hrl").
  