mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-21 07:08:45 +05:00
fix shared group member ids issue
This commit is contained in:
@@ -129,13 +129,15 @@ func (ub *Account) debitBalanceAction(a *Action, reset bool) error {
|
||||
a.Balance.Value = -a.Balance.Value
|
||||
a.Balance.dirty = true // Mark the balance as dirty since we have modified and it should be checked by action triggers
|
||||
ub.BalanceMap[id] = append(ub.BalanceMap[id], a.Balance)
|
||||
if a.Balance.SharedGroup != "" {
|
||||
// add shared group member
|
||||
sg, err := accountingStorage.GetSharedGroup(a.Balance.SharedGroup, false)
|
||||
if err != nil || sg == nil {
|
||||
//than problem
|
||||
Logger.Warning(fmt.Sprintf("Could not get shared group: %v", a.Balance.SharedGroup))
|
||||
} else {
|
||||
}
|
||||
if a.Balance.SharedGroup != "" {
|
||||
// add shared group member
|
||||
sg, err := accountingStorage.GetSharedGroup(a.Balance.SharedGroup, false)
|
||||
if err != nil || sg == nil {
|
||||
//than problem
|
||||
Logger.Warning(fmt.Sprintf("Could not get shared group: %v", a.Balance.SharedGroup))
|
||||
} else {
|
||||
if !utils.IsSliceMember(sg.MemberIds, ub.Id) {
|
||||
// add member and save
|
||||
sg.MemberIds = append(sg.MemberIds, ub.Id)
|
||||
accountingStorage.SetSharedGroup(sg)
|
||||
|
||||
Reference in New Issue
Block a user