updated check on cost details

changed the check of cdr usage to  be less or equal with usage in event cost
This commit is contained in:
gezimbll
2024-05-16 11:15:19 -04:00
committed by Dan Christian Bogos
parent 1ef9ea768e
commit a8b8c84dda

View File

@@ -227,7 +227,7 @@ func (cdrS *CDRServer) rateCDR(cdr *CDRWithAPIOpts) ([]*CDR, error) {
cdr.CGRID, utils.MetaSessionS, cdr.RunID, cdr.OriginID, cdr.OriginHost))
}
if cdr.CostDetails != nil {
if cdr.Usage == cdr.CostDetails.GetUsage() { // Costs were previously calculated, make sure they cover the full usage
if cdr.Usage <= cdr.CostDetails.GetUsage() { // Costs were previously calculated, make sure they cover the full usage
cdr.Cost = cdr.CostDetails.GetCost()
cdr.CostDetails.Compute()
return []*CDR{cdr.CDR}, nil