all repos — archive/ynab-ledger @ 102c7ffde62a1a2ee08678747583ee207b8263cf

Convert exported YNAB data to ledger-cli

Remove Pre-YNAB debt category from output

Alan Pearce
commit

102c7ffde62a1a2ee08678747583ee207b8263cf

parent

e33883dee25749f08a50f423a464082f6c3c0b98

1 file changed, 8 insertions(+), 6 deletions(-)

changed files
M src/Command/ConvertCommand.phpsrc/Command/ConvertCommand.php
@@ -93,12 +93,14 @@ if ($txn instanceof BudgetTransaction) {
$startDate = $txn->date; $lTxn->isVirtual = true; do { - $posting = new LedgerPosting; - $posting->currency = $txn->currency; - $posting->amount = $txn->in; - $posting->account = array_merge(['Funds'], $txn->category); - if ($posting->amount !== 0.00) { - $lTxn->postings[] = $posting; + if ($txn->category[0] != 'Pre-YNAB Debt') { + $posting = new LedgerPosting; + $posting->currency = $txn->currency; + $posting->amount = $txn->in; + $posting->account = array_merge(['Funds'], $txn->category); + if ($posting->amount !== 0.00) { + $lTxn->postings[] = $posting; + } } $transactions->next();