mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-22 15:48:44 +05:00
Action bug fixup, fix cost field in stor db
This commit is contained in:
@@ -12,8 +12,8 @@ CREATE TABLE `cost_details` (
|
||||
`account` varchar(128) NOT NULL,
|
||||
`subject` varchar(128) NOT NULL,
|
||||
`destination` varchar(128) NOT NULL,
|
||||
`cost` DECIMAL(5,4) NOT NULL,
|
||||
`connect_fee` DECIMAL(5,4) NOT NULL,
|
||||
`cost` double(20,4) NOT NULL,
|
||||
`connect_fee` double(20,4) NOT NULL,
|
||||
`timespans` text,
|
||||
`source` varchar(64) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
|
||||
@@ -119,6 +119,9 @@ func resetPrepaidAction(ub *UserBalance, a *Action) (err error) {
|
||||
}
|
||||
|
||||
func topupResetAction(ub *UserBalance, a *Action) (err error) {
|
||||
if ub.BalanceMap == nil { // Init the map since otherwise will get error if nil
|
||||
ub.BalanceMap = make(map[string]BalanceChain, 0)
|
||||
}
|
||||
ub.BalanceMap[a.BalanceId+a.Direction] = BalanceChain{&Balance{Value: 0}} // ToDo: can ub be empty here?
|
||||
genericMakeNegative(a)
|
||||
genericDebit(ub, a)
|
||||
|
||||
Reference in New Issue
Block a user