mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Improved unitFctor in refundCharges
This commit is contained in:
committed by
Dan Christian Bogos
parent
5098cce439
commit
ab0475963b
@@ -269,7 +269,7 @@ func (aS *AccountS) refundCharges(ctx *context.Context, tnt string, ecs *utils.E
|
||||
for _, chrg := range ecs.Charges {
|
||||
acntChrg := ecs.Accounting[chrg.ChargingID]
|
||||
var uf *utils.UnitFactor
|
||||
if _, has := ecs.UnitFactors[acntChrg.UnitFactorID]; has {
|
||||
if acntChrg.UnitFactorID != utils.EmptyString {
|
||||
uf = ecs.UnitFactors[acntChrg.UnitFactorID]
|
||||
}
|
||||
if acntChrg.BalanceID != utils.MetaTransAbstract { // *transabstracts is not a real balance, hence the exception
|
||||
@@ -282,7 +282,7 @@ func (aS *AccountS) refundCharges(ctx *context.Context, tnt string, ecs *utils.E
|
||||
for _, chrgID := range acntChrg.JoinedChargeIDs { // refund extra charges
|
||||
extraChrg := ecs.Accounting[chrgID]
|
||||
var joinedChargeUf *utils.UnitFactor
|
||||
if _, has := ecs.UnitFactors[extraChrg.UnitFactorID]; has {
|
||||
if extraChrg.UnitFactorID != utils.EmptyString {
|
||||
joinedChargeUf = ecs.UnitFactors[extraChrg.UnitFactorID]
|
||||
}
|
||||
refundUnitsOnAccount(
|
||||
|
||||
Reference in New Issue
Block a user