Don’t prepend income wth Expenses category
1 file changed, 10 insertions(+), 2 deletions(-)
M src/Command/ConvertCommand.php → src/Command/ConvertCommand.php
@@ -147,7 +147,11 @@ $source->account = getAccount($txn->account, $txn); do { $target = new LedgerPosting; - $target->account = array_merge(['Expenses'], $txn->category); + if ($txn->category[0] == 'Income') { + $target->account = $txn->category; + } else { + $target->account = array_merge(['Expenses'], $txn->category); + } $target->currency = $txn->currency; $target->amount = $txn->out - $txn->in; sscanf($txn->memo, "(Split %d/%d) %[^\r]", $i, $k, $target->note);@@ -165,7 +169,11 @@ $lTxn->postings[] = $source; } else { $target = new LedgerPosting; - $target->account = array_merge(['Expenses'], $txn->category); + if ($txn->category[0] == 'Income') { + $target->account = $txn->category; + } else { + $target->account = array_merge(['Expenses'], $txn->category); + } $target->currency = $txn->currency; $target->amount = $txn->out - $txn->in; $lTxn->postings[] = $target;