mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Withdrew * 10000 and / 10000 since we need to store the full value.
This commit is contained in:
parent
dddd467569
commit
9eb4e8603a
@ -176,7 +176,7 @@ export class AdminResolver {
|
||||
} else {
|
||||
newBalance = lastUserTransaction.balance
|
||||
}
|
||||
newBalance = Number(newBalance) + Number(parseInt(pendingCreation.amount.toString()) / 10000)
|
||||
newBalance = Number(newBalance) + Number(parseInt(pendingCreation.amount.toString()))
|
||||
|
||||
const newUserTransaction = new UserTransaction()
|
||||
newUserTransaction.userId = pendingCreation.userId
|
||||
@ -194,7 +194,7 @@ export class AdminResolver {
|
||||
|
||||
if (!userBalance) userBalance = balanceRepository.create()
|
||||
userBalance.userId = pendingCreation.userId
|
||||
userBalance.amount = Number(newBalance * 10000)
|
||||
userBalance.amount = Number(newBalance)
|
||||
userBalance.modified = new Date()
|
||||
userBalance.recordDate = userBalance.recordDate ? userBalance.recordDate : new Date()
|
||||
await balanceRepository.save(userBalance)
|
||||
|
||||
@ -428,7 +428,7 @@ async function addUserTransaction(
|
||||
if (lastUserTransaction) {
|
||||
newBalance += Number(
|
||||
await calculateDecay(
|
||||
Number(lastUserTransaction.balance * 10000),
|
||||
Number(lastUserTransaction.balance),
|
||||
lastUserTransaction.balanceDate,
|
||||
transaction.received,
|
||||
).catch(() => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user