mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
round down decay amount and balance
This commit is contained in:
parent
15e3aeb7e6
commit
a32e0a9d43
@ -11,7 +11,7 @@ export class Decay {
|
|||||||
duration: number | null,
|
duration: number | null,
|
||||||
) {
|
) {
|
||||||
this.balance = balance
|
this.balance = balance
|
||||||
this.decay = decay
|
this.decay = decay.toDecimalPlaces(2, Decimal.ROUND_FLOOR)
|
||||||
this.start = start
|
this.start = start
|
||||||
this.end = end
|
this.end = end
|
||||||
this.duration = duration
|
this.duration = duration
|
||||||
|
|||||||
@ -12,8 +12,8 @@ export class Transaction {
|
|||||||
this.user = user
|
this.user = user
|
||||||
this.previous = transaction.previous
|
this.previous = transaction.previous
|
||||||
this.typeId = transaction.typeId
|
this.typeId = transaction.typeId
|
||||||
this.amount = transaction.amount
|
this.amount = transaction.amount.toDecimalPlaces(2, Decimal.ROUND_DOWN)
|
||||||
this.balance = transaction.balance
|
this.balance = transaction.balance.balance.toDecimalPlaces(2, Decimal.ROUND_DOWN)
|
||||||
this.balanceDate = transaction.balanceDate
|
this.balanceDate = transaction.balanceDate
|
||||||
if (!transaction.decayStart) {
|
if (!transaction.decayStart) {
|
||||||
this.decay = new Decay(transaction.balance, new Decimal(0), null, null, null)
|
this.decay = new Decay(transaction.balance, new Decimal(0), null, null, null)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user