anchor.diff:  	ok.
   
   %% @hidden
  -interval(ScheduledTime, Interval) ->
  +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,
  
positive.code: -module(ocs_scheduler).
  -copyright('Copyright (c) 2016 - 2017 SigScale Global Inc.').
  
  -export([start/0, start/2]).
  -export([product_charge/0]).
  
  -include("ocs.hrl").
  
  
negative.code: 	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;
  