First steps for reconciliation fix.

This commit is contained in:
James Cole
2019-08-02 16:31:36 +02:00
parent 494f783a2b
commit 6ac08de71d
4 changed files with 25 additions and 18 deletions

View File

@@ -117,6 +117,7 @@ class ReconcileController extends Controller
$startDate = clone $start;
$startDate->subDay();
$startBalance = round(app('steam')->balance($account, $startDate), $currency->decimal_places);
$endBalance = round(app('steam')->balance($account, $end), $currency->decimal_places);
$subTitleIcon = config(sprintf('firefly.subIconsByIdentifier.%s', $account->accountType->type));
$subTitle = (string)trans('firefly.reconcile_account', ['account' => $account->name]);

View File

@@ -201,11 +201,16 @@ class ReconcileController extends Controller
$inverse = true;
}
// transfer to this account? then positive amount:
if (TransactionType::TRANSFER === $journal['transaction_type_type']
&& $account->id === $journal['destination_account_id']
) {
if (TransactionType::TRANSFER === $journal['transaction_type_type'] && $account->id === $journal['destination_account_id']) {
$inverse = true;
}
// reconciliation into account? then positive amount:
if (TransactionType::RECONCILIATION === $journal['transaction_type_type']) {
$inverse = true;
}
if (true === $inverse) {
$journal['amount'] = app('steam')->positive($journal['amount']);
if (null !== $journal['foreign_amount']) {