mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-19 19:01:39 +00:00
Code for reconcile.
This commit is contained in:
@@ -57,6 +57,11 @@ class Transaction extends Twig_Extension
|
||||
$format = '%s';
|
||||
$coloured = true;
|
||||
|
||||
// at this point amount is always negative.
|
||||
if ($transaction->transaction_type_type === TransactionType::RECONCILIATION && bccomp(strval($transaction->transaction_amount),'0') === 1) {
|
||||
$amount = bcmul($amount, '-1');
|
||||
}
|
||||
|
||||
if (TransactionType::DEPOSIT === $transaction->transaction_type_type) {
|
||||
$amount = bcmul($amount, '-1');
|
||||
}
|
||||
@@ -285,6 +290,10 @@ class Transaction extends Twig_Extension
|
||||
return $cache->get();
|
||||
}
|
||||
|
||||
if($transaction->transaction_type_type === TransactionType::RECONCILIATION) {
|
||||
return '—';
|
||||
}
|
||||
|
||||
$name = app('steam')->tryDecrypt($transaction->account_name);
|
||||
$transactionId = intval($transaction->account_id);
|
||||
$type = $transaction->account_type;
|
||||
@@ -387,6 +396,9 @@ class Transaction extends Twig_Extension
|
||||
case TransactionType::OPENING_BALANCE:
|
||||
$txt = sprintf('<i class="fa-fw fa fa-star-o" title="%s"></i>', trans('firefly.openingBalance'));
|
||||
break;
|
||||
case TransactionType::RECONCILIATION:
|
||||
$txt = sprintf('<i class="fa-fw fa fa-calculator" title="%s"></i>', trans('firefly.reconciliation_transaction'));
|
||||
break;
|
||||
default:
|
||||
$txt = '';
|
||||
break;
|
||||
@@ -464,6 +476,9 @@ class Transaction extends Twig_Extension
|
||||
if ($cache->has()) {
|
||||
return $cache->get();
|
||||
}
|
||||
if($transaction->transaction_type_type === TransactionType::RECONCILIATION) {
|
||||
return '—';
|
||||
}
|
||||
|
||||
// if the amount is negative, assume that the current account (the one in $transaction) is indeed the source account.
|
||||
$name = app('steam')->tryDecrypt($transaction->account_name);
|
||||
|
Reference in New Issue
Block a user