From 102c7ffde62a1a2ee08678747583ee207b8263cf Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 7 Apr 2015 16:41:34 +0100 Subject: Remove Pre-YNAB debt category from output --- src/Command/ConvertCommand.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/Command/ConvertCommand.php') diff --git a/src/Command/ConvertCommand.php b/src/Command/ConvertCommand.php index ca2bcc4..1df8249 100644 --- a/src/Command/ConvertCommand.php +++ b/src/Command/ConvertCommand.php @@ -93,12 +93,14 @@ function toLedger (Generator $transactions) { $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(); -- cgit 1.4.1