diff --git a/engine/account.go b/engine/account.go index b3dcb777b..e529a7966 100644 --- a/engine/account.go +++ b/engine/account.go @@ -316,6 +316,10 @@ func (ub *Account) debitCreditBalance(cd *CallDescriptor, count bool, dryRun boo return } } + // check for blocker + if dryRun && balance.Blocker { + return // don't go to next balances + } } } @@ -354,6 +358,10 @@ func (ub *Account) debitCreditBalance(cd *CallDescriptor, count bool, dryRun boo return } } + // check for blocker + if dryRun && balance.Blocker { + return // don't go to next balances + } } } //log.Printf("END CD: %+v", cd) diff --git a/engine/balances.go b/engine/balances.go index d667eaf76..167bc0cca 100644 --- a/engine/balances.go +++ b/engine/balances.go @@ -46,6 +46,7 @@ type Balance struct { TimingIDs utils.StringMap Disabled bool Factor ValueFactor + Blocker bool precision int account *Account // used to store ub reference for shared balances dirty bool @@ -67,7 +68,9 @@ func (b *Balance) Equal(o *Balance) bool { b.RatingSubject == o.RatingSubject && b.Categories.Equal(o.Categories) && b.SharedGroups.Equal(o.SharedGroups) && - b.Disabled == o.Disabled + b.Disabled == o.Disabled && + + b.Blocker == o.Blocker } func (b *Balance) MatchFilter(o *Balance, skipIds bool) bool {