Hey Armir,
thank you for the explanation. Now the problem I'm facing with rounding to MBs is that if we say a user has a data session of a 8KB. In this case I cannot charge the 1MB price as this would overcharge the user.
Do you have any ideas how I can use the 1MB price but charge only the fraction of the price for 1KB.
This is currently my rate:
RT_SLO_DATA1,0,0.00004004,1,1,0
With the solution I've described in previous messages, it does work, but I do get some rounding errors.
Here is a JSON of a rated data CDR:
{
"CGRID": "1fbefee9cfb86926757519357e077fd6a21aef0f",
"RunID": "*default",
"OrderID": 16,
"OriginHost": "",
"Source": "*sessions",
"OriginID": "test16",
"ToR": "*data",
"RequestType": "*postpaid",
"Tenant": "softnet-mobil",
"Category": "slo-data",
"Account": "3861234568",
"Subject": " 3861234568 ",
"Destination": "386",
"SetupTime": "2024-02-08T13:01:53.668+01:00",
"AnswerTime": "2024-02-08T13:01:53.668+01:00",
"Usage": 1024,
"ExtraFields": {},
"ExtraInfo": "",
"Partial": false,
"PreRated": false,
"CostSource": "*cdrs",
"Cost": 0.04096,
"CostDetails": {
"CGRID": "1fbefee9cfb86926757519357e077fd6a21aef0f",
"RunID": "*default",
"StartTime": "2024-02-08T13:01:53.668+01:00",
"Usage": 1024,
"Cost": 0.04096,
"Charges": [
{
"RatingID": "f7c1943",
"Increments": [
{
"Usage": 1,
"Cost": 0.00004,
"AccountingID": "e0a984b",
"CompressFactor": 1024
}
],
"CompressFactor": 1
}
],
"AccountSummary": {
"Tenant": "softnet-mobil",
"ID": "38631290546",
"BalanceSummaries": [
{
"UUID": "c3eb8f89-5d3d-4e12-881e-6647cba23c53",
"ID": "TEST-DATA-EU",
"Type": "*data",
"Initial": 0,
"Value": 0,
"Weight": 10,
"Disabled": false
}
},
{
"UUID": "1f6e700c-506c-451a-bd42-3e3925bf9579",
"ID": "*default",
"Type": "*monetary",
"Initial": -0.08204,
"Value": -0.123,
"Disabled": false
}
],
"AllowNegative": false,
"Disabled": false
},
"Rating": {
"f7c1943": {
"ConnectFee": 0,
"RoundingMethod": "*up",
"RoundingDecimals": 5,
"MaxCost": 0,
"MaxCostStrategy": "",
"TimingID": "732edd5",
"RatesID": "a5a7cdc",
"RatingFiltersID": "80b8bb6"
}
},
"Accounting": {
"e0a984b": {
"AccountID": "softnet-mobil:38631290546",
"BalanceUUID": "1f6e700c-506c-451a-bd42-3e3925bf9579",
"RatingID": "",
"Units": 0.00004,
"ExtraChargeID": ""
}
},
"RatingFilters": {
"80b8bb6": {
"DestinationID": "*any",
"DestinationPrefix": "*any",
"RatingPlanID": "RP_EU_DATA_PREMIUM_OVER_QUOTA",
"Subject": "*out:softnet-mobil:EU-data:*any"
}
},
"Rates": {
"a5a7cdc": [
{
"GroupIntervalStart": 0,
"Value": 0.00004004,
"RateIncrement": 1,
"RateUnit": 1
}
]
},
"Timings": {
"732edd5": {
"Years": [],
"Months": [],
"MonthDays": [],
"WeekDays": [],
"StartTime": "00:00:00"
}
}
}
Now while the price in the rates is correct, it is wrong everywhere else, so in Accounting, Rating. So where can I change the decimals to 8 for Accounting and Rating?
Best regards,
Domen