Last code optimization before release.

This commit is contained in:
James Cole
2018-07-28 10:45:16 +02:00
parent d35470a79e
commit 0c7b652a70
42 changed files with 217 additions and 301 deletions

View File

@@ -46,11 +46,11 @@ class Transaction extends Twig_Extension
*/
public function amount(TransactionModel $transaction): string
{
// at this point amount is always negative.
$amount = bcmul(app('steam')->positive((string)$transaction->transaction_amount), '-1');
$format = '%s';
$coloured = true;
// at this point amount is always negative.
if (TransactionType::RECONCILIATION === $transaction->transaction_type_type && 1 === bccomp((string)$transaction->transaction_amount, '0')) {
$amount = bcmul($amount, '-1');
}