started balance blocker flag

This commit is contained in:
Radu Ioan Fericean
2016-01-12 22:19:12 +02:00
parent 8d0c125b62
commit 13834eefbe
2 changed files with 12 additions and 1 deletions

View File

@@ -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)

View File

@@ -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 {