Improvements for #616 and others.

This commit is contained in:
James Cole
2017-08-23 21:21:42 +02:00
parent 1a89e379a4
commit 394e92d538
19 changed files with 383 additions and 55 deletions

View File

@@ -300,6 +300,7 @@ class Amount
public function transactionAmount(TransactionModel $transaction, bool $coloured = true): string
{
$amount = bcmul(app('steam')->positive(strval($transaction->transaction_amount)), '-1');
$format = '%s';
if ($transaction->transaction_type_type === TransactionType::DEPOSIT) {
@@ -322,7 +323,11 @@ class Amount
if (!is_null($transaction->transaction_foreign_amount)) {
$amount = strval($transaction->transaction_foreign_amount);
$amount = bcmul(app('steam')->positive(strval($transaction->transaction_foreign_amount)), '-1');
if ($transaction->transaction_type_type === TransactionType::DEPOSIT) {
$amount = bcmul($amount, '-1');
}
if ($transaction->transaction_type_type === TransactionType::TRANSFER) {
$amount = app('steam')->positive($amount);