mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 10:06:24 +05:00
trim spaces for balance dest ids
This commit is contained in:
2
build.sh
2
build.sh
@@ -1,6 +1,6 @@
|
||||
#! /usr/bin/env sh
|
||||
|
||||
echo "Installing CGRateS..."
|
||||
echo "Building CGRateS..."
|
||||
|
||||
go install github.com/cgrates/cgrates/cmd/cgr-engine
|
||||
cr=$?
|
||||
|
||||
@@ -188,13 +188,13 @@ func (ub *Account) getBalancesForPrefix(prefix, category string, balances Balanc
|
||||
}
|
||||
b.account = ub
|
||||
if b.DestinationIds != "" && b.DestinationIds != utils.ANY {
|
||||
balDestIds := strings.Split(b.DestinationIds, utils.INFIELD_SEP)
|
||||
for _, p := range utils.SplitPrefix(prefix, MIN_PREFIX_MATCH) {
|
||||
if x, err := cache2go.Get(utils.DESTINATION_PREFIX + p); err == nil {
|
||||
destIds := x.(map[interface{}]struct{})
|
||||
for dId, _ := range destIds {
|
||||
balDestIds := strings.Split(b.DestinationIds, utils.INFIELD_SEP)
|
||||
for _, balDestID := range balDestIds {
|
||||
if dId == balDestID {
|
||||
if dId == strings.TrimSpace(balDestID) {
|
||||
b.precision = len(p)
|
||||
usefulBalances = append(usefulBalances, b)
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user