show diff on address page when tx spends back into the same wallet

This commit is contained in:
Alex Grintsvayg 2018-06-08 13:40:08 -04:00
parent c8ca48220f
commit 70032020f5
2 changed files with 3 additions and 7 deletions

View file

@ -158,13 +158,8 @@
<td class="right"><?php echo number_format($tx->Confirmations, 0, '', ',') ?></td>
<td class="right"><?php echo $tx->InputCount ?></td>
<td class="right"><?php echo $tx->OutputCount ?></td>
<td class="right<?php echo ' ' . (($tx->DebitAmount > 0 && $tx->CreditAmount > 0) ? '' : (($tx->DebitAmount > 0) ? 'debit' : 'credit')) ?>">
<?php if ($tx->DebitAmount > 0 && $tx->CreditAmount > 0): ?>
<div class="credit">+<?php echo number_format($tx->CreditAmount, 8, '.', ',') ?> LBC</div>
<div class="debit">-<?php echo number_format($tx->DebitAmount, 8, '.', ',') ?> LBC</div>
<?php else: ?>
<?php echo (($tx->DebitAmount > 0) ? '-' : '+'); ?><?php echo number_format((($tx->DebitAmount > 0) ? $tx->DebitAmount : $tx->CreditAmount), 8, '.', ',') ?> LBC
<?php endif; ?>
<td class="right<?php echo ' ' . ($tx->DebitAmount > 0 && $tx->CreditAmount > 0 ? 'diff' : ($tx->DebitAmount > 0 ? 'debit' : 'credit')) ?>">
<?php echo number_format($tx->CreditAmount - $tx->DebitAmount, 8, '.', ',') ?> LBC
</td>
</tr>
<?php endforeach; ?>

View file

@ -295,6 +295,7 @@ footer .content .page-time { position: absolute; right: 12px; bottom: 0px; paddi
.tx-table td { vertical-align: top; line-height: 24px }
.tx-table td.credit, .tx-table td div.credit { color: #00e676 }
.tx-table td.debit, .tx-table td div.debit { color: #ff0000 }
.tx-table td.diff, .tx-table td div.diff{ color: #337ab7 }
.tx-table td div.debit { padding-top: 8px }
.pagination { width: 1200px; margin: 36px auto 0 auto; cursor: default }