Merge pull request #815 from gradido/636-Display-of-Decay-in-Transaction-Details

decay calculation is calculated
This commit is contained in:
Alexander Friedland 2021-09-24 13:23:18 +02:00 committed by GitHub
commit d5ee9c96fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 77 additions and 13 deletions

View File

@ -19,11 +19,11 @@
</div>
</div>
<div class="d-flex">
<div style="width: 40%" class="text-right pr-3 mr-2">
<b-row>
<b-col col="6" class="text-right">
<div v-if="!decay.decayStartBlock">{{ $t('decay.last_transaction') }}</div>
</div>
<div style="width: 60%">
</b-col>
<b-col col="6">
<div v-if="decay.decayStartBlock > 0">
<div class="display-4">{{ $t('decay.Starting_block_decay') }}</div>
<div>
@ -32,19 +32,19 @@
</div>
</div>
<div>
<span v-if="!decay.decayStart">
<span v-if="decay.decayStart">
{{ $d($moment.unix(decay.decayStart), 'long') }}
{{ $i18n.locale === 'de' ? 'Uhr' : '' }}
</span>
</div>
</div>
</div>
</b-col>
</b-row>
<div class="d-flex">
<div style="width: 40%" class="text-right pr-3 mr-2">
<b-row>
<b-col col="6" class="text-right">
<div v-if="!decay.decayStartBlock">{{ $t('decay.past_time') }}</div>
</div>
<div style="width: 60%">
</b-col>
<b-col col="6">
<div v-if="decay.decayStartBlock > 0">{{ $t('decay.since_introduction') }}</div>
<span v-if="duration">
<span v-if="duration.years > 0">{{ duration.years }} {{ $t('decay.year') }},</span>
@ -60,7 +60,59 @@
{{ duration.seconds }} {{ $t('decay.seconds') }}
</span>
</span>
</div>
</b-col>
</b-row>
<div v-if="decay.balance > 0">
<!-- Decay-->
<b-row>
<b-col col="6" class="text-right">
<div>{{ $t('decay.decay') }}</div>
</b-col>
<b-col col="6">
<div>- {{ decay.balance }}</div>
</b-col>
</b-row>
<hr class="mt-2 mb-2" />
<b-row>
<b-col class="text-center pt-3 pb-2">
<b>{{ $t('decay.calculation_total') }}</b>
</b-col>
</b-row>
<!-- Type-->
<b-row>
<b-col col="6" class="text-right">
<div v-if="type === 'send'">{{ $t('decay.sent') }}</div>
<div v-if="type === 'receive'">{{ $t('decay.received') }}</div>
</b-col>
<b-col col="6">
<div v-if="type === 'send'">- {{ balance }}</div>
<div v-if="type === 'receive'">+ {{ balance }}</div>
</b-col>
</b-row>
<!-- Decay-->
<b-row>
<b-col col="6" class="text-right">
<div>{{ $t('decay.decay') }}</div>
</b-col>
<b-col col="6">
<div>- {{ decay.balance }}</div>
</b-col>
</b-row>
<!-- Total-->
<b-row>
<b-col col="6" class="text-right">
<div>{{ $t('decay.total') }}</div>
</b-col>
<b-col col="6">
<div v-if="type === 'send'">
<b>- {{ parseInt(balance) + decay.balance }}</b>
</div>
<div v-if="type === 'receive'">
<b>{{ parseInt(balance) - decay.balance }}</b>
</div>
</b-col>
</b-row>
</div>
</b-list-group-item>
</b-list-group>
@ -71,6 +123,8 @@
export default {
name: 'DecayInformation',
props: {
balance: { type: Number },
type: { type: String, default: '' },
decay: {
balance: '',
decayDuration: '',

View File

@ -12,6 +12,7 @@
},
"decay": {
"calculation_decay": "Berechnung der Vergänglichkeit",
"calculation_total": "Berechnung der Gesamtsumme",
"created": "Geschöpft",
"days": "Tage",
"decay": "Vergänglichkeit",
@ -31,6 +32,7 @@
"since_introduction": "seit Einführung der Vergänglichkeit",
"Starting_block_decay": "Startblock Vergänglichkeit",
"toCommunity": "An die Gemeinschaft",
"total": "Gesamt",
"year": "Jahre"
},
"error": {

View File

@ -12,6 +12,7 @@
},
"decay": {
"calculation_decay": "Calculation of Decay",
"calculation_total": "Calculation of the grand total",
"created": "Created",
"days": "Days",
"decay": "Decay",
@ -31,6 +32,7 @@
"since_introduction": "Since the introduction of Decay",
"Starting_block_decay": "Starting Block Decay",
"toCommunity": "To the community",
"total": "Total",
"year": "Years"
},
"error": {

View File

@ -76,7 +76,13 @@
<b-collapse v-if="type != 'decay'" class="pb-4" :id="'a' + date + ''">
<div style="border: 0px; background-color: #f1f1f1" class="p-2 pb-4 mb-4">
<decay-information v-if="decay" decaytyp="new" :decay="decay" />
<decay-information
v-if="decay"
decaytyp="new"
:balance="balance"
:decay="decay"
:type="type"
/>
</div>
</b-collapse>