Getresourcebal() Is Returning Wrong Balance (Doc ID 1319618.1)

Last updated on SEPTEMBER 21, 2016

Applies to:

Oracle Communications Billing and Revenue Management - Version 7.3.0.0.0 to 7.3.0.0.1 [Release 7.3.0]
HP-UX PA-RISC (32-bit)
HP-UX Itanium
***Checked for relevance on 06-Feb-2013***

Symptoms

Problem with the function "getResourceBal()" , it is returning wrong balance (sum up of all sub balance irrespective of validity).

Example:
If we have 2 sub balance for resource id X
1. 500 for the month Jan'10.
2. 600 for the month Feb'10.

If we call the function with time stamp of Feb and resource id X  then it is returning balance as 1100 instead of 600.

In the below log we can see that the CDR is of date 2011/05/25 and there are 2 sub-balance impacts:
0 PIN_FLD_BALANCES      ARRAY [3100012] allocated 20, used 6
1     PIN_FLD_CONSUMPTION_RULE   ENUM [0] 0
1     PIN_FLD_CREDIT_PROFILE    INT [0] 2
1     PIN_FLD_NEXT_BAL     DECIMAL [0] 0
1     PIN_FLD_RESERVED_AMOUNT DECIMAL [0] 0
1     PIN_FLD_SUB_BALANCES  ARRAY [6] allocated 20, used 10
2         PIN_FLD_CONTRIBUTOR_STR    STR [0] ""
2         PIN_FLD_CURRENT_BAL  DECIMAL [0] -999992600
2         PIN_FLD_DELAYED_BAL  DECIMAL [0] 0
2         PIN_FLD_GRANTOR_OBJ    POID [0] 0.0.0.101 /purchased_product 4105815 0
2         PIN_FLD_NEXT_BAL     DECIMAL [0] 0
2         PIN_FLD_ROLLOVER_DATA    INT [0] 1073807360
2         PIN_FLD_VALID_FROM   TSTAMP [0] (1302040800) Wed Apr  6 00:00:00 2011
2         PIN_FLD_VALID_FROM_DETAILS    INT [0] 0
2         PIN_FLD_VALID_TO     TSTAMP [0] (1304632800) Fri May  6 00:00:00 2011
2         PIN_FLD_VALID_TO_DETAILS    INT [0] 0
1     PIN_FLD_SUB_BALANCES  ARRAY [14] allocated 20, used 10
2         PIN_FLD_CONTRIBUTOR_STR    STR [0] ""
2         PIN_FLD_CURRENT_BAL  DECIMAL [0] -999996741
2         PIN_FLD_DELAYED_BAL  DECIMAL [0] 0
2         PIN_FLD_GRANTOR_OBJ    POID [0] 0.0.0.101 /purchased_product 4105815 4
2         PIN_FLD_NEXT_BAL     DECIMAL [0] 0
2         PIN_FLD_ROLLOVER_DATA    INT [0] 1073807360
2         PIN_FLD_VALID_FROM   TSTAMP [0] (1304632800) Fri May  6 00:00:00 2011
2         PIN_FLD_VALID_FROM_DETAILS    INT [0] 0
2         PIN_FLD_VALID_TO     TSTAMP [0] (1307311200) Mon Jun  6 00:00:00 2011
2         PIN_FLD_VALID_TO_DETAILS    INT [0] 0

But we can see in the following extract that both the sub-balance are getting
summed in spite the fact that one sub balance is not valid any longer.

DAT::Balance::BatchPlugIn::getResourceBalance :: pipelineName=
PPL_RATE_DB1_PPL1 transId= 3602 balGroupId= 4105629 resourceId= 3100012 startTime= 2011/05/25 15:28:09 contrib= *
DAT::Balance::BatchPlugIn::getResourceBalance:: precondition met !!!
DAT::Balance::BatchPlugIn::getResourceBalance:: after finvalue isTransactionDataValid is False
DAT::Balance::BatchPlugIn::getResourceBalance:: fetching subBalTblPtr when isTransactionDataValid is false
getResourceBalance:: subBalTbl(i))->validFrom() = 2011/05/05 22:00:00 startTime= 2011/05/25 15:28:09
getResourceBalance:: subBalTbl(i))->validTo() = 2011/06/05 22:00:00
getResourceBalance:: subBalTbl(i))->balance()= -1000000000
getResourceBalance:: balances= -1000000000
getResourceBalance:: subBalTbl(i))->validTo() = 2011/05/05 22:00:00
getResourceBalance:: subBalTbl(i))->balance()= -999992600

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms