mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-25 09:08:45 +05:00
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
|
||||
type TpReader struct {
|
||||
tpid string
|
||||
timezone string
|
||||
ratingStorage RatingStorage
|
||||
accountingStorage AccountingStorage
|
||||
lr LoadReader
|
||||
@@ -36,9 +37,10 @@ type TpReader struct {
|
||||
users map[string]*UserProfile
|
||||
}
|
||||
|
||||
func NewTpReader(rs RatingStorage, as AccountingStorage, lr LoadReader, tpid string) *TpReader {
|
||||
func NewTpReader(rs RatingStorage, as AccountingStorage, lr LoadReader, tpid, timezone string) *TpReader {
|
||||
tpr := &TpReader{
|
||||
tpid: tpid,
|
||||
timezone: timezone,
|
||||
ratingStorage: rs,
|
||||
accountingStorage: as,
|
||||
lr: lr,
|
||||
@@ -456,7 +458,7 @@ func (tpr *TpReader) LoadLCRs() (err error) {
|
||||
}
|
||||
}
|
||||
tag := utils.LCRKey(tpLcr.Direction, tpLcr.Tenant, tpLcr.Category, tpLcr.Account, tpLcr.Subject)
|
||||
activationTime, _ := utils.ParseTimeDetectLayout(tpLcr.ActivationTime)
|
||||
activationTime, _ := utils.ParseTimeDetectLayout(tpLcr.ActivationTime, tpr.timezone)
|
||||
|
||||
lcr, found := tpr.lcrs[tag]
|
||||
if !found {
|
||||
@@ -611,7 +613,7 @@ func (tpr *TpReader) LoadActionTriggers() (err error) {
|
||||
for key, atrsLst := range storAts {
|
||||
atrs := make([]*ActionTrigger, len(atrsLst))
|
||||
for idx, atr := range atrsLst {
|
||||
balanceExpirationDate, _ := utils.ParseTimeDetectLayout(atr.BalanceExpirationDate)
|
||||
balanceExpirationDate, _ := utils.ParseTimeDetectLayout(atr.BalanceExpirationDate, tpr.timezone)
|
||||
id := atr.Id
|
||||
if id == "" {
|
||||
id = utils.GenUUID()
|
||||
@@ -989,7 +991,7 @@ func (tpr *TpReader) LoadCdrStatsFiltered(tag string, save bool) (err error) {
|
||||
// only return error if there was something there for the tag
|
||||
return fmt.Errorf("could not get action triggers for cdr stats id %s: %s", cs.Id, triggerTag)
|
||||
}
|
||||
UpdateCdrStats(cs, triggers, tpStat)
|
||||
UpdateCdrStats(cs, triggers, tpStat, tpr.timezone)
|
||||
tpr.cdrStats[tag] = cs
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user