anchor.diff:  	[{userdata, [{doc, "Out of credit with multiple cents buckets"}]}].
   
   interim_reserve_multiple_buckets_out_of_credit(_Config) ->
  -	ProdID = ocs:generate_password(),
   	UnitPrice = 100,
   	UnitSize = 1000000,
  -	Price = #price{name = "overage", type = usage,
  -		units = octets, size = UnitSize, amount = UnitPrice},
  -	Product = #offer{name = ProdID, price = [Price], specification = 4},
  -	{ok, _} = ocs:add_offer(Product),
  -	SubscriberID = list_to_binary(ocs:generate_identity()),
  +	P1 = price(usage, octets, UnitSize, UnitPrice),
  +	OfferId = add_offer([P1], 4),
  +	ProdRef = add_product(OfferId),
  +	ServiceId =  add_service(ProdRef),
  +	StartAmount1 = 110,
  +	B1 = bucket(cents, StartAmount1),
  +	_BId1 = add_bucket(ProdRef, B1),
  +	StartAmount2 = 50,
  +	B2 = bucket(cents, StartAmount2),
  +	_BId2 = add_bucket(ProdRef, B2),
  +	ServiceType = 2,
   	TS = calendar:datetime_to_gregorian_seconds(calendar:local_time()),
  -	Password = ocs:generate_password(),
  -	Chars = [{validity, erlang:system_time(?MILLISECOND) + 2592000000}],
  -	StartAmount1 = 110,
  -	StartAmount2 = 50,
  -	Reservation1 = UnitSize,
  -	B1 = #bucket{units = cents, remain_amount = StartAmount1,
  -		start_date = erlang:system_time(?MILLISECOND),
  -		termination_date = erlang:system_time(?MILLISECOND) + 2592000000},
  -	B2 = #bucket{units = cents, remain_amount = StartAmount2,
  -		start_date = erlang:system_time(?MILLISECOND),
  -		termination_date = erlang:system_time(?MILLISECOND) + 2592000000},
  -	Buckets = [B1, B2],
  -	Subscriber = #service{name = SubscriberID,
  -			password = Password, buckets = Buckets,
  -			product = #product_instance{product = ProdID,
  -			characteristics = Chars}},
   	SessionId = {'Session-Id', list_to_binary(ocs:generate_password())},
   	NasIp = {?NasIpAddress, "10.0.0.1"},
   	NasId = {?NasIdentifier, ocs:generate_password()},
   	SessionAttributes = [NasIp, SessionId, NasId],
  -	ServiceType = 2,
  -	ok = mnesia:dirty_write(service, Subscriber),
  -	{ok, _, _} = ocs_rating:rate(diameter, ServiceType, SubscriberID, TS,
  -			undefined, undefined, initial, [], [{octets, Reservation1}], SessionAttributes),
  +	Reservation1 = UnitSize,
  +	{ok, _, _} = ocs_rating:rate(diameter, ServiceType, ServiceId, TS,
  +			undefined, undefined, initial, [], [{octets, Reservation1}],
  +			SessionAttributes),
   	Reservation2 = UnitSize,
   	DebitAmount = Reservation1,
  -	{out_of_credit, _} = ocs_rating:rate(diameter, ServiceType, SubscriberID,
  -			calendar:gregorian_seconds_to_datetime(TS + 60),
  -			undefined, undefined, interim, [{octets, DebitAmount}],
  -			[{octets, Reservation2}], SessionAttributes),
  -	{ok, #service{buckets = Buckets2}} = ocs:find_service(SubscriberID),
  +	{out_of_credit, _} = ocs_rating:rate(diameter, ServiceType,
  +			ServiceId, calendar:gregorian_seconds_to_datetime(TS + 60), undefined,
  +			undefined, interim, [{octets, DebitAmount}], [{octets, Reservation2}],
  +			SessionAttributes),
  +	{ok, #product{balance = BucketRefs}} = ocs:find_product(ProdRef),
  +	Buckets2 = lists:flatten([mnesia:dirty_read(bucket, Id)
  +			|| Id <- BucketRefs]),
   	StartAmount3 = StartAmount1 + StartAmount2,
   	RemainAmount = case DebitAmount rem UnitPrice of
   		0 ->
  
positive.code: 			char_value_use = [#char_value_use{name = "radiusReserveTime",
  			min = 1, max = 1, values = [#char_value{default = true,
  			units = seconds, value = ReserveTime}]}]},
  	VoiceProduct = #offer{name = VoiceProdID, price = [VoicePrice],
  			specification = "9"},
  	{ok, _} = ocs:add_offer(VoiceProduct),
  	BundleProdID = ocs:generate_password(),
  	BundleProduct = #offer{name = BundleProdID,
  			bundle = [#bundled_po{name = DataProdID},
  					#bundled_po{name = VoiceProdID}]},
  	{ok, _} = ocs:add_offer(BundleProduct),
  	SubscriberID = list_to_binary(ocs:generate_identity()),
  	Password = ocs:generate_password(),
  	StartingAmount = 2567,
  	Buckets = [#bucket{units = cents, remain_amount = StartingAmount,
  			start_date = erlang:system_time(?MILLISECOND),
  			termination_date = erlang:system_time(?MILLISECOND) + 2592000000}],
  	{ok, _S} = ocs:add_service(SubscriberID,
  			Password, BundleProdID, [], Buckets),
  	ServiceType = 12,
  	Timestamp = calendar:local_time(),
  	CallAddress = ocs:generate_identity(),
  	SessionId = [{?AcctSessionId, list_to_binary(ocs:generate_password())}],
  	{ok, _, _} = ocs_rating:rate(radius, ServiceType, SubscriberID,
  			Timestamp, CallAddress, undefined, initial, [], [], SessionId),
  	{ok, #service{buckets = Buckets1}} = ocs:find_service(SubscriberID),
  	#bucket{remain_amount = Amount} = lists:keyfind(cents, #bucket.units, Buckets1),
  	ReservedUnits = case (ReserveTime rem VoiceSize) of
  		0 ->
  
negative.code: 			min = 1, max = 1, values = [#char_value{default = true,
  			value = #range{lower = #quantity{amount = 1380, units = "minutes"},
  			upper = #quantity{amount = 480, units = "minutes"}}}]}]},
  	DataOfferId = add_offer([PeakPrice, OffPeakPrice], 8),
  	ProdRef = add_product(DataOfferId),
  	StartingAmount = 1000,
  	B1 = bucket(cents, StartingAmount),
  	_BId = add_bucket(ProdRef, B1),
  	ServiceId = add_service(ProdRef),
  	ServiceType = 2,
  	{Date, _} = calendar:local_time(),
  	Timestamp1 = {Date, {7, 59, 59}},
  	SessionId1 = [{?AcctSessionId, list_to_binary(ocs:generate_password())}],
  	{ok, _, _} = ocs_rating:rate(radius, ServiceType, ServiceId,
  			Timestamp1, undefined, undefined, initial, [], [], SessionId1),
  	UsedOctets1 = rand:uniform(DataSize * 6),
  	{ok, _, _, _} = ocs_rating:rate(radius, ServiceType, ServiceId,
  			Timestamp1, undefined, undefined, final,
  			[{octets, UsedOctets1}], [], SessionId1),
  	{ok, #product{balance = BucketRefs1}} = ocs:find_product(ProdRef),
  	Buckets1 = lists:flatten([mnesia:dirty_read(bucket, Id)
  			|| Id <- BucketRefs1]),
  	#bucket{remain_amount = Amount1} = lists:keyfind(cents, #bucket.units, Buckets1),
  	UsedUnits1 = case UsedOctets1 rem DataSize of
  		0 ->
  