Code that allows transaction reconciliation. #736

This commit is contained in:
James Cole
2017-11-05 19:48:43 +01:00
parent bb46d034cd
commit 33d89d52c2
16 changed files with 387 additions and 35 deletions

View File

@@ -80,6 +80,7 @@ class JournalCollector implements JournalCollectorInterface
'transactions.id as id',
'transactions.description as transaction_description',
'transactions.account_id',
'transactions.reconciled',
'transactions.identifier',
'transactions.transaction_journal_id',
'transactions.amount as transaction_amount',
@@ -171,7 +172,7 @@ class JournalCollector implements JournalCollectorInterface
$q1->where(
function (EloquentBuilder $q2) use ($amount) {
// amount < 0 and .amount > -$amount
$amount = bcmul($amount,'-1');
$amount = bcmul($amount, '-1');
$q2->where('transactions.amount', '<', 0)->where('transactions.amount', '>', $amount);
}
)
@@ -199,7 +200,7 @@ class JournalCollector implements JournalCollectorInterface
$q1->where(
function (EloquentBuilder $q2) use ($amount) {
// amount < 0 and .amount < -$amount
$amount = bcmul($amount,'-1');
$amount = bcmul($amount, '-1');
$q2->where('transactions.amount', '<', 0)->where('transactions.amount', '<', $amount);
}
)
@@ -211,6 +212,7 @@ class JournalCollector implements JournalCollectorInterface
);
}
);
return $this;
}