Include inflows in transaction amounts
1 file changed, 3 insertions(+), 3 deletions(-)
M src/Command/ConvertCommand.php → src/Command/ConvertCommand.php
@@ -129,7 +129,7 @@ } $target = new LedgerPosting; $target->account = getAccount(explode(' : ', $txn->payee)[1], $txn); $target->currency = $txn->currency; - $target->amount = $txn->out; + $target->amount = $txn->in - $txn->out; $lTxn->postings[] = $target; $source = new LedgerPosting;@@ -149,7 +149,7 @@ do { $target = new LedgerPosting; $target->account = array_merge(['Expenses'], $txn->category); $target->currency = $txn->currency; - $target->amount = $txn->out; + $target->amount = $txn->in - $txn->out; sscanf($txn->memo, "(Split %d/%d) %[^\r]", $i, $k, $target->note); $lTxn->postings[] = $target;@@ -167,7 +167,7 @@ } else { $target = new LedgerPosting; $target->account = array_merge(['Expenses'], $txn->category); $target->currency = $txn->currency; - $target->amount = $txn->out; + $target->amount = $txn->in - $txn->out; $lTxn->postings[] = $target; $source = new LedgerPosting;