Fixup re-rating not using cost -1

This commit is contained in:
DanB
2014-05-15 16:00:34 +02:00
parent 040430bc3b
commit a90356d62c
2 changed files with 14 additions and 0 deletions

View File

@@ -1423,6 +1423,17 @@ func TestExportCdrsToFile(t *testing.T) {
*/
}
func TestLocalGetCdrs(t *testing.T) {
if !*testLocal {
return
}
var reply []*utils.StoredCdr
req := utils.AttrGetCdrs{}
if err := rater.Call("ApierV1.GetCdrs", req, &reply); err != nil {
t.Error("Unexpected error: ", err.Error())
}
}
func TestLocalSetDC(t *testing.T) {
if !*testLocal {
return

View File

@@ -912,6 +912,9 @@ func (self *SQLStorage) GetStoredCdrs(cgrIds, runIds, tors, cdrHosts, cdrSources
SetupTime: setupTime.Time, AnswerTime: answerTime.Time, Duration: time.Duration(usage.Int64),
ExtraFields: extraFieldsMp, MediationRunId: runid.String, Cost: cost.Float64,
}
if !cost.Valid { //There was no cost provided, will fakely insert 0 if we do not handle it and reflect on re-rating
storCdr.Cost = -1
}
cdrs = append(cdrs, storCdr)
}
return cdrs, nil