diff --git a/backend/src/graphql/resolver/TransactionResolver.ts b/backend/src/graphql/resolver/TransactionResolver.ts index 310ea37d1..461a70a00 100644 --- a/backend/src/graphql/resolver/TransactionResolver.ts +++ b/backend/src/graphql/resolver/TransactionResolver.ts @@ -199,7 +199,12 @@ export class TransactionResolver { // decay & link transactions if (currentPage === 1 && order === Order.DESC) { transactions.push( - virtualDecayTransaction(lastTransaction.balance, lastTransaction.balanceDate, now, self), + virtualDecayTransaction( + lastTransaction.balance.minus(sumHoldAvailableAmount.toString()), + lastTransaction.balanceDate, + now, + self, + ), ) // virtual transaction for pending transaction-links sum if (sumHoldAvailableAmount.greaterThan(0)) { diff --git a/frontend/src/components/DecayInformations/DecayInformation-Decay.vue b/frontend/src/components/DecayInformations/DecayInformation-Decay.vue index 6abacd2b8..d8ba13738 100644 --- a/frontend/src/components/DecayInformations/DecayInformation-Decay.vue +++ b/frontend/src/components/DecayInformations/DecayInformation-Decay.vue @@ -13,7 +13,7 @@
- {{ (Number(balance) - Number(decay)) | GDD }} + {{ previousBookedBalance | GDD }} {{ decay | GDD }} {{ $t('math.equal') }} {{ balance | GDD }}
@@ -33,6 +33,10 @@ export default { type: String, required: true, }, + previousBookedBalance: { + type: String, + required: true, + }, }, } diff --git a/frontend/src/components/GddTransactionList.spec.js b/frontend/src/components/GddTransactionList.spec.js index ba45d93d4..aeecf43cc 100644 --- a/frontend/src/components/GddTransactionList.spec.js +++ b/frontend/src/components/GddTransactionList.spec.js @@ -419,6 +419,7 @@ describe('GddTransactionList', () => { }, id: idx + 1, typeId: 'RECEIVE', + balance: '33.33', } }) diff --git a/frontend/src/components/GddTransactionList.vue b/frontend/src/components/GddTransactionList.vue index 2424907c5..37605711c 100644 --- a/frontend/src/components/GddTransactionList.vue +++ b/frontend/src/components/GddTransactionList.vue @@ -15,7 +15,11 @@
@@ -32,6 +37,7 @@ class="list-group-item" v-bind="transactions[index]" :decayStartBlock="decayStartBlock" + :previousBookedBalance="previousBookedBalance(index)" v-on="$listeners" /> @@ -41,6 +47,7 @@ class="list-group-item" v-bind="transactions[index]" :decayStartBlock="decayStartBlock" + :previousBookedBalance="previousBookedBalance(index)" v-on="$listeners" /> @@ -110,6 +117,10 @@ export default { }) window.scrollTo(0, 0) }, + previousBookedBalance(idx) { + if (this.transactions[idx + 1]) return this.transactions[idx + 1].balance + return '0' + }, }, watch: { currentPage() { diff --git a/frontend/src/components/Transactions/TransactionCreation.spec.js b/frontend/src/components/Transactions/TransactionCreation.spec.js index e1ea9e0b0..be0713ecf 100644 --- a/frontend/src/components/Transactions/TransactionCreation.spec.js +++ b/frontend/src/components/Transactions/TransactionCreation.spec.js @@ -31,6 +31,7 @@ const propsData = { memo: 'sadasd asdasdasdasdadadd da dad aad', typeId: 'DECAY', decayStartBlock: new Date('2021-05-13T17:46:31.000Z'), + previousBookedBalance: '43.56', } describe('TransactionCreation', () => { diff --git a/frontend/src/components/Transactions/TransactionCreation.vue b/frontend/src/components/Transactions/TransactionCreation.vue index f343a92ac..dce11307b 100644 --- a/frontend/src/components/Transactions/TransactionCreation.vue +++ b/frontend/src/components/Transactions/TransactionCreation.vue @@ -47,7 +47,7 @@ import DecayRow from '../TransactionRows/DecayRow' import DecayInformation from '../DecayInformations/DecayInformation' export default { - name: 'slot-creation', + name: 'TransactionCreation', components: { CollapseIcon, TypeIcon, @@ -86,6 +86,10 @@ export default { type: Date, required: true, }, + previousBookedBalance: { + type: String, + required: true, + }, }, data() { return { diff --git a/frontend/src/components/Transactions/TransactionDecay.spec.js b/frontend/src/components/Transactions/TransactionDecay.spec.js index 232e7f85a..8c5236b6e 100644 --- a/frontend/src/components/Transactions/TransactionDecay.spec.js +++ b/frontend/src/components/Transactions/TransactionDecay.spec.js @@ -31,6 +31,7 @@ const propsData = { memo: 'sadasd asdasdasdasdadadd da dad aad', typeId: 'DECAY', decayStartBlock: new Date('2021-05-13T17:46:31.000Z'), + previousBookedBalance: '43.56', } describe('TransactionDecay', () => { diff --git a/frontend/src/components/Transactions/TransactionDecay.vue b/frontend/src/components/Transactions/TransactionDecay.vue index 2f235502a..372705a4c 100644 --- a/frontend/src/components/Transactions/TransactionDecay.vue +++ b/frontend/src/components/Transactions/TransactionDecay.vue @@ -21,7 +21,11 @@
- + @@ -33,7 +37,7 @@ import AmountAndNameRow from '../TransactionRows/AmountAndNameRow' import DecayInformationDecay from '../DecayInformations/DecayInformation-Decay' export default { - name: 'slot-decay', + name: 'TransactionDecay', components: { CollapseIcon, TypeIcon, @@ -53,6 +57,10 @@ export default { type: Object, required: true, }, + previousBookedBalance: { + type: String, + required: true, + }, }, data() { return { diff --git a/frontend/src/components/Transactions/TransactionReceive.spec.js b/frontend/src/components/Transactions/TransactionReceive.spec.js index f5b27cf47..46cb57e06 100644 --- a/frontend/src/components/Transactions/TransactionReceive.spec.js +++ b/frontend/src/components/Transactions/TransactionReceive.spec.js @@ -31,6 +31,7 @@ const propsData = { memo: 'sadasd asdasdasdasdadadd da dad aad', typeId: 'RECEIVE', decayStartBlock: new Date('2021-05-13T17:46:31.000Z'), + previousBookedBalance: '43.56', } describe('TransactionReceive', () => { diff --git a/frontend/src/components/Transactions/TransactionReceive.vue b/frontend/src/components/Transactions/TransactionReceive.vue index f83c84e53..32e40f71e 100644 --- a/frontend/src/components/Transactions/TransactionReceive.vue +++ b/frontend/src/components/Transactions/TransactionReceive.vue @@ -53,7 +53,7 @@ import DecayRow from '../TransactionRows/DecayRow' import DecayInformation from '../DecayInformations/DecayInformation' export default { - name: 'slot-receive', + name: 'TransactionReceive', components: { CollapseIcon, TypeIcon, @@ -95,6 +95,10 @@ export default { type: Number, required: false, }, + previousBookedBalance: { + type: String, + required: true, + }, }, data() { return { diff --git a/frontend/src/components/Transactions/TransactionSend.spec.js b/frontend/src/components/Transactions/TransactionSend.spec.js index 632c0857a..410fcc733 100644 --- a/frontend/src/components/Transactions/TransactionSend.spec.js +++ b/frontend/src/components/Transactions/TransactionSend.spec.js @@ -31,6 +31,7 @@ const propsData = { memo: 'sadasd asdasdasdasdadadd da dad aad', typeId: 'SEND', decayStartBlock: new Date('2021-05-13T17:46:31.000Z'), + previousBookedBalance: '43.56', } describe('TransactionSend', () => { diff --git a/frontend/src/components/Transactions/TransactionSend.vue b/frontend/src/components/Transactions/TransactionSend.vue index 2f9ef54d2..a1ea3c88e 100644 --- a/frontend/src/components/Transactions/TransactionSend.vue +++ b/frontend/src/components/Transactions/TransactionSend.vue @@ -53,7 +53,7 @@ import DecayRow from '../TransactionRows/DecayRow' import DecayInformation from '../DecayInformations/DecayInformation' export default { - name: 'slot-send', + name: 'TransactionSend', components: { CollapseIcon, TypeIcon, @@ -96,6 +96,10 @@ export default { type: Number, required: false, }, + previousBookedBalance: { + type: String, + required: true, + }, }, data() { return {