anchor.diff:  	end.
   
   %%----------------------------------------------------------------------
  +%%  private functions
  +%%----------------------------------------------------------------------
  +
  +-spec run_recurring() -> ok.
  +%% @doc Scheduled function runs recurring charging and reschedules itself.
  +%% @private
  +run_recurring() ->
  +	case product_charge() of
  +		ok ->
  +			{ok, ScheduledTime} = application:get_env(ocs, charging_scheduler_time),
  +			{ok, Interval} = application:get_env(ocs, charging_interval),
  +			StartDelay = start_delay(ScheduledTime, Interval),
  +			case timer:apply_after(StartDelay, ?MODULE, run_recurring, []) of
  +				{ok, _TRef} ->
  +					ok;
  +				{error, Reason} ->
  +					error_logger:error_report(["Scheduler Failed",
  +							{module, ?MODULE}, {delay, StartDelay},
  +							{interval, Interval}, {error, Reason}])
  +			end;
  +		{error, Reason} ->
  +			error_logger:error_report(["Scheduler Failed",
  +					{module, ?MODULE}, {error, Reason}])
  +	end.
  +
  +%%----------------------------------------------------------------------
   %%  internal functions
   %%----------------------------------------------------------------------
  +
   %% @private
   if_dues([{_, DueDate} | _], Now) when DueDate < Now ->
   	true;
  
positive.code: -define(MILLISECOND, milli_seconds).
  %-define(MILLISECOND, millisecond).
  
  -export([frp/1]).
  -spec start() -> ok.
  %% @equiv start(Interval)
  start() ->
  	{ok, ScheduledTime} = application:get_env(charging_scheduler_time), 
  	{ok, Interval} = application:get_env(charging_interval),
  	start(ScheduledTime, Interval).
  
  
negative.code: 	ok.
  
  %% @hidden
  start_delay(ScheduledTime, Interval) when Interval < 1440 ->
  	IntervalSecs = Interval * 60,
  	{Date, Time} = erlang:universaltime(),
  	case calendar:datetime_to_gregorian_seconds({Date, ScheduledTime})
  			- calendar:datetime_to_gregorian_seconds({Date, Time}) of
  		Delay when Delay < 0 ->
  			(IntervalSecs - ((0 - Delay) rem IntervalSecs)) * 1000;
  		0 ->
  			IntervalSecs * 1000;
  		Delay when Delay > 0 ->
  			(Delay rem IntervalSecs) * 1000
  	end;
  start_delay(ScheduledTime, Interval) when Interval >= 1440 ->
  	{Date, Time} = erlang:universaltime(),
  	Today = calendar:date_to_gregorian_days(Date),
  	Period = Interval div 1440,
  